Just a simple little 2D-rotation example.
The function takes a 2D position (X,Y) and rotates it by ANGLE. CX,CY represents the center/pivot point.
The lines of code in the middle are the rotation matrix:
local rotx=cosa*x-sina*y local roty=sina*x+cosa*y
This rotates a point around the origin. Before and after doing so, we offset our position by our center coordinate - this lets us rotate around any arbitrary pivot point.
For bonus points: When you're rotating lots of objects by the same angle (like a camera rotating, or a complex prop rotating), you can re-use your SINA and COSA values.
Protect your rebbitts from the angry magician!
We made this for Global Game Jam 2017, at the Omaha, Nebraska site.
Eli Piilonen (Code/Design)
David Carney (Art/Audio)
(Instructions are in-game)
This is a port of my favorite mobile game, which was originally designed by Area/Code Entertainment. Zynga acquired the original version, and they promptly ruined the minimalist experience with a bunch of abrasive and irritating hooks. On top of that, all of the clones I've found have been kind of janky.
Pico8 to the rescue! I'm trying to make the very best totally-free version of Drop7. Your feedback would be greatly appreciated!
Click to drop disks.
A disk is destroyed if its number is equal to the size of the group that contains it. A "group" is a horizontal row or vertical column of adjacent disks (like Connect-4, except with no diagonals).
For example: If you have five disks in a row along the bottom of the screen, any of those disks with a "5" label will be destroyed. Vertical columns of disks work, too.
If you destroy a numbered disk while it's touching an unlabeled disk, then the unlabeled disk will take damage. If you damage an unlabeled disk twice, it will change into a random numbered disk.
After every tenth disk you drop, a row of unlabled disks will rise from the bottom of the screen.
If any disk ends up above the top of the gameplay grid, then you lose. Click anywhere to return to the main menu.
(Hopefully) fixed a bug causing an error when you run the game for the first time. If you get an error on first launch, try refreshing the page...and then please leave a comment saying that the bug isn't fixed yet.
Added three difficulty modes.
Lots more polish compared to the alpha version - Drop-5 and Drop-10 modes, a main menu, scene transitions, a palette selection screen, and more!
Experimenting with a feature that restricts certain unfair number spawns when an unlabeled disk pops inside a large cluster. Might make the game too easy, but then it seems like a feature that could be used for easy/training modes.
A basic Drop7 clone. Will be adding extra features and such over time.
Submit a high score screenshot in the comments to get your time and username included in the level select screen!
- Two new levels
- Scene transitions
- Added titles for levels
- "Congrats" and "return to menu" messages after victory
- Little menu updates
Don't think I'm making any more changes to the game for a while (unless you submit a high score, in which case I'll put your time/username in the level selection screen)
- Two songs and mowing sfx by David Carney/DVGMusic (we're long-time collaborators!)
- Two new levels
- Main menu renders thumbnails of level layouts
- Basic pause menu options (restart level + return to menu)
Feel free to post a high score image for any level in the comments - I'll put your score/username in the level selector.
No gameplay changes this time, but I added a faux-3D stick figure dude to push the mower around. I like him. He's got little nubs for feet, and he sways around with the movement controls a bit.
(Also I removed that "dark pixel" thing from the spray particles, to save some performance.)
Small update. Better update soon.
- Main menu with world record shoutout
- Grass is now green/yellow instead of orange/pink
- Round starts with the player at the bottom, timer doesn't start until you move
- Nicer spray particles (dark pixel added below particle position, in certain cases)
- Changed the title
I saw "Advanced Mower Simul8or" by deKay and remembered that I've been vaguely interested in making a little lawn-mowing game for a while now. There are aspects of lawn-mowing that I think are weirdly satisfying, and I wanna capture some of those things. Pico8 feels like the perfect place for this type of stuff.
You play as Mowerman, who is a lawn mower. Mow every pixel of the lawn. There's no fancy victory announcement or startup countdown yet, but your timer locks in when you're done.
Wanted to see if I could make a post-processing effect to distort previously-drawn screen pixels.
It works, but it's probably too slow to be practical - the much, much cooler thing here is a serendipitous glitch-art effect that happens when the screen isn't cleared between frames. Hit the Z/O key to toggle that.
The distortion effect works like this: It copies the frame buffer into the sprite sheet, then redraws a portion of the screen, pixel by pixel, by reading the sprite sheet - but it modifies the sprite lookup position for each pget() call, so you get the spherical bump when it's done.
Can anybody give me some optimization tips? I feel like there's some kinda trickery out there to make it more powerful (the demo here uses radius=26, but if I put it above 28, it drops to half-fps, at least on my laptop). If you've dealt with lots (thousands) of individual pixel draws per frame, let me know what you learned!
I tried using peek() and poke(), but it seemed like it ended up being slower than pset() for drawing pixels one-at-a-time, since the image data is packed with two pixels per byte - so they had to be separated and joined a bunch of times. Maybe there's some super-lean way to do that, which I didn't think of?
Made some changes to make this thing a bit cooler:
Overhauled the cloth sim so it operates in 3D now. It's projected orthographically ("just uh, ignore the z value for rendering," in this case), so there's no parallax - but even so, allowing points to move on the z-axis produces much more believable motion. I'm leaving the old version up for comparison. Particularly, the mostly-intact flags don't hold themselves upright like a rectangle made of jello anymore.
Added basic "quad rendering." It draws two extra pixel-lines to connect pairs of simulation-lines. Makes it seem like the simulation is much higher-density than it actually is - score! (The cloth sim uses 7 rows with 10 particles each). For style, some of the simulation lines are now invisible (like the horizontal lines along unbroken stripe segments, and all the non-star diagonal structure lines)
- Added an extra prize when you win. It doesn't tell you in-game, but you can mash the "cancel" button on the victory screen to stress test it. Be careful not to hit the OK button, since that still acts as the reset button, like usual.
Started messing with pico8 yesterday, and it's enough fun that I've already made three stupid doodads.
This one is, uh, sort of a game. You can win, but it's really just a clickbaity skinner box where you watch a culturally-exploitative cloth sim in various states of disrepair.
The rarest message is "GET OUT OF AMERICA." You have to mess up really bad to get it. I've literally never seen it happen, but I know that it's possible. You have to pass fewer than 40% of the line-spawn-checks (each line has a random chance to either spawn or not-spawn), but the lowest line-spawn-probability you can get for any given flag is 60%. Because of this, getting a sub-40% score is extremely rare. Maybe somebody can figure out just how rare it is.
Didn't upload the first two doodads because they weren't interactive - but here's a gif of each of them instead: