Hi there!
I've been using a relatively simple system for sprite animations that I find works pretty well without much overhead. It relies on a simple function to retrieve the current frame of an animation frame list (ani
) based on time
(t()
) and a given speed (spd
) in frames per second:
--get animation frame function anifrm(ani,spd) return ani[1+flr(spd*t()%#ani)] end |
That's it!
Now all we need is to define an animation as a list of sprite IDs:
--define player walk animation pwalkani={2,3,4,5} |
And we can assign this animation to our player just like assigning a single sprite:
--in _update(), during walk logic (e.g. btn left or right) player.sprite=anifrm(pwalkani,10) --in _draw(), using the normal spr() call spr(player.sprite,player.x,player.y) |
Here's an example cart to demonstrate fully, also taking sprite flipping into account:
Full code:
Be aware that because this function is tied to global time (t()
) the current frame shown isn't dependent on when the action began/the animation was set.
Good luck and feel free to let me know if there are any questions or comments about this function or its usage!
srviv
Wield your blessed golden chakram against the oncoming vampire bat horde! Survive and take out as many as you can!
![](/media/85395/ttj p8_1.gif)
Survivors-type made in under 500 chars for tweettweetjam9. Check it out on itch.io
Reload the page to try again. I ran out of characters for a more elegant ending.
Code below...
Bouncy Ball
v3 2024-05-14:
- skarrmann hidden palette added
- increased chance of seeing secret unlockables
"The depressing thing about tennis is that no matter how good I get, I'll never be as good as a wall."
Game Guide
It takes a steady paddle...
The paddle imparts its speed on the ball, so keep it steady or use this to your advantage to control the ball.. if you can keep up with it!
Modifiers
Modifiers will refresh along the back wall every 5 bounces. Some will give you an advantage, others a disadvantage. Be careful what you land on!
- Paddle Size
[7x7] [7x7] - Paddle Speed
[7x7] [7x7] - Ball Speed
[7x7] [7x7] - Gravity Wells (Temporary! Take care when they expire!)
[7x7] [7x7] [7x7] [7x7] - ???
[7x7] - Secret Unlockables?????
[7x7] [7x7] [7x7] ...??
Demo Mode
Bouncy Ball includes a self-playing demo mode. Unlock up to 4 CPU demo skill levels by playing!
Thanks to the PICO-8 community!
Big heartfelt thanks to @zep for making this wonderfully fun tool!
Credit for nice smooth circles goes to @2darray: aacirc()
is used from Marble Merger.
Thanks to everyone on the BBS and Discord for harboring such an amazing community!
This is my first PICO-8 game release, and my second complete game release overall. I tried desperately to keep it as simple as possible in order to actually bring it to completion. As such, the game is only 4 colors!...
...However, there may or may not be additional palettes included as hidden unlockables within the game...
Suggest a suitable (reasonable contrast) 4-color palette in the comments and I may just include it as a rare unlockable option, along with your name!
High Scores
- 49 skarrmann
This is pretty simple but I thought some devs might find it useful as an easy way to add a minimap to your game. It uses tline
to draw a miniature version of the full map area to screen (during your _draw loop):
for i=0,64 do tline(0,32+i,128,32+i,4/8,4/8+i,1) end |
The representative pixel is drawn from the center (4/8,4/8) of each sprite, but you can alter this if you want a different selection.
Here's an example of what this looks like in Celeste:
![](/media/85395/celeste 1 0 fixed for p8 v0 1 2 _0.png)
And here's Air Delivery with this line added:
![](/media/85395/air delivery_0.png)
Obviously it can be a bit messy raw, but it's accurate. For your own project, you could put this against a solid background color in your pause menu, for example. And then you might add an indicator for player position ;)
I hope this can be useful out there!
Shimmerscale
![](/media/85395/shimmerscale_2.gif)
NOW IN GLORIOUS QUADRACOLOR
Consuming 239 chars because I didn't bother to minify further:
cls(13)s=sin a=12b=4 ::_:: t=time()/4 for i=0,36 do for j=0,42 do r=(i+1.4*j)/64 m=12*s(t+r) x=-8+4*i+3.4*s(t+r-.25) y=-20+4*j+8*s(r) if(btn(β))a=11b=5 if(btn(π ΎοΈ))a=12b=4 o=a+(i/3+j/3+t*16)%b line(x,y-m,x+1,y-m+s(t+r+.75),o) end end goto _ |
Press β to activate CHROMATOSIS:
An experimental bleeding-edge 5-color mode
![](/media/85395/shimmerscale p8_2.gif)
Feel free to use/modify this effect for your projects!
a
is the starting color and b
is how many subsequent colors in the palette to use, so you can alter this to use any colors you want using pal({})
and those two variables. Note that the effect relies on not using cls()
so this would be best suited to a splash screen or menu, or for use with clip()
![](/media/85395/colorwave_5.gif)
*angle also slightly modified for this example
I've been working on a little tweetcart so that I might have something to actually release while still at work on more ambitious projects.
I was able to get it down to 272 chars. It runs at 60fps.
Edit: Used up the last few characters fixing a bug, refining the decay and adding some slight interactivity. Some chars can probably be reclaimed by combining the loops somehow (and using goto instead) but I'll probably just leave it at this.
It starts slow and continues building over time. Enjoy!
![](/media/85395/tc280_fire p8_1.gif)