summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWormHeamer2025-11-08 02:51:23 -0500
committerWormHeamer2025-11-08 02:51:23 -0500
commitf1163e3c697b25ffc17b061dfbf77f2aae2b2f27 (patch)
tree3371839278228272fea537edde88f35dcb3e2b66
parent5c080072bc1a7e3e7179fc092700fb1975e0f8d7 (diff)
snelk
-rw-r--r--main.c9
1 files changed, 5 insertions, 4 deletions
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;
}