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
Catching Flies: weekly 1-hour jam entry
Catching Flies: weekly 1-hour jam entry
- Attachments
-
- CatchingFlies.love
- (1.96 KiB) Downloaded 171 times
- MetalMelnic
- Prole
- Posts: 10
- Joined: Sat Mar 04, 2017 3:52 am
Re: Catching Flies: weekly 1-hour jam entry
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?
before we learn to walk, we must first learn to crawl;
Why should programming be any different?
Re: Catching Flies: weekly 1-hour jam entry
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.
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 127 times
Who is online
Users browsing this forum: No registered users and 1 guest