From f1163e3c697b25ffc17b061dfbf77f2aae2b2f27 Mon Sep 17 00:00:00 2001 From: WormHeamer Date: Sat, 8 Nov 2025 02:51:23 -0500 Subject: snelk --- main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 70f925a..5badc2b 100644 --- a/main.c +++ b/main.c @@ -8,6 +8,8 @@ #include "wrmr.h" #include "vui.h" +int alive, paused; + /* input buffer */ int inbuf[32] = { 0 }; @@ -118,7 +120,7 @@ typedef struct { i16 x, y; } Apple; -#define APPLE_MAX ((WIDTH * HEIGHT) / 10 + 1) +#define APPLE_MAX ((WIDTH * HEIGHT) / 100 + 1) u32 napple = APPLE_MAX; Apple apple[APPLE_MAX]; @@ -300,8 +302,6 @@ void apple_draw(void) { } } -int alive, paused; - void draw(void *ctx) { (void)ctx; vui_clear(); @@ -318,7 +318,7 @@ void draw(void *ctx) { vui_printf(0, 1, "apples: %u", napple); vui_printf(0, 2, "last apple bitboard len: %u", last_apple_bb_len); vui_printf(0, 3, "last apple position: %u", last_apple_pos % WIDTH, last_apple_pos / WIDTH); - vui_printf(-1, 0, "snake pos: %hd, %hd ", snk.seg->x, snk.seg->y); + vui_printf(-1, 0, "snake pos: %hd, %hd", snk.seg->x, snk.seg->y); BitBoard bb; apple_bitboard(&bb); @@ -362,6 +362,7 @@ void update(void) { } void snk_chg_dir(Snake *s, Dir d) { + if (paused) return; if (s->len < 2 || d != DIR_FLIP(s->dir)) { s->dir = d; } -- cgit v1.2.3