mossr/PacMan.jl

Speed control?

Opened this issue ยท 2 comments

Amazing work!

Is there a way to, er, slow it down a bit? :)

pacman

Or is it just that I'm not a teenager any more... :(

mossr commented

Ah yes, of course. This feature is a little finicky as I want to define framerate, but you can control the speed with:

using PacMan
gs = PacMan.GameState()
gs.frame_update = 16 # defaults to 8

This controls the delay between frame updates. Play around with it until you feel young again

mossr commented

I made it easier and added the info to the screen when you run using PacMan

using PacMan

will output:

โ”Œ Info: ๐ŸŸก แง แง แง แง โ€ข
โ”‚ 
โ”‚ To start PacMan, run: play()
โ”‚ 
โ”‚ Controls:
โ”‚     - `a` and `d` to apply left and right velocity
โ”‚     - `s` to apply down velocity
โ”‚     - `w` to apply up velocity
โ”‚     - `backtick` to pause, then `play()` to resume
โ”‚ 
โ”‚ Change speed with:
โ””     play(frame_update=8) # larger == slower

So you can control the speed with:

play(frame_update=16)