Ignore:
Timestamp:
2015-03-14 15:18:59 (5 years ago)
Author:
hesahave
Message:

sprites

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2014/30/AarniAR/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKid.cs

    r5813 r5824  
    3535 
    3636    int kenttaNro = 1; 
    37     private Image[] running = LoadImages("running1", "running2"); 
    38     private Image[] standinganimation = LoadImages("shootinganimation"); 
    39     private Image[] shootinganimation = LoadImages("shootinganimation"); 
     37    private Image[] running = LoadImages("running1", "Run2"); 
     38    private Image[] standinganimation = LoadImages("Standinganimation"); 
     39    private Image[] shootinganimation = LoadImages("Shootinganimation"); 
    4040    private Image[] jumpinganimation = LoadImages("jumpinganimation"); 
     41    private Image[] runshoot = LoadImages("RunShoot1", "RunShoot2"); 
    4142    private Image[] lifelost = LoadImages("LifeLost"); 
    4243    private Image[] damage = LoadImages("Damage"); 
     
    5152    const double nopeus = 200; 
    5253    const double hyppyNopeus = 350; 
     54    private bool playerisrunningshooting = false; 
     55    private bool playerisshooting = false; 
    5356 
    5457    private Image Cobblestone = LoadImage("CobbleStone"); 
     
    118121    void AseLadattu() 
    119122    { 
    120         MessageDisplay.Add("Ase ladattu"); 
     123        MessageDisplay.Add("Buster Charged"); 
    121124        pelaaja1.Weapon = ladattuAse; 
    122125    } 
     
    205208        pelaaja1.AnimWalk = new Animation(running); 
    206209        pelaaja1.AnimWalk.FPS = 4; 
    207         pelaaja1.AnimIdle = new Animation(shootinganimation); 
     210        pelaaja1.AnimIdle = new Animation(standinganimation); 
    208211        pelaaja1.AnimJump = new Animation(jumpinganimation); 
    209212        pelaaja1.AnimFall = new Animation(jumpinganimation); 
     
    268271        Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
    269272        Keyboard.Listen(Key.P, ButtonState.Pressed, Ammu, "Ampuu", pelaajan1Ase); 
    270         Keyboard.Listen(Key.O, ButtonState.Down, AmmuCharge, "LataaAse"); 
    271         Keyboard.Listen(Key.O, ButtonState.Released, Ammu, "Ampuu", ladattuAse); 
     273        Keyboard.Listen(Key.P, ButtonState.Down, AmmuCharge, "LataaAse"); 
     274        Keyboard.Listen(Key.P, ButtonState.Released, Ammu, "Ampuu", ladattuAse); 
    272275 
    273276        Keyboard.Listen(Key.A, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja2, -nopeus); 
     
    328331            { 
    329332                ammus.Image = Charge; 
    330                 ammus.Size *= 3; 
     333                ammus.Size *= 5; 
    331334            } 
    332  
     335              
    333336            ammus.IgnoresCollisionResponse = true; 
    334             pelaaja1.Animation = new Animation(shootinganimation); 
    335             pelaaja1.Animation.Start(); 
     337 
     338            if (playerisrunningshooting == false) 
     339            { 
     340                pelaaja1.Animation = new Animation(shootinganimation); 
     341                pelaaja1.AnimWalk = new Animation(runshoot); 
     342                playerisrunningshooting = true; 
     343                pelaaja1.AnimWalk.FPS = 4; 
     344                pelaaja1.Animation.Start(); 
     345                Timer.SingleShot(0.3, delegate { pelaaja1.AnimWalk = new Animation(running); pelaaja1.AnimWalk.FPS = 4; playerisrunningshooting = false; }); 
     346            } 
     347            if (playerisshooting == false) 
     348            { 
     349                pelaaja1.AnimIdle = new Animation(shootinganimation); 
     350                playerisshooting = true; 
     351                Timer.SingleShot(0.3, delegate { pelaaja1.AnimIdle = new Animation(standinganimation); playerisshooting = false; }); 
     352            } 
     353             
    336354        } 
    337355 
     
    512530    { 
    513531        if (pelaaja == pelaaja1) 
    514             health.Value -= 15; 
     532            health.Value -= 30; 
    515533        if (pelaaja == pelaaja2) 
    516534            health2.Value -= 15; 
Note: See TracChangeset for help on using the changeset viewer.