36#define CC_DRAWABLE_HEIGHT (TFT_HEIGHT - 38)
A set of colors used to tint a greyscale image.
Definition cosCrunchUtil.h:20
uint64_t timeoutUs
How long the player has until they fail the microgame, in microseconds.
Definition cosCrunch.h:91
const char * failureMsg
The phrase that is flashed on the screen after the microgame if the game was failed....
Definition cosCrunch.h:86
bool(* fnMicrogameTimeout)(void)
This function is called when the microgame timer expires. It is optional and intended for microgames ...
Definition cosCrunch.h:143
wsgPalette_t * cosCrunchMicrogameGetWsgPalette(const tintColor_t *tintColor)
Get a palette suitable for tinting a greyscale image using the drawWsgPalette*() functions from wsgPa...
const char * verb
The phrase that is flashed on the screen before the microgame runs. Should be an action: "Sew",...
Definition cosCrunch.h:74
cosCrunchMicrogameState
Definition cosCrunch.h:39
@ CC_MG_PLAYING
The game is in progress: accept input, render the game, all that jazz.
Definition cosCrunch.h:50
@ CC_MG_GET_READY
This state is shown briefly with the game's verb overlaid before the game starts to orient the player...
Definition cosCrunch.h:45
@ CC_MG_CELEBRATING
The player has succeeded. Display something that elevates their spirits.
Definition cosCrunch.h:55
@ CC_MG_DESPAIRING
The player has failed. Display something that underscores their torment.
Definition cosCrunch.h:60
void(* fnInitMicrogame)(void)
This function is called when this microgame is about to be started. It should initialize variables an...
Definition cosCrunch.h:97
void(* fnMainLoop)(int64_t elapsedUs, uint64_t timeRemainingUs, cosCrunchMicrogameState state, buttonEvt_t buttonEvts[], uint8_t buttonEvtCount)
This function is called from the main loop. The microgame should run its game logic and render like a...
Definition cosCrunch.h:116
void(* fnDestroyMicrogame)(void)
This function is called when the microgame is exited. It should free any allocated memory.
Definition cosCrunch.h:102
void cosCrunchMicrogameResult(bool successful)
Submit the player's result of the currently running microgame. Every microgame must have a success co...
const char * successMsg
The phrase that is flashed on the screen after the microgame if the game was succeeded....
Definition cosCrunch.h:80
void(* fnBackgroundDrawCallback)(int16_t x, int16_t y, int16_t w, int16_t h, int16_t up, int16_t upNum)
This function is called when the display driver wishes to update a section of the display....
Definition cosCrunch.h:134
const tintColor_t * cosCrunchMicrogameGetTintColor(void)
Get a color set (base/highlight/lowlight) suitable for greyscale tinting to use for this microgame....
void cosCrunchMicrogamePersistSplatter(wsg_t wsg, uint16_t x, uint16_t y)
Microgames can leave paint, marker, glitter, and whatever else on the mat that persists across a play...
swadgeMode_t cosCrunchMode
The definition for a Cosplay Crunch microgame. Once your microgame is built, add this struct to the m...
Definition cosCrunch.h:69
A struct of all the function pointers necessary for a swadge mode. If a mode does not need a particul...
Definition wsgPalette.h:74
A sprite using paletteColor_t colors that can be drawn to the display.
Definition wsg.h:57