SOLVED: Panic Button

Started by Surplusguy, Mon 20/05/2013 02:21:50

Previous topic - Next topic

Surplusguy

So, in my game you're chased by someone. I'd like there to be a quicktime event you can use to avoid getting killed if you run into them (in this case tapping the spacebar repeatedly). So far, I have this: on Overlap with cMonster, cEgo stops. A timer starts, which after about 5 seconds checks if a bool variable has been switched. If IsKeyPressed (eKeySpace) = true, the variable is switched and cEgo moves away from the monster, displaying a view of pushing it away. If not, and the variable stays as it is, a view displays of cEgo dying and the game returns to the menu. This is all well and good if you just want the defense to be pushing the spacebar once, but I'd like it to be repeated. Any pointers as to how to do this? Much appreciated!  :)

GHRPLTSM

san.daniele

wouldn't it work to just use an INT instad of BOOL? every hit on space = INTspace++. If INTspace >= 5 push monster away, else die.

Surplusguy

mm, yes. I was considering using an int to make it so when the spacebar was pressed it would go up by one. but i wasn't aware of the function allowing it to go up by one without direct numbering. thanks daniele! :)
GHRPLTSM

SMF spam blocked by CleanTalk