Newtonian gravity simulation
It's a bit unstable. Vector math and fixed point numbers don't mix too well, although I'm sure this could be modified to better utilize the available digit range..
Press Z to pause and adjust the velocities.
Press Ctrl+R to reset the simulation.
It does this.
Move the mouse to restart
I'm working on this small animation library. It adds a straightforward way to animate an object's state.
Let's say there's a game object called "progress", representing a progress bar we want to animate:
we could animate the value rising from 0 to 100 by adding this to something that triggers the progress to start:
and in _update() we want to call the animate() function to keep updating the value, until it's duration has elapsed:
if has_animations(progress) then animate(progress) end
There are some global variables you can override:
animate_default_duration=0.4 animate_default_easing=ease_quad_out animate_key="__a" --which key should contain the tweening animation state
You can also add your own easing functions:
function my_easing(t) return t*t*t end add(animate_easings,my_easing) ease_my_easing=#animate_easings
- node - table that contains the value that should be animated
- target - table of the values that should be tweened
- [options.duration] - how long the tween should play
- [options.easing] - easing function (included easings: linear, quad_in, quad_out and quad_in_out)
- [options.custom_time] - custom starting time
Tweens are removed automatically once the animation completes. Starting a new animation for a key with an active animation will overwrite the previous one, continuing animating from it's current value.
The most recent version is available at https://github.com/thykka/pico-8-libs/blob/main/animate.lua
- refactored & parametrized almost everything
- animate_key() replaced by tween()
- can now tween multiple values with one tween() call
Official port of PePuSnek for SCRIPT-8, improved.
WARNING: Contains flashing lights!
- Changed scoring rules; points are now accumulated, instead of calculated when the game ends
- Added persistent HiScores
- Music on/off setting is now persistent
Checking out a couple of different methods to fill the screen.
cls seem slightly faster than memset. I wonder if the difference is due to the multiplication op, or if there's something else going on...
Left/Right switches modes