actor_spawn_test_guard 2, 20, 50
actor_spawn_test_guard 3, 20, 60
actor_spawn_test_guard 4, 20, 70
- actor_spawn_test_guard 5, 40, 80
- actor_spawn_test_guard 6, 40, 90
- actor_spawn_test_guard 7, 50, 90
- actor_spawn_test_guard 8, 60, 90
+ actor_spawn_test_guard 5, 20, 80
+ actor_spawn_test_guard 6, 30, 80
ret
; despawns an actor
-#define PLAYER_SPEED 0x80
+#define PLAYER_SPEED 0xE0
; sets up the player actor
player_init:
; updates the special player actor
player_update:
+ ld a, [player_direction_proc]
+ xor a, 1
+ ld [player_direction_proc], a
+
+ cp a, 1
+ jp z, @left_right
+
ld b, BTNUP
input_held
jr z, @not_up REL
call player_try_move
@not_down:
+ jp @direction_done
+
+@left_right:
ld b, BTNLEFT
input_held
call player_try_move
@not_right:
+@direction_done:
; write collider for this frame
ld a, [player+act_pos_y]
ld b, a
; 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