You haven't seen me in the forums, probably ever for most of you, I've been gone for a long, long time. But I'm messing with GM off and on again, and I'm having trouble wrapping my head around some math right now. It has nothing to do with my intoxication, I assure you.
I'm attempting to create the same effect that you see in games like Doom or Hexen, where an object uses different sprites for different angles the camera is viewing it. Here's my stuff :
var camdir,newdir;
camdir=point_direction(Camera.x,Camera.y,x,y)
newdir=facing-camdir //camdir-facing=no
if newdir<0{newdir+=360}
if newdir>=360 {newdir-=360}
//
newdir=floor(newdir/4)*90
if newdir=0{sprite_index=argument0 image_xscale=1}
if newdir=90{sprite_index=argument1}
if newdir=180{sprite_index=argument2 image_xscale=-1}
if newdir=270{sprite_index=argument3}
This is of course, not producing the desired effect. The last half of the code isn't really a concern, but I'm having a bit of trouble figuring how I'd get the correct angle to use. Can anyone point me the right direction? There were a pile of doom-sprite-like examples years ago, and I was able to do it once upon a time, but I've lost it all since











