Trading Lives For Time Function
BlitzPlus Forums/BlitzPlus Beginners Area/Trading Lives For Time Function
| ||
I'd like to alter the following code so that instead of ending the game if you trade your last life for time, it will prevent you from doing so when you are on your last life. Therefore, hitting the space-bar when you only have one life left will do nothing. ;##################################################### ; LivesForTime() - Let the player trade life for time ;##################################################### ; Function LivesForTime() If KeyHit(57) Then lives=lives-1 seconds=seconds+10 If lives < 1 Then game_over = True End If End Function Ending the game by trading your last life for time is pointless, so my current code does need an overhaul! Any advice, most appreciated. -- shmup |
| ||
Think in English- if the key is hit AND you have > one life, decrease lives by one and add 10 seconds. |
| ||
Oh wow! /me slaps forehead and turns beetroot... Thanks John. |
| ||
No need for the vegetable impression, it wasn't a stupid question. :) |