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

Best Answers

  • TesseractEngineTesseractEngine Posts: 180
    Accepted Answer
    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.
  • TesseractEngineTesseractEngine Posts: 180
    Accepted Answer
    Here's how the Interpolate behaviours would look. The bottom one is to .Height instead of Width.
  • TesseractEngineTesseractEngine Posts: 180
    Accepted Answer
    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.
  • gyroscopegyroscope I am here.Posts: 6,598
    edited January 2013 Accepted Answer
    cool :) 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 :)
    Or simply put in the actual x and y final coordinates you want into the Interpolate behaviour, without any equations...

    Edit: oh, @TesseractEngine wrote that as well... OK, I can duplicate info as good as the next man! :P

Answers

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited January 2013

    @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.
  • sparkaniasparkania Member, PRO Posts: 300
    the destination to the Center of the screen is
    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
  • adw2008adw2008 Member Posts: 10
    Thanks,

    Ill give it a go now n see if it works :)
  • adw2008adw2008 Member Posts: 10

    @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.
    Thanks :) how do i go about doing that with interpolate, ive not come across that yet lol

  • adw2008adw2008 Member Posts: 10
    the destination to the Center of the screen is
    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
    Ok so i have done as you have said but it doesnt stop, it just keeps going :/ I used accelerate towards and entered the details you gave :/
  • TesseractEngineTesseractEngine Member Posts: 180
    Accelerate does just that - accelerates the actor. Try Move To, or use Interpolate on self-Position.X and Y as previously mentioned.
  • sparkaniasparkania Member, PRO Posts: 300
    well because with accelerate, you just gave it a heading, not a location. so I will Head right at the center, but not stop.
  • adw2008adw2008 Member Posts: 10
    Here's how the Interpolate behaviours would look. The bottom one is to .Height instead of Width.
    TesseractEngine, you are a LEGEND!!! lol done the job perfectly, would you know how to stop size as it gets to center of screen? :)
  • TesseractEngineTesseractEngine Member Posts: 180
    Remove any Change Size behaviour, and Interpolate the self.Size.Width and self.Size.Height to what you require it to be when it reaches the centre.
  • adw2008adw2008 Member Posts: 10
    cool :) 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 :)
  • adw2008adw2008 Member Posts: 10
    Once again you are a legen lol. I know where to come know if am stuck :D
Sign In or Register to comment.