Free games for graphing calculators: NumWorks, TI-Nspire CX, Casio fx-CG50 and soon TI-84 Plus CE. Balatro, Celeste, Hollow Knight, Minecraft and more.
C calculatorcalculator-gamescasiochesscrossy-roaddrive-madfx-cg50gamesgeometry-dashgraphing-calculatorndlessnumworksnumworks-appsnumworks-calculatornumworks-gamenumworks-gamestetristi-84-plus-ceti-nspire
Celeste: spikes and springs ride the blocks they sit on
Mason Chen3ec00b35561e
diff --git a/games/celeste/src/ch3.c b/games/celeste/src/ch3.cindex 94a73fb1..3140567d 100644--- a/games/celeste/src/ch3.c+++ b/games/celeste/src/ch3.c@@ -1122,7 +1122,7 @@ static void ts_layer(uint16_t *strip, int sy0, int sy1, void *ctx) {bool vert = s->dir == TS_UP || s->dir == TS_DOWN;for (int i = 0; i < s->n; i++) {int k = s->first + i;- uint32_t h = hash32((uint32_t)(int)e->x * 7919u + (uint32_t)(int)e->y * 104729u + (uint32_t)i);+ uint32_t h = hash32((uint32_t)e->eid * 104729u + (uint32_t)i); /* its own (Added's randoms): not from where it is, it rides blocks */V2 at = v2add(v2(e->x, e->y), v2mul(along, 2 + i * 4.f));if (!(ts_state[k] & 128)) { /* the tendril, waving */int frame = (int)(fmodf((h % 900) / 100.f + g_level.time_active * 12, 9));diff --git a/games/celeste/src/ent.c b/games/celeste/src/ent.cindex cf2692f3..af824a91 100644--- a/games/celeste/src/ent.c+++ b/games/celeste/src/ent.c@@ -114,10 +114,11 @@ void ents_awake_new(void) {unsorted = true;for (int i = 0; i < g_nents; i++) {Ent *e = &g_ents[i];- if (e->cls && e->cls->awake && !e->awoken) {- e->awoken = 1;- e->cls->awake(e);- }+ if (!e->cls || e->awoken) continue;+ e->awoken = 1;+ /* Solid.Awake / JumpThru.Awake: the static movers riding it are its own (not the level's tiles': AllowStaticMovers) */+ if ((e->kind & (KIND_SOLID | KIND_JUMPTHRU)) && e != g_solidtiles && e->dead != 1) plat_static_movers_attach(e);+ if (e->cls->awake) e->cls->awake(e);}}@@ -489,6 +490,8 @@ void plat_static_movers_trigger(Ent *p) {}void plat_static_movers_attach(Ent *p) {+ uint8_t was = p->collidable;+ if (p->kind & KIND_SOLID) p->collidable = 1; /* Solid.Awake: collidable while it looks */for (int i = 0; i < g_nents; i++) {Ent *m = &g_ents[i];if (!m->cls || !(m->kind & KIND_STATICMOVER) || m->plat || m->dead == 1) continue;@@ -497,6 +500,7 @@ void plat_static_movers_attach(Ent *p) {if (MORE(m->cls)->sm_attach) MORE(m->cls)->sm_attach(m, p);}}+ p->collidable = was;}#define MAX_SHAKES 24