Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .proc ChkTouchGeneric
- jsr :+
- swapa TouchLeftA, TouchLeftB
- swapa TouchTopA, TouchTopB
- swapa TouchWidthA, TouchWidthB
- swapa TouchHeightA, TouchHeightB
- jsr :+
- clc ; no collision
- rts
- : lda TouchLeftB
- add TouchWidthB
- sta TouchRight
- lda TouchTopB
- add TouchHeightB
- sta TouchBottom
- lda TouchLeftA
- cmp TouchLeftB
- bcc :+
- lda TouchLeftA
- cmp TouchRight
- bcs :+
- lda TouchTopA
- cmp TouchTopB
- bcc :+
- lda TouchTopA
- cmp TouchBottom
- bcs :+
- pla
- pla
- sec ; collision detected
- : rts
- .endproc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement