Page 1 of 1

Instant Moving

PostPosted: Mon Mar 30, 2009 5:08 am
by BlarghNRawr
how can i move an actor somwhere instantly without using MoveTo?

hypothetically:

actor name is:
Actor

Start Location:
0,0

End Location:
1012,1012

Re: Instant Moving

PostPosted: Mon Mar 30, 2009 7:16 am
by Azou
Maybe by using a path with frames equal to 1 .

Re: Instant Moving

PostPosted: Mon Mar 30, 2009 6:55 pm
by jimmynewguy
ummm.... if the start location is 0,0 as you said
x += 1012;
y += 1012;
:lol:

Re: Instant Moving

PostPosted: Mon Mar 30, 2009 11:53 pm
by BlarghNRawr
rly? i thought there was an easier way than cranking the velocity up to 9999999999999999999999999999 :lol:
what if im under an actor and i want to change the xy of a different actor?

is it like: x += 1012 (actor)

or something....
i havent really learned coding too much T_T
im trying to learn new helpful codes

Re: Instant Moving

PostPosted: Tue Mar 31, 2009 12:56 am
by skydereign
If you want moving, just put that into the event.
Code: Select all
x+=20;

This will move you 20 to the right in one frame. You can also set x and y to move to a point instantly.
Code: Select all
x=20;

Re: Instant Moving

PostPosted: Tue Mar 31, 2009 1:10 am
by jimmynewguy
BlarghNRawr wrote:what if im under an actor and i want to change the xy of a different actor

actor.variable += 1;

replace variable with r g b x y ect.

:D

Re: Instant Moving

PostPosted: Tue Mar 31, 2009 2:06 am
by BlarghNRawr
oh... XD
that will probably help abit with alot of things if i knew how to do that :J
^^ thnx to both

Re: Instant Moving

PostPosted: Thu Apr 02, 2009 2:09 am
by zygoth
you can also make your own custom moveto function by placing this in the draw event

x = x + cos(direction(targetx,targety))*speed;
y = y - sin(direction(targetx,targety))*speed;

I'm not sure if you need to convert to radians or not, if you do just multiply by 3.14145265358979323846264338327950288419/180
:lol:
hope this is useful.

Zygo