I got a bunch of sprites on the screen, and now I want to check wich (if any) match some coordinates set by me.
So, lets say, there are 10 8x8 sprites on the screen, and I want to check if one has Xpos=30 and Ypos=40, plus I want to know which sprite that would be.
Is the code going to look like this?:
(...)
LD A, (XposSprite1)
CP 30
JP Z, Sprite1XisTrue
LD A, (XposSprite2)
CP 30
JP Z, Sprite2XisTrue
LD A, (XposSprite3)
CP 30
JP Z, Sprite3XisTrue
ect.
And then make another for all Y-coordinates.
This doesn't look very efficient, so I wonder if anyone can make a small example of how to do this much better.
Thanks in advance!