How do I move an actor from point A, to point B?
Hi Everyone,
I recently downloaded Gamesalad the other day (awesome piece of kit btw) and am making the intro to my first game. I have the BG, title & image sorted (using accelerate and walls to have them flying in from top n bottom).
However am now on the 'main image' of the scene. I want it flying in from one side to stop in the centre of the screen, how do i go about this? (in detail please lol)
Also, I know how to enlarge the object (as if moving closer) but how do I stop the growth once it reaches a certain size?
Cheers
I recently downloaded Gamesalad the other day (awesome piece of kit btw) and am making the intro to my first game. I have the BG, title & image sorted (using accelerate and walls to have them flying in from top n bottom).
However am now on the 'main image' of the scene. I want it flying in from one side to stop in the centre of the screen, how do i go about this? (in detail please lol)
Also, I know how to enlarge the object (as if moving closer) but how do I stop the growth once it reaches a certain size?
Cheers
Best Answers
-
TesseractEngine Posts: 180
How about interpolating self.Position.X to game.Display Size.Width/2 and self.Position.Y to game.Display Size.Height/2? Use Ease Out for a smooth finish.
Coming in from the side, set the Actor at the correct Y position to start and only interpolate X. -
TesseractEngine Posts: 180
Here's how the Interpolate behaviours would look. The bottom one is to .Height instead of Width. -
TesseractEngine Posts: 180
Add - well, actually, subtract - an offset to the Y interpolate. So, for example, interpolate self.Position.Y to (game.Height/2)-50. Or 100. Or something.
Alternately, figure out where you want the Actor to end up in X and Y coordinates and simply interpolate it's self.X and self.Y to those exact coordinates. Try it out. Stick numbers in instead of game.Display Size.etc. -
gyroscope I am here.Posts: 6,598
cool
Or simply put in the actual x and y final coordinates you want into the Interpolate behaviour, without any equations...
one question, after testing the movement to center of screen, it turns out i need the image more to the bottom of the screen, how would i go about doing that? sorry for bein a pain lol 
Edit: oh, @TesseractEngine wrote that as well... OK, I can duplicate info as good as the next man! :P
Answers
@adw2008
Hi and welcome to GS and the Forums! :-)
If you are moving stuff that has no interaction with other actors, (for a Menu card or intro, for instance) you'll be safe to use the Interpolate Behaviours on x and y positions, for moving into position.
But also for enlarging to a certain size. (If you have been using the Change Size Behaviour, this can only be stopped with a boolean "switch", or if used within a Timer; ...... so best to use two Interpolates, as I say, one for the width and one for the height).
For moving actors, you could also use the Move To Behaviour, although some GSC users have reported problems with this behaviour.
Hope that helps.
scene.camera.origin.X + (half of your screen's width)
scene.camera.origin.Y + (half of your screen's height)
so if your screen is 320Hx480W
then you would want your actor to move TO
scene.camera.origin.X + 240
scene.camera.origin.Y + 160
Ill give it a go now n see if it works