Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Moving an object a specefic amount X & Y?  (Read 963 times)

0 Members and 1 Guest are viewing this topic.
Moving an object a specefic amount X & Y?
« on: February 24, 2009, 07:17:43 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 212
Im using Game Maker 7 and today im for the first time in my life trying to use Game Maker.
I wonder if i can somehow make an object instantly move/teleport a specefic amount of X from its current position.
Im sure its possible but i havnt found a way to do it :(
Thnx! =)
Logged
Re: Moving an object a specefic amount X & Y?
« Reply #1 on: February 24, 2009, 08:24:58 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
In gamemaker there is an action-button "Jump to Position", which you could use. If your using the GML then you can just assign the position to x and y.

But my advice is to go through a tutorial on YoYoGames first and/or read the help file of Gamemaker. It will solve all of these kinds of basic questions.
Logged
Re: Moving an object a specefic amount X & Y?
« Reply #2 on: February 24, 2009, 08:54:45 pm »
  • Doesn't afraid of anything
  • *
  • Reputation: +42/-0
  • Offline Offline
  • Gender: Male
  • Posts: 7002
You can either use the jump to position or just change the coordinates.  For example, lets say you wanted to move 5 on the x and 5 on the y.  If you were using jump to position, you would set the new x and y to:

x + 5
y + 5

If you were coding it, you would just simply type into your script:

x += 5
y += 5
Logged



i love big weenies and i cannot lie
Re: Moving an object a specefic amount X & Y?
« Reply #3 on: February 24, 2009, 09:02:23 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 212
Thnx, MG-Zero! That helped me alot.
And well, everything is going fine, this was the only problem i have got so far, this is like playing with toys if i compare with using JASS in Warcraft 3 World Editor  :P
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.013 seconds with 42 queries.