Re: A86: Enhanced Checking Routine?


[Prev][Next][Index][Thread]

Re: A86: Enhanced Checking Routine?




heres a quick runthrough of it:

 Collision routine(C) Trey Jazz 1997
 ld a,<leftmost pixel of sprite one>
 sub 1 ;use this so the carry will work right
 ld b,<x coord of pixel>
 cp b
 jr nc,no_hit
 add a,7      ;load the rightmost pixel
 sub b        ;subtract the location of the second sprite from it
 jr c,no_hit  ;outside of the sprite to the right so go to no_hit
 ld a,<sprite one y coord>
 sub 1
 ld b,<pixel y coord>
 cp b
 jr nc,no_hit
 add a,7
 sub b
 jr c,no_hit
good_hit:


note: use the middle of the X for the second sprite location

well there ya go


Follow-Ups: References: