Changeset 6770 for 2015/27


Ignore:
Timestamp:
2015-07-03 09:42:45 (8 years ago)
Author:
jivesuor
Message:

Tasohyppelyyn lisätty juokseminen Xbox-ohjaimella. Hyppäämiseen lisätty ääni.
Ase muutettu näkymättömäksi. Voittoon tarvittavien tähtien määrä muutettu tasan 50.

Location:
2015/27/JimiS/tasohyppely/hyppely
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • 2015/27/JimiS/tasohyppely/hyppely/hyppely/hyppely/hyppely.cs

    r6764 r6770  
    4646    SoundEffect osuma = LoadSoundEffect("osuma"); 
    4747    SoundEffect tausta = LoadSoundEffect("pelimusiikkibyJimi"); 
     48    SoundEffect hyppy = LoadSoundEffect("hyppyaani"); 
    4849 
    4950    IntMeter pelaajan1Elamat; 
     
    134135        //MediaPlayer.IsRepeating = true; 
    135136 
    136         for (int i = 0; i < 100; i++) 
    137         { 
    138             tausta.Play(); 
    139         } 
     137        //for (int i = 0; i < 100; i++) 
     138        //{ 
     139        //    tausta.Play(); 
     140        //} 
    140141 
    141142        Level.Background.CreateGradient(Color.LightGreen, Color.SkyBlue); 
     
    259260        pelaaja1.Weapon.FireRate = 0.5; 
    260261 
    261         pelaaja1.Weapon.IsVisible = true; 
     262        pelaaja1.Weapon.IsVisible = false; 
    262263 
    263264        pelaaja1.Weapon.ProjectileCollision = AmmusOsuivihuun; 
     
    391392        ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
    392393        ControllerOne.Listen(Button.RightTrigger, ButtonState.Down, AmmuAseella, "Ammu", pelaaja1); 
     394        ControllerOne.Listen(Button.RightShoulder, ButtonState.Down, Juokse, "pelaaja juoksee oikealle", pelaaja1); 
     395        ControllerOne.Listen(Button.LeftShoulder, ButtonState.Down, JuokseVasen, "Pelaaja juoksee vasemmalle", pelaaja1); 
    393396 
    394397        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
     
    407410    } 
    408411 
     412    void Juokse(PlatformCharacter hahmo) 
     413    { 
     414        hahmo.Walk(400); 
     415    } 
     416 
     417    void JuokseVasen(PlatformCharacter hahmo) 
     418    { 
     419        hahmo.Walk(-400); 
     420    } 
     421 
    409422    void Hyppaa(PlatformCharacter hahmo, double nopeus) 
    410423    { 
    411424        hahmo.Jump(nopeus); 
     425        hyppy.Play(); 
    412426    } 
    413427 
     
    452466 
    453467 
    454         if (pelaajan1Tahdet == 51) 
     468        if (pelaajan1Tahdet == 50) 
    455469        { 
    456470            MessageDisplay.Add("Voitit pelin!"); 
Note: See TracChangeset for help on using the changeset viewer.