CHGame 0.3.0
Libraries for the CHGame handheld
Loading...
Searching...
No Matches
Effects maths

fx::: easing curves, integer sine and cosine, presentation randomness and the screen shake. More...

Namespaces

namespace  fx
 Effects: motion maths, the screen shake, and (chgame/Sizzle.h) particles, banners and floating texts.
 

Detailed Description

fx::: easing curves, integer sine and cosine, presentation randomness and the screen shake.

int y = 20 + fx::ease(fx::OUT_BACK, t, 30) * 60 / 256; // slide in over 30 frames
int bob = fx::isin(chgame.frameCount * 4) * 3 / 256; // +-3 px, a turn every 64 frames
uint32_t frameCount
Frames since boot, counted by nextFrame().
Definition Input.h:128
CHGame chgame
The one instance: chgame.boot(), chgame.pressed() ...
@ OUT_BACK
Overshoots the end, then settles back (goes past 256).
Definition Fx.h:33
int ease(Ease e, int t, int n)
Ease: progress through a curve.
Definition Fx.h:50
int isin(int a)
Integer sine.