Collisions
BlitzMax Forums/BlitzMax Beginners Area/Collisions
| ||
I confess to being very confused by the new collision model in blitzmax. Since I prefer designing strategy game models to action games, my biggest concern is that I can't find a suitable explanation of how to manage a clickable/hoverable button (other than dealing with the screen coordinates). I'd really like to know how to check for a collision between an image and a 1x1 rect at mousex/y: any help is appreciated. |
| ||
Ripped from current project:For Local i:TTarget = EachIn targetList ResetCollisions i.update i.draw If CollideRect (mx,my,1,1,1,0) And mh temp = i End If NextA TTarget is a base type that any objects can extend, mh is defined as the value of MouseHit() before entering into the loop. As the loop exits, temp will contain the LAST TTarget, (that was drawn) that collided. |
| ||
Neat! Thanks. |