When my game ends based on the following conditions, ( player scores max points before opponent or player loses all lives or opponent scores max points before player ), I desire the computer to allow the user a certain length of time in which to press the spacebar to play again. If the user does not press the spacebar within the allotted interval then the game returns to the main menu. What am I not doing correctly below?
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Method GAME_OVER_Conditions:Int()
If plr_pnts >= GAME_OVER_PNTS Then
StopChannel ( 0 )
PlaySound ( sfx_plr_wins , 5 )
game_over_message = 1
prev_millisecs = Millisecs()
game_mode = 3
Endif
If plr_lives = 0 Then
StopChannel ( 0 )
PlaySound ( sfx_opnt_wins , 9 )
game_over_message = 2
prev_millisecs = Millisecs()
game_mode = 3
Endif
If opnt_pnts >= GAME_OVER_PNTS Then
StopChannel ( 0 )
PlaySound ( sfx_opnt_wins , 9 )
game_over_message = 3
prev_millisecs = Millisecs()
game_mode = 3
Endif
Return True
End
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Method Game_Over:Int()
If KeyHit ( KEY_SPACE ) Then
For Local i:Int = 0 To 12
StopChannel (i)
Next
SetChannelVolume ( 0 , music_volume*0.25 )
PlaySound ( music_in_game , 0 , 1 )
PlaySound ( sfx_game_start , 2 )
Reset_Game()
game_mode = 1
Endif
EXIT_To_Main_Menu()
If Millisecs() - prev_millisecs = 5000.0 Then game_mode = 0
Return True
End
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|