Instant Moving

Non-platform specific questions.

Instant Moving

Postby BlarghNRawr » Mon Mar 30, 2009 5:08 am

how can i move an actor somwhere instantly without using MoveTo?

hypothetically:

actor name is:
Actor

Start Location:
0,0

End Location:
1012,1012
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: Instant Moving

Postby Azou » Mon Mar 30, 2009 7:16 am

Maybe by using a path with frames equal to 1 .
User avatar
Azou
 
Posts: 514
Joined: Thu Sep 13, 2007 1:12 pm
Score: 35 Give a positive score

Re: Instant Moving

Postby jimmynewguy » Mon Mar 30, 2009 6:55 pm

ummm.... if the start location is 0,0 as you said
x += 1012;
y += 1012;
:lol:
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: Instant Moving

Postby BlarghNRawr » Mon Mar 30, 2009 11:53 pm

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
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: Instant Moving

Postby skydereign » Tue Mar 31, 2009 12:56 am

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;
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Instant Moving

Postby jimmynewguy » Tue Mar 31, 2009 1:10 am

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
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: Instant Moving

Postby BlarghNRawr » Tue Mar 31, 2009 2:06 am

oh... XD
that will probably help abit with alot of things if i knew how to do that :J
^^ thnx to both
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: Instant Moving

Postby zygoth » Thu Apr 02, 2009 2:09 am

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
Nova: 100% Vertigo/Mazeman: 100%
Visit my website to download them both! http://www.ketonegames.com
User avatar
zygoth
 
Posts: 140
Joined: Mon Jun 11, 2007 6:37 pm
Score: 5 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron