junglejourney
changeset 59:fe9482813dc4
Load player masks into registers for convenience.
| author | David Boddie <david@boddie.org.uk> |
|---|---|
| date | Thu Aug 25 01:59:19 2011 +0200 |
| parents | 76fff1782efe |
| children | 9219a25c0c4f |
| files | mapcode.oph |
| diffstat | 1 files changed, 17 insertions(+), 24 deletions(-) [+] |
line diff
1.1 --- a/mapcode.oph Thu Aug 25 01:42:30 2011 +0200 1.2 +++ b/mapcode.oph Thu Aug 25 01:59:19 2011 +0200 1.3 @@ -3003,6 +3003,17 @@ 1.4 lda #$33 1.5 sta $75 1.6 1.7 + ldx $3303 ; player dy 1.8 + lda player_collision_mask_above,x 1.9 + sta $86 1.10 + lda player_collision_mask_below,x 1.11 + sta $88 1.12 + ldx $3305 ; player dx 1.13 + lda player_collision_mask_left,x 1.14 + sta $87 1.15 + lda player_collision_mask_right,x 1.16 + sta $89 1.17 + 1.18 player_collide_loop: 1.19 1.20 ldy #0 1.21 @@ -3029,14 +3040,11 @@ 1.22 player_check_collide_y_equal: 1.23 ; The enemy is on the same tile as the player so look at the collision 1.24 ; on their common tile. 1.25 - ldx $3303 ; player dy 1.26 - lda player_collision_mask_below,x 1.27 - sta $80 1.28 ldy #3 1.29 lda ($74),y ; dy 1.30 tax 1.31 lda enemy_collision_mask_above,x 1.32 - and $80 1.33 + and $88 ; player mask below 1.34 bne player_check_collide_x 1.35 1.36 jmp player_collide_next 1.37 @@ -3044,14 +3052,11 @@ 1.38 player_check_collide_y_greater: 1.39 ; The enemy is on the tile below the player so look at the collision on 1.40 ; the enemy's tile. 1.41 - ldx $3303 ; player dy 1.42 - lda player_collision_mask_above,x 1.43 - sta $80 1.44 ldy #3 1.45 lda ($74),y ; dy 1.46 tax 1.47 lda enemy_collision_mask_above,x 1.48 - and $80 1.49 + and $86 ; player mask above 1.50 bne player_check_collide_x 1.51 1.52 jmp player_collide_next 1.53 @@ -3059,14 +3064,11 @@ 1.54 player_check_collide_y_less: 1.55 ; The enemy is on the tile above the player so look at the collision on 1.56 ; the player's tile. 1.57 - ldx $3303 ; player dy 1.58 - lda player_collision_mask_below,x 1.59 - sta $80 1.60 ldy #3 1.61 lda ($74),y ; dy 1.62 tax 1.63 lda enemy_collision_mask_below,x 1.64 - and $80 1.65 + and $88 ; player mask below 1.66 bne player_check_collide_x 1.67 1.68 jmp player_collide_next 1.69 @@ -3087,14 +3089,11 @@ 1.70 player_check_collide_x_equal: 1.71 ; The enemy is on the same tile as the player so look at the collision 1.72 ; on their common tile. 1.73 - ldx $3305 ; player dx 1.74 - lda player_collision_mask_right,x 1.75 - sta $80 1.76 ldy #5 1.77 lda ($74),y ; dx 1.78 tax 1.79 lda enemy_collision_mask_left,x 1.80 - and $80 1.81 + and $89 ; player mask right 1.82 bne player_check_collide_destroy 1.83 1.84 jmp player_collide_next 1.85 @@ -3102,14 +3101,11 @@ 1.86 player_check_collide_x_greater: 1.87 ; The enemy is the tile to the right of the player so look at the 1.88 ; collision on the enemy's tile. 1.89 - ldx $3305 ; player dx 1.90 - lda player_collision_mask_left,x 1.91 - sta $80 1.92 ldy #5 1.93 lda ($74),y ; dx 1.94 tax 1.95 lda enemy_collision_mask_left,x 1.96 - and $80 1.97 + and $87 ; player mask left 1.98 bne player_check_collide_destroy 1.99 1.100 jmp player_collide_next 1.101 @@ -3117,14 +3113,11 @@ 1.102 player_check_collide_x_less: 1.103 ; The enemy is the tile to the left of the player so look at the 1.104 ; collision on the player's tile. 1.105 - ldx $3305 ; player dx 1.106 - lda player_collision_mask_right,x 1.107 - sta $80 1.108 ldy #5 1.109 lda ($74),y ; dx 1.110 tax 1.111 lda enemy_collision_mask_right,x 1.112 - and $80 1.113 + and $89 ; player mask right 1.114 bne player_check_collide_destroy 1.115 1.116 player_collide_next:
