Basically, I'm using d3d walls as in Mark's tutorial to draw my enemies.
Here's my current code
cs=cos(degtorad(object0.direction)) ss=sin(degtorad(object0.direction)) draw_sprite(sprite_index,image_index,x,y,) d3d_draw_wall(x-(sprite_width/2)*ss, y-(sprite_height/2)*cs, 28, x+(sprite_width/2)*ss, y+(sprite_height/2)*cs, 0, noo,1,1);
Now, naturally this has some problems. I am trying to set up collisions and I managed to fix up a script that works really well. The problem is, the wall is not aligned very well with the actual object's sprite. I want the wall to rotate exactly centered on the object's assigned sprite so that collisions are well done. Like so.

I want it to turn out like the the green ticked one, but right now it is like the one ticked red. The purple is the actual sprite assigned to the object used in collisions. The blue wall is obviously the wall that rotates on its axis using Mark's code.
Now all I want to know is what coordinates to use when drawing the wall to get it like the diagram ticked green??
Edited by GdaTerry, 19 December 2009 - 03:20 PM.











