Page 1 of 1

simple pointer demo(how to make an actor point to another...

PostPosted: Wed Jul 04, 2007 5:53 pm
by Sgt. Sparky
actor,
it is VERY, VERY simple. :D
to make the pointer point at another actor just change the code on the draw actor event of your pointer to,
Code: Select all
animpos = direction(x, y, yourotheractor.x, yourotheractor.y) / 10;

:D
the reason I made this Dmo is because so many people ask how to rotate an actor,
so other people have to answer again and again each time.

PostPosted: Wed Jul 04, 2007 11:54 pm
by 98700
this was so helpful im giving u a point :!: :!: :!: :!: :!: :!: :)

PostPosted: Thu Jul 05, 2007 12:22 am
by 98700
ok well it goes the oposite direction of my mouse(btw in ge it shows 104 frames lol)

PostPosted: Thu Jul 05, 2007 12:52 am
by Sgt. Sparky
you have 104 fames?
then you must change your code at the end from / 10 to / 3.461538 or just to / 3.46. :D

PostPosted: Thu Jul 05, 2007 5:47 pm
by 98700
lol thx 1 point 4 u :!:

PostPosted: Thu Jul 05, 2007 11:19 pm
by Sgt. Sparky
you are welcome. :D

PostPosted: Fri Jul 06, 2007 2:16 pm
by 98700
well there is still ine problem tho it still goes the oposite direction...

PostPosted: Sat Jul 07, 2007 7:24 pm
by Sgt. Sparky
what code do you use and how many frames does it have?

PostPosted: Sun Jul 08, 2007 6:36 am
by 98700
103 frames and code=
Code: Select all
animpos = direction(xscreen, yscreen, xmouse, ymouse) / 3.46;

PostPosted: Tue Jul 10, 2007 3:15 am
by Sgt. Sparky
does it start facing right and rotating left?
if not you have a problem. :(

PostPosted: Sat Jul 21, 2007 2:21 pm
by 98700
lol i got it i made it turn the wrong direction :lol:

PostPosted: Sun Jul 22, 2007 10:44 pm
by Sgt. Sparky
Yay!
:D

wait, does it work now?

PostPosted: Tue Aug 07, 2007 1:41 am
by Freddy
I tried downloading the demo, but my dumb computer wont extract almost all of the demos people make! :x :x But I really want to know how to rotate an actor! :(

PostPosted: Tue Aug 07, 2007 5:14 pm
by Sgt. Sparky
Freddy wrote:I tried downloading the demo, but my dumb computer wont extract almost all of the demos people make! :x :x But I really want to know how to rotate an actor! :(

look at the Asteroids Demo on the Demo page. :D