A86: checking contact
[Prev][Next][Index][Thread]
A86: checking contact
here is my code to determine if a single point is
hitting a paddle the paddle is 8 pixels wide and 3
pixels high
it looks like this
	.db %00000000
	.db %00000000
	.db %00000000
	.db %00000000
	.db %11111111
	.db %11111111
	.db %11111111
	.db %00000000
this routine takes b,c as the srceen coords for the
paddle and d,e as the point to check
it sets (hitstatus) to 1 if hit
it only works some times!! anyone wanna help me out?
CheckHit:
	ld a,d
	cp b
	ret c 
	ld a,b
	add a,7
	cp d
	ret c
	ld a,c
	add a,6
	cp e
	ret c
	ld a,c
	add a,4
	cp e
	ret c
	ld a,1
	ld (hitstatus),a
	ret
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com