38extern const int16_t
EASE_CUBIC[17], EASE_BACK[17], EASE_INOUT[17], EASE_BOUNCE[17];
52 : e ==
OUT_BOUNCE ? EASE_BOUNCE :
nullptr, t, n);
89void shake(uint8_t frames, uint8_t amplitude);
Effects: motion maths, the screen shake, and (chgame/Sizzle.h) particles, banners and floating texts.
Definition Fx.h:25
Ease
Easing curves for ease().
Definition Fx.h:30
@ LINEAR
Straight.
Definition Fx.h:31
@ OUT_BACK
Overshoots the end, then settles back (goes past 256).
Definition Fx.h:33
@ OUT_BOUNCE
Drops and bounces to a stop (overshoots).
Definition Fx.h:35
@ IN_OUT
Slow, fast, slow.
Definition Fx.h:34
@ OUT_CUBIC
Fast, then slowing to a stop.
Definition Fx.h:32
bool shaking()
Whether a shake is running.
void applyShake(int y0, int y1, int fill=-1)
Shake the finished framebuffer: call after drawing, before the flush.
int bounce(int t, int n)
The OUT_BOUNCE curve.
Definition Fx.h:58
void shake(uint8_t frames, uint8_t amplitude)
Start a screen shake.
int ease(Ease e, int t, int n)
Ease: progress through a curve.
Definition Fx.h:50
void shakeStop()
Stop the shake at once.
void reseed()
Restart rnd() from its fixed seed.
uint32_t rnd()
A random number for presentation (xorshift32).
int easeCurve(const int16_t *curve, int t, int n)
Ease through a curve table.
int rndRange(int lo, int hi)
A random number in a range, for presentation.
int isin(int a)
Integer sine.
void shakeTick()
Count the shake down one tick: once per logic tick.
const int16_t EASE_CUBIC[17]
The curves' tables (17 points, 0..256), for easeCurve().
int icos(int a)
Integer cosine.
Definition Fx.h:66