aboutsummaryrefslogtreecommitdiff
path: root/game/player.asm
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-05-10 12:18:27 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-05-10 12:18:27 +0100
commit2a9dba45c2219757dccb249737d504b922f4451e (patch)
tree9780e6e70ef5b6b7ac8aec5869b9679810024c03 /game/player.asm
parentc1e83a23774fff30a257466e19b1237b3b78b055 (diff)
downloadtr8vm-2a9dba45c2219757dccb249737d504b922f4451e.tar.gz
tr8vm-2a9dba45c2219757dccb249737d504b922f4451e.zip
Add frame support, updated sprite
Diffstat (limited to 'game/player.asm')
-rw-r--r--game/player.asm26
1 files changed, 25 insertions, 1 deletions
diff --git a/game/player.asm b/game/player.asm
index 4a6537f..0e44411 100644
--- a/game/player.asm
+++ b/game/player.asm
@@ -44,5 +44,29 @@ player_update:
ld [a : x], y
- ret
+ ; update frame
+ inc x
+ bo
+ inc a
+
+ ; base frame
+ ld y, 0
+
+ ; both left and right
+ and b, 48
+ cmp b, 48
+ bz
+ jmp player_store_frame
+
+ ; left
+ bit b, 4
+ bz
+ ld y, 2
+ ; right
+ bit b, 5
+ bz
+ ld y, 1
+player_store_frame:
+ ld [a : x], y
+ ret