Catching Flies: weekly 1-hour jam entry

Show off your games, demos and other (playable) creations.
Post Reply
JoshGrams
Prole
Posts: 33
Joined: Sat May 27, 2017 10:58 am

Catching Flies: weekly 1-hour jam entry

Post 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
Attachments
CatchingFlies.love
(1.96 KiB) Downloaded 166 times
User avatar
MetalMelnic
Prole
Posts: 10
Joined: Sat Mar 04, 2017 3:52 am

Re: Catching Flies: weekly 1-hour jam entry

Post by MetalMelnic »

Neat stuff! I really like how bouncy the movement feels with the trail effect, can you explain how you did that?
Before we learn to run, we must first learn to walk;
before we learn to walk, we must first learn to crawl;
Why should programming be any different?
JoshGrams
Prole
Posts: 33
Joined: Sat May 27, 2017 10:58 am

Re: Catching Flies: weekly 1-hour jam entry

Post 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.
Attachments
CatchingFlies.love
(89.33 KiB) Downloaded 122 times
Post Reply

Who is online

Users browsing this forum: No registered users and 75 guests