Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; SAMPLE FOUR POINTS
- ; top
- lda PlayerPYL
- add #<(8*16)
- lda PlayerPYH
- adc #>(8*16)
- tay
- lda #0
- pha
- add PlayerPXL ; left side
- lda PlayerPXH
- adc #0
- jsr GetLevelColumnPtr
- sta BlockUL
- tax
- lda MetatileFlags,x
- cmp #$80
- rol FourCorners
- pla
- add #$70
- add PlayerPXL ; right side
- lda PlayerPXH
- adc #0
- jsr GetLevelColumnPtr
- sta BlockUR
- tax
- lda MetatileFlags,x
- cmp #$80
- rol FourCorners
- ;bottom
- lda PlayerPYL
- add #<(24*16)
- lda PlayerPYH
- adc #>(24*16)
- tay
- lda #0 ; left side
- pha
- add PlayerPXL ; left side
- lda PlayerPXH
- adc #0
- jsr GetLevelColumnPtr
- sta BlockLL
- tax
- lda MetatileFlags,x
- cmp BottomCMP
- rol FourCorners
- pla
- add #$70
- add PlayerPXL ; right side
- lda PlayerPXH
- adc #0
- jsr GetLevelColumnPtr
- sta BlockLR
- tax
- lda MetatileFlags,x
- cmp BottomCMP
- rol FourCorners
- ; now call the right routine
- ldx FourCorners
- lda FourCornersH,x
- pha
- lda FourCornersL,x
- pha
- rts
- FourCornersL: ; top left, top right, bottom left, bottom right
- .byt <(FC_____ -1), <(FC____R -1)
- .byt <(FC___L_ -1), <(FC___LR -1)
- .byt <(FC__R__ -1), <(FC__R_R -1)
- .byt <(FC__RL_ -1), <(FC__RLR -1)
- .byt <(FC_L___ -1), <(FC_L__R -1)
- .byt <(FC_L_L_ -1), <(FC_L_LR -1)
- .byt <(FC_LR__ -1), <(FC_LR_R -1)
- .byt <(FC_LRL_ -1), <(FC_LRLR -1)
- FourCornersH:
- .byt >(FC_____ -1), >(FC____R -1)
- .byt >(FC___L_ -1), >(FC___LR -1)
- .byt >(FC__R__ -1), >(FC__R_R -1)
- .byt >(FC__RL_ -1), >(FC__RLR -1)
- .byt >(FC_L___ -1), >(FC_L__R -1)
- .byt >(FC_L_L_ -1), >(FC_L_LR -1)
- .byt >(FC_LR__ -1), >(FC_LR_R -1)
- .byt >(FC_LRL_ -1), >(FC_LRLR -1)
- FC_____:
- FC__RL_:
- FC_L__R:
- rts
- FC_LRLR:
- lda PlayerPYL
- sub #$a0
- sta PlayerPYL
- lda PlayerPYH
- sbc #0
- sta PlayerPYH
- lda #0
- sta PlayerVYL
- sta PlayerVYH
- rts
- FC_LR_R:
- rts
- FC_LRL_:
- rts
- FC_L_LR:
- jsr FC___LR
- jmp FC_L_L_
- FC__RLR:
- jsr FC___LR
- jmp FC__R_R
- FC__R_R:
- lda #0
- sta PlayerVXL
- sta PlayerVXH
- sta PlayerPXL
- lda #$8f
- sta PlayerPXL
- lda BlockUR
- cmp #Metatiles::GROUND_CLIMB_L
- bne :+
- DoClimb:
- lda #-1
- sta PlayerVYH
- lda #-$40
- sta PlayerVYL
- lda #10
- sta PlayerJumpCancelLock
- lsr
- sta PlayerWalkLock
- : rts
- FC_L_L_:
- lda #0
- sta PlayerVXL
- sta PlayerVXH
- sta PlayerPXL
- inc PlayerPXH
- lda BlockUL
- cmp #Metatiles::GROUND_CLIMB_R
- beq DoClimb
- rts
- FC_L___:
- lda PlayerPXL
- add #$40
- sta PlayerPXL
- lda PlayerPXH
- adc #0
- sta PlayerPXH
- rts
- FC__R__:
- lda PlayerPXL
- sub #$40
- sta PlayerPXL
- lda PlayerPXH
- sbc #0
- sta PlayerPXH
- rts
- FC_LR__:
- lda #0
- sta PlayerVYH
- sta PlayerVYL
- ; check the block we bumped into
- lda PlayerPYH
- tay
- lda #$40
- add PlayerPXL
- lda PlayerPXH
- adc #0
- jsr GetLevelColumnPtr
- cmp #Metatiles::BRICKS
- beq BreakBricks
- cmp #Metatiles::PRIZE
- beq OpenPrize
- rts
- OpenPrize: ; insert effects here
- lda #Metatiles::USED_PRIZE
- jsr ChangeBlock
- lda #SFX::COIN
- jsr PlaySound
- jsr AddCoin
- rts
- BreakBricks: ; insert effects here
- lda #Metatiles::EMPTY
- jsr ChangeBlock
- lda #SFX::SMASH
- jsr PlaySound
- rts
- FC___L_:
- FC____R:
- FC___LR:
- ldx BlockLL
- lda MetatileFlags,x
- ldx BlockLR
- cmp MetatileFlags,x
- bne NotFallthrough
- and #~M_POST_PROCESS
- cmp #M_SOLID_TOP|M_FALLABLE_LEDGE
- bne NotFallthrough
- lda PlayerDownTimer
- cmp #15
- bcc NotFallthrough
- rts
- NotFallthrough:
- inc PlayerOnGround
- lda #0
- sta PlayerVYH
- sta PlayerVYL
- lda #$80
- sta PlayerPYL
- lda keylast
- and #KEY_A
- bne :+
- lda keydown
- and #KEY_A
- beq :+
- lda #<(-$50)
- sta PlayerVYL
- lda #>(-$50)
- sta PlayerVYH
- inc PlayerJumping
- lda #SFX::JUMP
- jsr PlaySound
- :
- rts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement