Advertisement
NovaYoshi

collision

Jul 7th, 2015
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .proc ChkTouchGeneric
  2. ; (abs(a.x - b.x) * 2 < (a.width + b.width))
  3.   lda TouchWidthA
  4.   add TouchWidthB
  5.   sta TouchTemp
  6.  
  7.   lda TouchLeftA
  8.   sub TouchLeftB
  9.   bpl :+
  10.   eor #255
  11.   add #1
  12. : asl
  13.   cmp TouchTemp
  14.   bcs No
  15.  
  16. ; (abs(a.y - b.y) * 2 < (a.height + b.height))
  17.   lda TouchHeightA
  18.   add TouchHeightB
  19.   sta TouchTemp
  20.  
  21.   lda TouchTopA
  22.   sub TouchTopB
  23.   bpl :+
  24.   eor #255
  25.   add #1
  26. : asl
  27.   cmp TouchTemp
  28.   bcs No
  29.   sec
  30.   rts
  31. No:
  32.   clc
  33.   rts
  34. .endproc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement