Page 1 of 1

turret cod 8 directions

PostPosted: Sat Nov 29, 2008 7:55 pm
by jimmynewguy
Can some one give me a script to make this turret face the player? Thanks :D

Re: turret cod 8 directions

PostPosted: Sat Nov 29, 2008 8:49 pm
by Killagram
Draw Actor>

Code: Select all
angle=direction(x, y, player.x, player.y);
animpos=round(angle/(360/nframes));


8 frames = 360/8 = 45 so

Code: Select all
animpos=round(angle/45);


It won't work with that image though; the order of the frames is wrong.

Animation must start with facing right (0 animpos, 0 degrees) and then rotate counterclockwise.

Here is a fixed version. Have fun!

Re: turret cod 8 directions

PostPosted: Sun Nov 30, 2008 1:51 am
by jimmynewguy
thank you so much 8)

Re: turret cod 8 directions

PostPosted: Thu Jun 04, 2009 11:59 am
by savvy
cool turrets, but add more info, on the coding!