aboutsummaryrefslogtreecommitdiff
path: root/bunny.gbasm
diff options
context:
space:
mode:
authorAstatin <[email protected]>2024-08-27 18:33:46 +0900
committerAstatin <astatin@redacted>2024-08-27 18:33:46 +0900
commit4a4ff1db8fe026ced0530f8c2531033da43164e6 (patch)
tree2f1055120080dd6b7557fb383dd60e5354e47da4 /bunny.gbasm
parentf0d9de7afa943ebd41c1b202690b2ab3e387f708 (diff)
Add objects and spawn bunny & goal in a random room
Diffstat (limited to 'bunny.gbasm')
-rw-r--r--bunny.gbasm19
1 files changed, 17 insertions, 2 deletions
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