Ignore:
Timestamp:
2011-06-15 15:00:36 (12 years ago)
Author:
akosrahi
Message:

tein ramboa

Location:
2011/24/AkiR/Fight the Rambo/Fight the Rambo/Fight the Rambo
Files:
4 added
5 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • 2011/24/AkiR/Fight the Rambo/Fight the Rambo/Fight the Rambo/Fight the Rambo.csproj.Debug.cachefile

    r2015 r2027  
    11Content\maali.xnb 
    2 Content\norsu.xnb 
    3 Content\tahti.xnb 
    4 Content\rambo.xnb 
    52Content\rambo1.xnb 
    6 Content\NuHa warrior.xnb 
     3Content\Nuhasotilas.xnb 
     4Content\shit.xnb 
     5Content\shit.wma 
    76kentta1.txt 
  • 2011/24/AkiR/Fight the Rambo/Fight the Rambo/Fight the Rambo/Peli.cs

    r2015 r2027  
    1414 
    1515    PlatformCharacter pelaaja1; 
    16  
     16    PlatformCharacter vihollinen; 
    1717    Image pelaajanKuva = LoadImage("rambo1"); 
    18     Image tahtiKuva = LoadImage("NuHa warrior"); 
     18    Image vihollisenkuva = LoadImage("Nuhasotilas"); 
    1919 
    2020    SoundEffect maaliAani = LoadSoundEffect("maali"); 
     21    Image paikallaanVasemmalle = LoadImage("rambo1"); 
     22    Image paikallaanOikealle; 
     23 
     24    Image[] kavelyVasemmalle = LoadImages("rambo1"); 
     25    Image[] kavelyOikealle; 
    2126     
    22     
     27 
    2328    public override void Begin() 
    2429    { 
     30        ClearAll(); 
     31         
     32        paikallaanOikealle = Image.Mirror(paikallaanVasemmalle); 
     33        kavelyOikealle = Image.Mirror(kavelyVasemmalle); 
     34 
    2535        Gravity = new Vector(0, -1000); 
    2636 
     
    3747    { 
    3848        TileMap kentta = TileMap.FromFile("kentta1.txt"); 
     49        kentta['E'] = lisaaVihollinen; 
    3950        kentta['#'] = lisaaTaso; 
    40         kentta['*'] = lisaaTahti; 
    4151        kentta['N'] = lisaaPelaaja; 
    4252        kentta.Insert(RUUDUN_KOKO, RUUDUN_KOKO); 
     
    4858    { 
    4959        PhysicsObject taso = PhysicsObject.CreateStaticObject(RUUDUN_KOKO, RUUDUN_KOKO); 
    50         taso.Color = Color.Black; 
     60        taso.Color = Color.Beige; 
    5161        return taso; 
    52     } 
    53  
    54     PhysicsObject lisaaTahti() 
    55     { 
    56         PhysicsObject tahti = PhysicsObject.CreateStaticObject(RUUDUN_KOKO, RUUDUN_KOKO); 
    57         tahti.Image = tahtiKuva; 
    58         tahti.Tag = "tahti"; 
    59         return tahti; 
    6062    } 
    6163 
     
    6567        pelaaja1.Mass = 4.0; 
    6668        pelaaja1.Image = pelaajanKuva; 
    67         AddCollisionHandler(pelaaja1, osuTahteen); 
     69        pelaaja1.Weapon = new AssaultRifle(40, 15); 
     70        pelaaja1.Weapon.ProjectileCollision = AmmusOsui; 
     71        pelaaja1.Weapon.Y = -10; 
     72        pelaaja1.Weapon.X = 0; 
     73        pelaaja1.RightIdleAnimation = new Animation(paikallaanVasemmalle); 
     74        pelaaja1.LeftIdleAnimation = new Animation(paikallaanOikealle); 
     75 
     76        pelaaja1.RightWalkingAnimation = new Animation(kavelyVasemmalle); 
     77        pelaaja1.LeftWalkingAnimation = new Animation(kavelyOikealle); 
     78         
     79 
     80 
     81 
     82 
    6883        return pelaaja1; 
    6984    } 
     
    7792        Keyboard.Listen(Key.Right, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 
    7893        Keyboard.Listen(Key.Up, ButtonState.Pressed, hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
     94        Keyboard.Listen(Key.Space, ButtonState.Down, AmmuAseella, "Ammu"); 
    7995 
    8096        ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 
     
    95111    } 
    96112 
    97     void osuTahteen(PhysicsObject hahmo, PhysicsObject kohde) 
     113 
     114 
     115    void AmmuAseella() 
    98116    { 
    99         if (kohde.Tag.ToString() == "tahti") 
     117        PhysicsObject Ammus = pelaaja1.Weapon.Shoot(); 
     118        if (Ammus != null) 
    100119        { 
    101             maaliAani.Play(); 
    102             MessageDisplay.Add("Tuhosit vihollisen!"); 
    103             kohde.Destroy(); 
     120            Ammus.Size *= 4; 
     121            Ammus.MaximumLifetime = TimeSpan.FromSeconds(1.1); 
     122 
    104123        } 
    105124    } 
     125    void AmmusOsui(PhysicsObject Ammus, PhysicsObject Kohde) 
     126    { 
     127        Ammus.Destroy(); 
     128        Explosion rajahdys = new Explosion(10); 
     129        rajahdys.Position = Ammus.Position; 
     130         
     131         
     132    } 
     133 
     134 
     135       PlatformCharacter lisaaVihollinen() 
     136    { 
     137        vihollinen = new PlatformCharacter(70, 70); 
     138        vihollinen.Mass = 4.0; 
     139        vihollinen.Image = vihollisenkuva; 
     140 
     141         
     142        FollowerBrain seuraajanAivot = new FollowerBrain(); 
     143        vihollinen.Brain = seuraajanAivot; 
     144        seuraajanAivot.Target = pelaaja1; 
     145        seuraajanAivot.Speed = 100; 
     146        seuraajanAivot.TargetFollowDistance = 600; 
     147        seuraajanAivot.FollowAlways = true; 
     148        AddCollisionHandler(vihollinen, VihollinenOsui); 
     149 
     150        return vihollinen;                   
     151    } 
     152       void VihollinenOsui(PhysicsObject vihollinen, PhysicsObject kohde) 
     153       { 
     154           if (kohde == pelaaja1) 
     155           { 
     156               MediaPlayer.Play("shit"); 
     157               pelaaja1.Destroy(); 
     158               Begin(); 
     159           } 
     160       } 
    106161} 
     162         
     163 
     164             
     165         
     166     
     167 
  • 2011/24/AkiR/Fight the Rambo/Fight the Rambo/Fight the Rambo/bin/x86/Debug/kentta1.txt

    r2015 r2027  
    22 
    33 
    4         N      * 
    5 ###################### 
     4 
     5 
     6 
     7        N      E        ############# 
     8##################################### 
  • 2011/24/AkiR/Fight the Rambo/Fight the Rambo/Fight the Rambo/kentta1.txt

    r2015 r2027  
    22 
    33 
    4         N      * 
    5 ###################### 
     4 
     5 
     6 
     7        N      E        ############# 
     8##################################### 
  • 2011/24/AkiR/Fight the Rambo/Fight the Rambo/Fight the Rambo/obj/x86/Debug/Fight the Rambo.csproj.FileListAbsolute.txt

    r2015 r2027  
    1 C:\MyTemp\Fight the Rambo\Fight the Rambo\Fight the Rambo\obj\x86\Debug\ResolveAssemblyReference.cache 
    2 C:\MyTemp\Fight the Rambo\Fight the Rambo\Fight the Rambo\obj\x86\Debug\Microsoft.Xna.Framework.RuntimeProfile.txt 
    3 C:\MyTemp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\kentta1.txt 
    4 C:\MyTemp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\maali.xnb 
    5 C:\MyTemp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\norsu.xnb 
    6 C:\MyTemp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\tahti.xnb 
    7 C:\MyTemp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\rambo.xnb 
    8 C:\MyTemp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Fight the Rambo.exe 
    9 C:\MyTemp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Fight the Rambo.pdb 
    10 C:\MyTemp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Jypeli4.dll 
    11 C:\MyTemp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Jypeli4.xml 
    12 C:\MyTemp\Fight the Rambo\Fight the Rambo\Fight the Rambo\obj\x86\Debug\Fight the Rambo.exe 
    13 C:\MyTemp\Fight the Rambo\Fight the Rambo\Fight the Rambo\obj\x86\Debug\Fight the Rambo.pdb 
    14 C:\MyTemp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\rambo1.xnb 
    15 C:\MyTemp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\NuHa warrior.xnb 
     1C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\kentta1.txt 
     2C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Fight the Rambo.exe 
     3C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Fight the Rambo.pdb 
     4C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Jypeli4.dll 
     5C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Jypeli4.xml 
     6C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\obj\x86\Debug\ResolveAssemblyReference.cache 
     7C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\obj\x86\Debug\Microsoft.Xna.Framework.RuntimeProfile.txt 
     8C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\obj\x86\Debug\Fight the Rambo.exe 
     9C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\obj\x86\Debug\Fight the Rambo.pdb 
     10C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\maali.xnb 
     11C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\rambo1.xnb 
     12C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\Nuhasotilas.xnb 
     13C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\shit.xnb 
     14C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\shit.wma 
  • 2011/24/AkiR/Fight the Rambo/Fight the Rambo/Fight the Rambo/obj/x86/Debug/cachefile-{B0E0BEF2-BE44-4A05-9208-56A1391AC4FE}-targetpath.txt

    r2015 r2027  
    11Content\maali.xnb 
    2 Content\norsu.xnb 
    3 Content\tahti.xnb 
    4 Content\rambo.xnb 
    52Content\rambo1.xnb 
    6 Content\NuHa warrior.xnb 
     3Content\Nuhasotilas.xnb 
     4Content\shit.xnb 
     5Content\shit.wma 
Note: See TracChangeset for help on using the changeset viewer.