Changeset 8183


Ignore:
Timestamp:
2016-07-28 10:53:24 (7 years ago)
Author:
sieerinn
Message:
 
Location:
2016/30/TaavettiV/Street Alien Domination
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • 2016/30/TaavettiV/Street Alien Domination/Street Alien Domination/Street_Alien_Domination/Street_Alien_Domination.cs

    r8175 r8183  
    4747        PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 
    4848        taso.Position = paikka; 
    49         taso.Color = Color.DarkYellowGreen; 
     49        taso.Color = Color.DarkBrown; 
    5050        Add(taso); 
    5151    } 
     
    7373        pelaaja1.Weapon.ProjectileCollision = AmmusOsui; 
    7474        pelaaja1.Weapon.InfiniteAmmo = true; 
    75         pelaaja1.Weapon.FireRate = 100.0; 
    76         pelaaja1.Weapon.Power.DefaultValue = 200; 
     75        pelaaja1.Weapon.FireRate = 1.0; 
     76        pelaaja1.Weapon.Power.DefaultValue = 2000; 
    7777        pelaaja1.Weapon.AmmoIgnoresGravity = false; 
    7878        pelaaja1.Weapon.AmmoIgnoresExplosions = true; 
     
    9797        ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
    9898        Keyboard.Listen(Key.Space, ButtonState.Down, AmmuAseella, "Ammu", pelaaja1); 
    99  
     99        Keyboard.Listen(Key.E, ButtonState.Pressed, HeitaKranaatti, "heitä kranaatti", pelaaja1); 
    100100    } 
    101101 
     
    121121    } 
    122122 
    123     void AmmuAseella(PlatformCharacter hahmo) 
     123    void AmmuAseella(PlatformCharacter pelaaja) 
    124124    { 
    125         PhysicsObject ammus = hahmo.Weapon.Shoot(); 
     125        if (pelaaja.IsDestroyed) return; 
     126 
     127        PhysicsObject ammus = pelaaja.Weapon.Shoot(); 
    126128 
    127129        if (ammus != null) 
     
    131133            ammus.MaximumLifetime = TimeSpan.FromSeconds(2.0); 
    132134        } 
     135 
    133136    } 
     137    void HeitaKranaatti(PlatformCharacter pelaaja) 
     138    { 
     139        if (pelaaja.IsDestroyed) return; 
     140 
     141        Grenade kranu = new Grenade(3.0); 
     142        pelaaja1.Throw(kranu, Angle.FromDegrees(1), 10000); 
     143        kranu.Explosion.ShockwaveReachesObject += KranaattiOsui; 
     144        //Grenade.Destroy (palikan = false); 
     145 
     146        kranu.Explosion.AddShockwaveHandler("vihollinen", KranaattiOsui); 
     147    } 
     148    void KranaattiOsui(IPhysicsObject rajahdyksenKohde, Vector v) 
     149    { 
     150        rajahdyksenKohde.Destroy(); 
     151    } 
     152} 
    134153 
    135154 
    136 } 
Note: See TracChangeset for help on using the changeset viewer.