- Timestamp:
- 2015-06-26 07:24:36 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun.cs
r6414 r6421 250 250 private int levelNumber = 0; 251 251 252 private bool invincibility = false; 252 253 private Action activateBoss; 253 254 private Timer fireballTimer; … … 1234 1235 AddCollisionHandler(player, "burn", delegate(PhysicsObject p, PhysicsObject t) 1235 1236 { 1236 player.Life.Value--; 1237 if (!invincibility) 1238 player.Life.Value--; 1237 1239 }); 1238 1240 1239 1241 AddCollisionHandler(player, "lava", delegate(PhysicsObject p, PhysicsObject t) 1240 1242 { 1241 player.Life.Value = player.Life.MinValue; 1243 if (!invincibility) 1244 player.Life.Value = player.Life.MinValue; 1242 1245 }); 1243 1246 … … 1250 1253 else 1251 1254 { 1252 player.Life.Value--; 1255 if (!invincibility) 1256 player.Life.Value--; 1253 1257 } 1254 1258 }); 1255 1256 1259 1257 1260 player.Life.LowerLimit += delegate … … 1331 1334 Keyboard.Listen(Key.Enter, ButtonState.Pressed, GetRidOfImprovement, "Player 1 throws their tools away", startingPlayers[1]); 1332 1335 1336 Keyboard.Listen(Key.F8, ButtonState.Pressed, Invincibility, null); // Demonstraatio tarkoituksiin. 1333 1337 Keyboard.Listen(Key.F9, ButtonState.Pressed, Loss, null); 1334 1338 Keyboard.Listen(Key.F12, ButtonState.Pressed, NextLevel, null); … … 1337 1341 Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Show help"); 1338 1342 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Exit game"); 1343 } 1344 1345 void Invincibility() 1346 { 1347 invincibility = !invincibility; 1348 MessageDisplay.Add("Invincibility mode " + (invincibility ? "on" : "off")); 1339 1349 } 1340 1350
Note: See TracChangeset
for help on using the changeset viewer.