79#ifndef SIZZLE_CONFIGURED
80#error "include the game's src/fx/Fx.h (its SIZZLE_* switches, then <chgame/Sizzle.h>), not this header alone"
87#ifndef SIZZLE_KIND_SPARK
88#define SIZZLE_KIND_SPARK 1
90#ifndef SIZZLE_KIND_STAR
91#define SIZZLE_KIND_STAR 1
93#ifndef SIZZLE_KIND_DUST
94#define SIZZLE_KIND_DUST 1
96#ifndef SIZZLE_KIND_COIN
97#define SIZZLE_KIND_COIN 0
99#ifndef SIZZLE_KIND_RAIN
100#define SIZZLE_KIND_RAIN 0
102#ifndef SIZZLE_RAIN_KIND_NAME
103#define SIZZLE_RAIN_KIND_NAME RAIN_DROP
105#ifndef SIZZLE_KIND_GOO
106#define SIZZLE_KIND_GOO 0
109#define SIZZLE_BURST 1
111#ifndef SIZZLE_COLOUR_INLINE
112#define SIZZLE_COLOUR_INLINE 0
114#ifndef SIZZLE_COIN_LATE
115#define SIZZLE_COIN_LATE 0
120#ifndef SIZZLE_FOUNTAIN_GOLD_COINS
121#define SIZZLE_FOUNTAIN_GOLD_COINS SIZZLE_KIND_COIN
123#ifndef SIZZLE_COIN_FLOOR
124#define SIZZLE_COIN_FLOOR 122
126#ifndef SIZZLE_COIN_FLOOR_RUNTIME
127#define SIZZLE_COIN_FLOOR_RUNTIME 0
130#define SIZZLE_HUES {RED, GOLD, FELT_LT, CYAN, BLUE}
132#ifndef SIZZLE_HUES_EXPORT
133#define SIZZLE_HUES_EXPORT 1
135#ifndef SIZZLE_HUES_NAME
136#define SIZZLE_HUES_NAME RAIN
138#ifndef SIZZLE_CONFETTI_COLOURS
139#define SIZZLE_CONFETTI_COLOURS {RED, GOLD, FELT_LT, CYAN, BLUE, WHITE}
141#ifndef SIZZLE_NO_PARTICLES
142#define SIZZLE_NO_PARTICLES 0
145#define SIZZLE_FLOATS 1
147#ifndef SIZZLE_FLOAT_CHARS
148#define SIZZLE_FLOAT_CHARS 8
150#ifndef SIZZLE_FLOAT_CLAMP
151#define SIZZLE_FLOAT_CLAMP 0
153#ifndef SIZZLE_FLOAT_BLINK_FIRST
154#define SIZZLE_FLOAT_BLINK_FIRST 0
156#ifndef SIZZLE_BANNER_DROP
157#define SIZZLE_BANNER_DROP 0
159#ifndef SIZZLE_BANNER_CHARS
160#define SIZZLE_BANNER_CHARS 14
162#ifndef SIZZLE_BANNER_ROWS_UP
163#define SIZZLE_BANNER_ROWS_UP (SIZZLE_BANNER_DROP ? 30 : 18)
165#ifndef SIZZLE_BANNER_ROWS_DOWN
166#define SIZZLE_BANNER_ROWS_DOWN (SIZZLE_BANNER_DROP ? 12 : 18)
168#define SIZZLE_RAINBOW 1
172#define SIZZLE_WHITE 16
173#define SIZZLE_BLACK 32
174#define SIZZLE_GREEN 64
176#define SIZZLE_STYLES (SIZZLE_RAINBOW | SIZZLE_GOLD | SIZZLE_RED | SIZZLE_CYAN | SIZZLE_WHITE)
178#ifndef SIZZLE_STYLE_RAMPS
179#define SIZZLE_STYLE_RAMPS SIZZLE_STYLES
181#ifndef SIZZLE_CYAN_INK
182#define SIZZLE_CYAN_INK CYAN
184#ifndef SIZZLE_BANNER_FILL
185#define SIZZLE_BANNER_FILL 0
187#ifndef SIZZLE_HOLD_BANNER
188#define SIZZLE_HOLD_BANNER 1
190#ifndef SIZZLE_BANNER_WRAP
191#define SIZZLE_BANNER_WRAP 1
194#define SIZZLE_SHAKE 1
196#ifndef SIZZLE_FONT_MASK
197#define SIZZLE_FONT_MASK(m, x, y, s, dy, gap) maskFont(m, x, y, s, dy, gap)
199#ifndef SIZZLE_FONT_WIDTH
200#define SIZZLE_FONT_WIDTH(s, gap) fontWidth(s, gap)
203#define SIZZLE_FONT_H FONT_H
205#ifndef SIZZLE_BANNER_AFTER
206#define SIZZLE_BANNER_AFTER(x, y, dy, gap)
209#define SIZZLE_DUST_SPREAD (SIZZLE_KIND_DUST && SIZZLE_DUST >= 2)
215#define SIZZLE_CAT_(a, b) a##b
216#define SIZZLE_CAT(a, b) SIZZLE_CAT_(a, b)
217#define SIZZLE_WORD_RAIN 1
218#define SIZZLE_WORD_RAIN_DROP 2
219#define SIZZLE_WORD_HUES 3
220#if SIZZLE_KIND_RAIN && SIZZLE_HUES_EXPORT && \
221 SIZZLE_CAT(SIZZLE_WORD_, SIZZLE_RAIN_KIND_NAME) == SIZZLE_CAT(SIZZLE_WORD_, SIZZLE_HUES_NAME)
222#error "SIZZLE_RAIN_KIND_NAME and SIZZLE_HUES_NAME are the same word: name the kind RAIN_DROP, or export the hues as HUES"
228#ifdef SIZZLE_KIND_ORDER
229enum Kind : uint8_t { SIZZLE_KIND_ORDER };
241 SIZZLE_RAIN_KIND_NAME,
262void spawn(
Kind k,
int x,
int y,
int vx16,
int vy16, uint8_t life, uint8_t colour);
270void burst(
Kind k,
int x,
int y, uint8_t n,
int speed16, uint8_t colour);
280#if SIZZLE_COIN_FLOOR_RUNTIME
289#if SIZZLE_HUES_EXPORT
290extern const uint8_t SIZZLE_HUES_NAME[5];
296#if SIZZLE_STYLES & SIZZLE_RAINBOW
299#if SIZZLE_STYLES & SIZZLE_GOLD
302#if SIZZLE_STYLES & SIZZLE_RED
305#if SIZZLE_STYLES & SIZZLE_CYAN
308#if SIZZLE_STYLES & SIZZLE_WHITE
311#if SIZZLE_STYLES & SIZZLE_BLACK
314#if SIZZLE_STYLES & SIZZLE_GREEN
326#if SIZZLE_HOLD_BANNER
343void floatText(
const char *text,
int x,
int y, uint8_t colour);
The one include for a CHGame sketch.
Effects: motion maths, the screen shake, and (chgame/Sizzle.h) particles, banners and floating texts.
Definition Fx.h:25
bool activeRows(int &lo, int &hi)
The band of rows everything transient covers (particles, floats, banner, shake): what a partial redra...
void update()
Move everything on by one tick: once per logic tick.
BannerStyle
Banner colour styles (the game's SIZZLE_STYLES decide which exist).
Definition Sizzle.h:295
@ B_RED
Red.
Definition Sizzle.h:303
@ B_WHITE
White.
Definition Sizzle.h:309
@ B_RAINBOW
The casino rainbow.
Definition Sizzle.h:297
@ B_GOLD
Gold.
Definition Sizzle.h:300
@ B_CYAN
Cyan.
Definition Sizzle.h:306
Kind
The particle kinds (the game's switches decide which exist).
Definition Sizzle.h:232
@ CONFETTI
A 2 px scrap that flips flat and upright as it falls. Always present.
Definition Sizzle.h:236
@ STAR
A small plus sign, falling slowly.
Definition Sizzle.h:244
@ SPARK
A pixel with a cross-shaped flash for its first 8 ticks, falling slowly.
Definition Sizzle.h:234
@ DUST
A puff that slows to a stop and shrinks to a speck (see SIZZLE_DUST).
Definition Sizzle.h:247
void drawParticles(uint8_t dust=2)
Draw the particles: while drawing, on top of the scene.
void fountain(int x, int y, uint8_t n)
A fountain of confetti thrown up from a point (a win).
void spawn(Kind k, int x, int y, int vx16, int vy16, uint8_t life, uint8_t colour)
Launch one particle.
void clear()
Remove every particle, float and the banner at once (and stop a shake).
bool bannerActive()
Whether a banner is showing.
bool particlesAlive()
The same as particles().
Definition Sizzle.h:288
void 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 floatText(const char *text, int x, int y, uint8_t colour)
A floating text ("+$15") that rises from a point and fades out.
void 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!...
bool particles()
Whether any particle is still flying.
void drawFloats()
Draw the floating texts: while drawing, on top of the scene.
void drawBanner()
Draw the banner, if one is showing: while drawing, last.
void holdBanner(bool on)
Keep the banner up (before it blinks out) until let go.