Re: A86: Enhanced Checking Routine?


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

Re: A86: Enhanced Checking Routine?




>
>load the x coords of the duck into a and compare it to the x coord of
>the gun(x2), then compare it to a and if a<=x2 keep going, then check to
>see that a+8>=x2, if that is good go to y and do the same thing
>

But how would you do this though?  You would still end up repeating the
routine 6 times... could you write the routine, maybe I misunderstood you.
Here is the routine i use in DuckHunt, etc.

ld a,(duckx)
call _setxxop1	;Into Op1
ld a,(gunx)		
call _setxxop2	;Into Op2
call _cpop1op2	;Compare the Ops
jp z,Hit		;If equal, hit [jp c,greater, jp nz,less]
ld a,(gunx)		;Basically adding to gun 3, then subtracting 3... loop 6 times
inc a			;Increase it
call _setxxop2	;Into Op2
call _cpop1op2	;Compare again
jp z,Hit		


As you can see, it is a tiresome process...  And doing it 6 times takes
time and mem, esp. for a program that checks a lot of stuff... so if anyone
can help, please do so...

					-Ahmed


Follow-Ups: References: