junglejourney
changeset 156:4068ea0fad17
Made projectiles fire from two different places to help the player
fire from behind obstacles.
Made projectiles start from positions next to the player.
| author | David Boddie <david@boddie.org.uk> |
|---|---|
| date | Sat Sep 17 22:57:57 2011 +0200 |
| parents | 548640592fab |
| children | 82aab9e84ae3 |
| files | build.py loader.oph mapcode.oph |
| diffstat | 3 files changed, 24 insertions(+), 13 deletions(-) [+] |
line diff
1.1 --- a/build.py Sat Sep 17 22:37:45 2011 +0200 1.2 +++ b/build.py Sat Sep 17 22:57:57 2011 +0200 1.3 @@ -114,6 +114,7 @@ 1.4 # 1.5 # 5760 space 1.6 # 1.7 + # 577F weapon counter (0=fire one subtile below; 1=fire two subtiles below) 1.8 # 5780 item/player flags (128=leave level, 64=player demise, 1.9 # bits 4,5,6=enemy limit, 2=complete game, 1.10 # 1=has key)
2.1 --- a/loader.oph Sat Sep 17 22:37:45 2011 +0200 2.2 +++ b/loader.oph Sat Sep 17 22:57:57 2011 +0200 2.3 @@ -94,8 +94,8 @@ 2.4 code_block: .byte <code_file_name, >code_file_name 2.5 .byte $00, $1e, 0, 0 2.6 .byte $00, $1e, 0, 0 2.7 - .byte $95, $1f, 0, 0 2.8 - .byte $95, $3d, 0, 0 2.9 + .byte $a0, $1f, 0, 0 2.10 + .byte $a0, $3d, 0, 0 2.11 2.12 init_load_window_vdu_bytes: .byte 28,0,29,19,24 2.13
3.1 --- a/mapcode.oph Sat Sep 17 22:37:45 2011 +0200 3.2 +++ b/mapcode.oph Sat Sep 17 22:57:57 2011 +0200 3.3 @@ -2179,21 +2179,22 @@ 3.4 ora $5789 ; apply the projectile type 3.5 sta $5287 3.6 3.7 - lda $5283 ; if dy > 2, create the projectile on the tile below 3.8 - cmp #3 3.9 + lda $5283 ; player dy 3.10 + adc $577f ; add the weapon counter 3.11 + adc #1 3.12 + cmp #4 ; if dy > 3, create the projectile on the tile below 3.13 bpl create_projectile_below 3.14 3.15 clc 3.16 - adc #1 3.17 - sta $5289 ; dy + 1 3.18 + sta $5289 ; dy + weapon counter + 1 3.19 lda $5282 ; y 3.20 sta $5288 3.21 jmp create_projectile_continue 3.22 3.23 create_projectile_below: 3.24 sec 3.25 - sbc #3 3.26 - sta $5289 ; dy - 3 3.27 + sbc #4 3.28 + sta $5289 ; dy + weapon counter + 1 - 4 3.29 clc 3.30 lda $5282 ; y 3.31 adc #1 3.32 @@ -2206,11 +2207,14 @@ 3.33 lda $5285 ; dx 3.34 sta $528b 3.35 3.36 - lda #$86 3.37 - sta $74 3.38 - lda #$52 3.39 - sta $75 3.40 - jsr plot_character 3.41 + lda $577f ; toggle the weapon counter 3.42 + eor #1 3.43 + sta $577f 3.44 + 3.45 + ; Move the projectile away from the player. 3.46 + 3.47 + jsr move_projectile_after_unplot 3.48 + jsr move_projectile 3.49 3.50 clc 3.51 rts 3.52 @@ -3288,6 +3292,8 @@ 3.53 sta $75 3.54 jsr unplot_character 3.55 3.56 + move_projectile_after_unplot: 3.57 + 3.58 lda $5287 3.59 and #$30 ; direction 3.60 3.61 @@ -5280,6 +5286,10 @@ 3.62 3.63 jsr reset_player_position 3.64 3.65 + ; Reset the weapon counter. 3.66 + lda #0 3.67 + sta $577f 3.68 + 3.69 ; Fill the treasure table with objects. 3.70 ldx $578a ; level 3.71 lda key_rooms,x
