junglejourney

changeset 97:af1b34c228a9

Fixed problem with exiting levels when not aligned with the exit.
author David Boddie <david@boddie.org.uk>
date Fri Sep 02 20:14:14 2011 +0200
parents d97dc77ff4c2
children 16f63ddcbbe2
files mapcode.oph
diffstat 1 files changed, 36 insertions(+), 12 deletions(-) [+]
line diff
     1.1 --- a/mapcode.oph	Thu Sep 01 23:13:43 2011 +0200
     1.2 +++ b/mapcode.oph	Fri Sep 02 20:14:14 2011 +0200
     1.3 @@ -1703,10 +1703,10 @@
     1.4      lda ($70),y                 ; load the tile to the left
     1.5  
     1.6      cmp #5                      ; check for the open exit or final exit
     1.7 -    bmi move_player_not_left_exit
     1.8 +    bmi move_player_not_left_exit1
     1.9      jmp try_to_exit_level       ; optimise away the rts
    1.10  
    1.11 -    move_player_not_left_exit:
    1.12 +    move_player_not_left_exit1:
    1.13      cmp #0
    1.14      bne move_player_not_left_key
    1.15  
    1.16 @@ -1720,6 +1720,11 @@
    1.17      sta $70
    1.18      lda ($70),y             ; load the tile below and to the left
    1.19  
    1.20 +    cmp #5                      ; check for the open exit or final exit
    1.21 +    bmi move_player_not_left_exit2
    1.22 +    jmp try_to_exit_level       ; optimise away the rts
    1.23 +
    1.24 +    move_player_not_left_exit2:
    1.25      cmp #0
    1.26      bne move_player_not_left_key
    1.27  
    1.28 @@ -1761,8 +1766,10 @@
    1.29      ldx #189            ; (X)
    1.30      jsr check_key
    1.31      cpy #255
    1.32 -    bne move_player_not_right_key
    1.33 -
    1.34 +    beq move_player_right_key
    1.35 +    jmp move_player_not_right_key
    1.36 +
    1.37 +    move_player_right_key:
    1.38      lda $3d05                   ; read dx
    1.39      cmp #2
    1.40      beq move_player_right_check_x
    1.41 @@ -1792,10 +1799,10 @@
    1.42      lda ($70),y                 ; load the tile to the right
    1.43  
    1.44      cmp #5                      ; check for the open exit or final exit
    1.45 -    bmi move_player_not_right_exit
    1.46 +    bmi move_player_not_right_exit1
    1.47      jmp try_to_exit_level       ; optimise away the rts
    1.48  
    1.49 -    move_player_not_right_exit:
    1.50 +    move_player_not_right_exit1:
    1.51      cmp #0
    1.52      bne move_player_not_right_key
    1.53  
    1.54 @@ -1809,6 +1816,11 @@
    1.55      sta $70
    1.56      lda ($70),y                 ; load the tile below and to the right
    1.57  
    1.58 +    cmp #5                      ; check for the open exit or final exit
    1.59 +    bmi move_player_not_right_exit2
    1.60 +    jmp try_to_exit_level       ; optimise away the rts
    1.61 +
    1.62 +    move_player_not_right_exit2:
    1.63      cmp #0
    1.64      bne move_player_not_right_key
    1.65  
    1.66 @@ -1883,10 +1895,10 @@
    1.67      lda ($70),y                 ; load the tile above
    1.68  
    1.69      cmp #5                      ; check for the open exit or final exit
    1.70 -    bmi move_player_not_up_exit
    1.71 +    bmi move_player_not_up_exit1
    1.72      jmp try_to_exit_level       ; optimise away the rts
    1.73  
    1.74 -    move_player_not_up_exit:
    1.75 +    move_player_not_up_exit1:
    1.76      cmp #0
    1.77      bne move_player_not_up_key
    1.78  
    1.79 @@ -1898,6 +1910,11 @@
    1.80      iny
    1.81      lda ($70),y             ; load the tile above and to the right
    1.82  
    1.83 +    cmp #5                      ; check for the open exit or final exit
    1.84 +    bmi move_player_not_up_exit2
    1.85 +    jmp try_to_exit_level       ; optimise away the rts
    1.86 +
    1.87 +    move_player_not_up_exit2:
    1.88      cmp #0
    1.89      bne move_player_not_up_key
    1.90  
    1.91 @@ -1939,8 +1956,10 @@
    1.92      ldx #151            ; (/)
    1.93      jsr check_key
    1.94      cpy #255
    1.95 -    bne move_player_not_down_key
    1.96 -
    1.97 +    beq move_player_down_key
    1.98 +    jmp move_player_not_down_key
    1.99 +
   1.100 +    move_player_down_key:
   1.101      lda $3d03                   ; read dy
   1.102      cmp #0
   1.103      beq move_player_down_check_y
   1.104 @@ -1970,10 +1989,10 @@
   1.105      lda ($70),y                 ; load the tile below
   1.106  
   1.107      cmp #5                      ; check for the open exit or final exit
   1.108 -    bmi move_player_not_down_exit
   1.109 +    bmi move_player_not_down_exit1
   1.110      jmp try_to_exit_level       ; optimise away the rts
   1.111  
   1.112 -    move_player_not_down_exit:
   1.113 +    move_player_not_down_exit1:
   1.114      cmp #0
   1.115      bne move_player_not_down_key
   1.116  
   1.117 @@ -1985,6 +2004,11 @@
   1.118      iny
   1.119      lda ($70),y                 ; load the tile below and to the right
   1.120  
   1.121 +    cmp #5                      ; check for the open exit or final exit
   1.122 +    bmi move_player_not_down_exit2
   1.123 +    jmp try_to_exit_level       ; optimise away the rts
   1.124 +
   1.125 +    move_player_not_down_exit2:
   1.126      cmp #0
   1.127      bne move_player_not_down_key
   1.128