player: wip weapon types
authorLukas Krickl <lukas@krickl.dev>
Fri, 26 Sep 2025 05:13:35 +0000 (07:13 +0200)
committerLukas Krickl <lukas@krickl.dev>
Fri, 26 Sep 2025 05:13:35 +0000 (07:13 +0200)
src/actor.s
src/defs.s
src/player.s
src/wram.s

index 672e66a902e761006252e66849650cc698e89c1e..9f8545d85fe8dc6c1f1c5e56f608dbff9299dfee 100644 (file)
@@ -226,7 +226,7 @@ actor_test_movement:
                jp nz, @rect_test_loop
 
        pop de
-       ld b, ACTS_MAX
+       ld b, ACTS_MAX + 1 ; +1 to include player
 
        ; start at player actor
        ld hl, player
index 5a722cce634477e165df958da2e6631f2f411044..f26231466999f49a919d80c1cbced8bc894cf803 100644 (file)
@@ -13,7 +13,7 @@
 
 #define NULL 0
 
-#define ACTS_MAX 1
+#define ACTS_MAX 3
 #define MAP_OBJ_MAX 32
 #define RECT_MAX 12 
 
 .de GPF_NO_SCROLL, 1
        ; scroll a row up next vblank
 .de GPF_SCROLL, 2
+
+       ; weapon type for player
+.se 0
+.de WT_PISTOL, 1
+.de WT_RIFLE, 1
index 74c44aef9dba4f48b6efcc78e3b58bc7ff51fe67..5fc83b90d604705d8d8f80783fcc6cede844b692 100644 (file)
@@ -14,9 +14,6 @@ player_init:
        
        ; updates the special player actor
 player_update:
-       ld a, [player_direction_proc]
-       xor a, 1
-       ld [player_direction_proc], a
 
        ld b, BTNUP
        input_held
@@ -242,6 +239,10 @@ player_draw:
        call actor_draw
        ret
        
+       ; shoots the player's current weapon
+player_shoot:
+       ret
+       
        ; combination of update and draw call
 player_update_and_draw:
        call player_draw
index a8ab6cbb68c0e45df3c4c0c15290d0e55e82132b..41420f9b35d389fdf284e3e1535f30532e8bc9b0 100644 (file)
@@ -63,19 +63,20 @@ srand: .adv 2
        ; advance if possible
 player_next_scroll_y: .adv 1
 
-; either 0 or 1
-; if 0 up/down are handeled this frame
-; if 1 left/right are handeled
-; this is done because the player tends to be 
-; colliding with most objects on screen and each direction
-; performs the checks
-player_direction_proc: .adv 1
+
 ; y/x sub pixel movement for player
 player_sub_pixel_y: .adv 1
 player_sub_pixel_x: .adv 1
+       
+       ; current player weapon
+player_curr_weapon: .adv 1
+
 player: .adv act_size
+; actor table should follow player!
 actors: .adv act_size * ACTS_MAX 
+
 map_objs: .adv mo_size * MAP_OBJ_MAX
+
 rectangles: .adv r_size * RECT_MAX
        
        ; temporary rectangle used for collision checks