Re: Help me with game logic

You just need to limit it by e.g. using a time stamp, like this:
Whenever the player walks a step, set the last step time to the current time.
Whenever the player uses the key and tries to walk, check if the current time minus the last walk time is smaller than a given threshold (like 0.3 seconds for example). If yes, simply ignore the step. If no, you can let him walk another step and update the last step time accordingly.
Thats the easiest model you could implement here. Of course you'd require a way to retrieve the current time precisely enough to work with milliseconds, but almost every modern programming language should be able to do that.

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Nuno via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Nuno via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector

Reply via email to