Bounding Box
Pixel based movement is getting to my head. I can get the basic movement working but the collision is confusing me quite a bit, maybe because this is my first time around.
Anyway, I was referred to the "bounding box" method of detection, I was slightly confused. I looked around to see on what it was, I see the pros and cons, one con being that it's difficult to work with shapes that aren't fully square and leave spaces which usually let off the Collision checker to return a collision detected, anyway, that isn't the problem.
I found the main problem for me to actually write it in terms of BYOND. Here is my base movement system:
#define PX_STEP 8
mob
animate_movement = 0
proc
px_step(var/dir).
if(NORTH&dir)
pixel_y+=PX_STEP
if(SOUTH&dir)
pixel_y-=PX_STEP
if(EAST&dir)
pixel_x+=PX_STEP
if(WEST&dir)
pixel_x-=PX_STEP
while(pixel_x>=32)
pixel_x-=32
x++
while(pixel_x<=-32)
pixel_x+=32
x--
while(pixel_y>=32)
pixel_y-=32
y++
while(pixel_x<=-32)
pixel_y+=32
y--
|
So this is where you all come in, I've searched all of BYOND for the bounding box, in the forums, libs/demos, everywhere. I need help creating a simple bounding box collision detection system. I was thinking something modular would be fine,
Calus Corps's
LineWalk demo helped a bit, but not enough for me to potentially write my own. So lead me to my first pixel based collision system :)
A small demo would be nice :)
Thank you all in advance.
Haywire
Posted by Haywire on Thursday, May 28, 2009 11:52AM
- 12 comments
(link)
/
Members say:
yea +1,
nay -1
(Edited on Thursday, May 28, 2009 12:27PM)