CHGame 0.3.0
Libraries for the CHGame handheld
Loading...
Searching...
No Matches
Sizzle.h File Reference

Sizzle: the particle pool, the pop-up banner and the floating "+$15" texts the games share, on top of fx:: (chgame/Fx.h). More...

#include <stdint.h>
#include <CHGame.h>

Go to the source code of this file.

Namespaces

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

Enumerations

enum  fx::Kind : uint8_t {
  fx::SPARK ,
  fx::CONFETTI ,
  fx::STAR ,
  fx::DUST
}
 The particle kinds (the game's switches decide which exist). More...
 
enum  fx::BannerStyle : uint8_t {
  fx::B_RAINBOW ,
  fx::B_GOLD ,
  fx::B_RED ,
  fx::B_CYAN ,
  fx::B_WHITE
}
 Banner colour styles (the game's SIZZLE_STYLES decide which exist). More...
 

Functions

void fx::spawn (Kind k, int x, int y, int vx16, int vy16, uint8_t life, uint8_t colour)
 Launch one particle.
 
void fx::burst (Kind k, int x, int y, uint8_t n, int speed16, uint8_t colour)
 A radial burst: n particles flying out from a point.
 
void fx::fountain (int x, int y, uint8_t n)
 A fountain of confetti thrown up from a point (a win).
 
bool fx::particles ()
 Whether any particle is still flying.
 
bool fx::particlesAlive ()
 The same as particles().
 
void fx::banner (const char *text, BannerStyle s, int cy, uint8_t frames=70)
 Show a banner: big centred lettering with an outline that pops in, holds, and blinks out ("BLACKJACK!", "YOU WIN").
 
void fx::holdBanner (bool on)
 Keep the banner up (before it blinks out) until let go.
 
bool fx::bannerActive ()
 Whether a banner is showing.
 
void fx::floatText (const char *text, int x, int y, uint8_t colour)
 A floating text ("+$15") that rises from a point and fades out.
 
void fx::drawFloats ()
 Draw the floating texts: while drawing, on top of the scene.
 
bool fx::activeRows (int &lo, int &hi)
 The band of rows everything transient covers (particles, floats, banner, shake): what a partial redraw must include.
 
void fx::clear ()
 Remove every particle, float and the banner at once (and stop a shake).
 
void fx::update ()
 Move everything on by one tick: once per logic tick.
 
void fx::drawParticles (uint8_t dust=2)
 Draw the particles: while drawing, on top of the scene.
 
void fx::drawBanner ()
 Draw the banner, if one is showing: while drawing, last.
 

Detailed Description

Sizzle: the particle pool, the pop-up banner and the floating "+$15" texts the games share, on top of fx:: (chgame/Fx.h).

This is an implementation header, not part of <CHGame.h>. See Particles, banners and floating texts for how a game configures and compiles it.