Page 1 of 1
Catching Flies: weekly 1-hour jam entry
Posted: Sat May 27, 2017 11:23 am
by JoshGrams
This morning I thought it might be fun to do something really quick, so I made a one-hour game. There's not much to it (obviously): you zoom around with the arrow keys, catching randomly generated flies that move in circles. But I think it feels pretty good and is fun to mess around with for a few minutes...
--Josh
Re: Catching Flies: weekly 1-hour jam entry
Posted: Tue Jun 13, 2017 1:22 am
by MetalMelnic
Neat stuff! I really like how bouncy the movement feels with the trail effect, can you explain how you did that?
Re: Catching Flies: weekly 1-hour jam entry
Posted: Tue Jun 13, 2017 5:16 pm
by JoshGrams
It just draws shrinking circles at the positions where it was on the last 30 frames. So the "dragon" is a sequence of positions, and the update function adds the new position to the end of the table, and then removes one from the beginning if there are more than 30 positions.
The actual movement is basic acceleration and friction. Each frame you add acceleration times dt, and subtract friction times speed (for both x and y). Hrm. Friction should have a dt factor as well so it's framerate independent, but apparently I missed that. And then if it's outside the bounds, you move it back in bounds and flip the velocity (x or y).
The flies themselves move in a circle: they are created with a random speed and turning rate.
The love file is just a zip renamed to .love, so feel free to unzip it and look at the source. Or ask more questions if that's not clear enough.
Also here's an updated version with more interesting random generation (no flies that move very slowly, they circle in both directions), a score sort of thing (flies/minute), and fullscreen (Alt-Enter or F11) if you want to zoom around in a bigger space instead of bouncing off the walls.