Changeset 8183
- Timestamp:
- 2016-07-28 10:53:24 (7 years ago)
- 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 47 47 PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 48 48 taso.Position = paikka; 49 taso.Color = Color.Dark YellowGreen;49 taso.Color = Color.DarkBrown; 50 50 Add(taso); 51 51 } … … 73 73 pelaaja1.Weapon.ProjectileCollision = AmmusOsui; 74 74 pelaaja1.Weapon.InfiniteAmmo = true; 75 pelaaja1.Weapon.FireRate = 1 00.0;76 pelaaja1.Weapon.Power.DefaultValue = 200 ;75 pelaaja1.Weapon.FireRate = 1.0; 76 pelaaja1.Weapon.Power.DefaultValue = 2000; 77 77 pelaaja1.Weapon.AmmoIgnoresGravity = false; 78 78 pelaaja1.Weapon.AmmoIgnoresExplosions = true; … … 97 97 ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 98 98 Keyboard.Listen(Key.Space, ButtonState.Down, AmmuAseella, "Ammu", pelaaja1); 99 99 Keyboard.Listen(Key.E, ButtonState.Pressed, HeitaKranaatti, "heitä kranaatti", pelaaja1); 100 100 } 101 101 … … 121 121 } 122 122 123 void AmmuAseella(PlatformCharacter hahmo)123 void AmmuAseella(PlatformCharacter pelaaja) 124 124 { 125 PhysicsObject ammus = hahmo.Weapon.Shoot(); 125 if (pelaaja.IsDestroyed) return; 126 127 PhysicsObject ammus = pelaaja.Weapon.Shoot(); 126 128 127 129 if (ammus != null) … … 131 133 ammus.MaximumLifetime = TimeSpan.FromSeconds(2.0); 132 134 } 135 133 136 } 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 } 134 153 135 154 136 }
Note: See TracChangeset
for help on using the changeset viewer.