Newbie here, How to make an actor move up and down continuously

redonix76redonix76 Member Posts: 24
edited February 2012 in Working with GS (Mac)
Hello, I'm a newbie with GameSalad. I'm making a space side scrolling shooter. I can spawn an enemy actor to move straight from right to left.

Question is how do I make the enemy ship move from right to left while also moving up and down continuously? Or even moving up and down while staying in one place on the X axis. Thanks in advance!

Comments

  • redonix76redonix76 Member Posts: 24
    edited February 2012
    Sweet!!! Thanks for the help tshirtbooth! You are the man! I've learned quite a bit from your videos.
  • redonix76redonix76 Member Posts: 24
    Hey TSB, hows it going? Thanks again for the tips. I have another question. What you taught me so far works great if you want to move up and down relative to the scene. How can I make it relative to the actor? For example, I want to shoot an ammo that's moving from left to right across the screen while moving up and down in a loop. It seems so complicated!

    Thanks!!!
  • CloudsClouds Member Posts: 1,599
    edited March 2012
    Hey TSB, hows it going? Thanks again for the tips. I have another question. What you taught me so far works great if you want to move up and down relative to the scene. How can I make it relative to the actor? For example, I want to shoot an ammo that's moving from left to right across the screen while moving up and down in a loop. It seems so complicated!

    Thanks!!!

    Constrain position Y to AAA*cos(self.time*BBB)+CCC


    AAA= range of movement
    BBB= speed of movement
    CCC=centre point of movement

    Example:

    Constrain position Y to 100*cos(self.time*100)+150

    This would give you an up and down movement from 50 to 250 to 50 to 250 to 50 . . . . . . etc etc




  • redonix76redonix76 Member Posts: 24
    Thanks Frying Bacon, I've gotten that far, but need the bullets to always sway from side to side, or in my case up and down.

    Tynan, thanks for the help man. I'll try it out right now! I'll let you know how it goes!
  • redonix76redonix76 Member Posts: 24
    edited March 2012
    Hi Tynan,

    Ok so what you gave me worked, but it's always using the +150 as the center point correct? So if I spawn my actor at y = 250, as soon as it spawns it jumps to 150 then moves up and down from that center point.

    Maybe I'm not getting this, I'm confused...I'm not a programer after all...just an artist... :(

    I'm basically it doesn't matter from what position I shoot, the bullet will always jump to 150 then starts to animate.

    If there a way to use the actors own real time position to be used as the center point of this animation?
  • CloudsClouds Member Posts: 1,599
    edited March 2012
    I'm not a programer after all...just an artist
    Same here, you can't get away with that excuse on this forum . . . lol ! :)
  • CloudsClouds Member Posts: 1,599
    if I spawn my actor at y = 250, as soon as it spawns it jumps to 150 then moves up and down from that center point.
    Try this . . . . (this should come as no surprise) . . . . instead of using 150 . . . . . wait for it . . . . use 250 !! (or anything you want).

    Ah ! There I've said it, I feel kinda' dirty now, I need a bath. :))
Sign In or Register to comment.