[A83] Re: I'm trying collision based on pixel states, using ionGetPixel


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

[A83] Re: I'm trying collision based on pixel states, using ionGetPixel




It looks like you're moving the sprite, setting new coordinates, then 
checking a pixel on the top edge of the sprite.  If there is something at 
the pixel, you continue the key loop, otherwise you undo the movement, erase 
the sprite, move it again, and redraw the sprite...

MISTAKES:
* You are MOVING THE SPRITE regardless if the pixel is there or not.
* You are moving the sprite 8 pixels to the right, not just checking that 
pixel, but moving the sprite too!

SUGGESTIONS:
First check the pixel, then move:
* Read the variables, change the *registers* (not the variables) based on 
which pixel you're checking.
* Check that pixel
* Go back to the loop if there's a pixel there.
* Erase the sprite
* Finally, set new coordinates.



_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx