I've been working on a new project and I've run into a problem that I'm struggling to work around.
I'm using the DPC+ Kernel and have an issue with sprite collision. I understand the constraints of working with virtual sprites in that they are all basically copies of p1.
My problem is to do with checking for collisions between these virtual sprites and player 0. I've drawn a little picture to illustrate :
Playfield is represented by the red box,
Green is "off screen"
Blue circles are "player8" virtual sprite and are used to show lives left
Player 0 enters from the top of the screen and exits the bottom and can move left and right. when player 0 re-enters at the top he inherits the X position where he exited. My problem occurs because player0 can hit player 8, triggering a collision and a loss of a life.
Player0 starts off with his Y variable set to -16 so that he is offscreen and uses an 8.8 variable for movement for both X and Y axis
I tried a simple : if player0y < 17 then goto skip_collision_check
My logic is this check should cover everything below 0 and everything up to y becoming = 17 (0 + the size of the sprite)
This works with the sprite is fully visible on the playfield but not when part of the sprite is offscreen.
i've tried gating the collision check every way I can think of but it looks like the IF statement isn't seeing a negative y co-ordinate as being less than 0.
Any ideas or suggestions would be appreciated.