From 4a4ff1db8fe026ced0530f8c2531033da43164e6 Mon Sep 17 00:00:00 2001 From: Astatin Date: Tue, 27 Aug 2024 18:33:46 +0900 Subject: Add objects and spawn bunny & goal in a random room --- bunny.gbasm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'bunny.gbasm') diff --git a/bunny.gbasm b/bunny.gbasm index 19009d7..9ba996b 100644 --- a/bunny.gbasm +++ b/bunny.gbasm @@ -9,14 +9,27 @@ Initialize_Bunny: LD B, $c8 LD A, (BC) + LD D, A + INC BC + LD A, (BC) + INC A + CALL =RNG_Bound + ADD D + LD $mem_bunny_x, A - INC BC INC BC LD A, (BC) + LD D, A + INC BC + LD A, (BC) + INC A + CALL =RNG_Bound + ADD D LD $mem_bunny_y, A +Fix_Bunny_screen: LD A, $mem_bunny_x SUB $05 LD $mem_viewport_x, A @@ -175,9 +188,11 @@ Move_Bunny: LD $mem_bunny_y, A Move_Bunny.end: + LD A, C + LD $mem_map_loading_flags, A RET -Display_Bunny: ; X position in $81, Y position in $80 +Display_Bunny: LD A, $mem_bunny_x_px LD B, A LD A, $mem_bunny_y_px -- cgit v1.2.3-70-g09d2