Move actor along a curve

MrshoestoreMrshoestore Member Posts: 181
edited November -1 in Working with GS (Mac)
So I'm looking to make an enemy actor move along a curve like the video below



My question is.... how?

My theory is that I need to create a sine wave movement, and set it so that only half a cycle is completed before the actor moves off screen (which requires figuring out math I haven't used in years). But is there a better way?

Comments

  • old_kipperold_kipper Member Posts: 1,420
    There is a very simple way to do this without the need for any math. Use interpolates for x and y self position the ease in on one and ease out of the other. Then its just a case of setting the timings and the distances you want and it will pull curves.

    hope that helps

    kipper

    p.s. search figure and 8 in the GS 'new' browser as I did a demo of using this method.
  • giacomopoppigiacomopoppi Member, PRO Posts: 914
    Yep, use the interpolate behaviour and then rotation behaviour to get that effect.
    tere is, as you say, a more complex way to do it using maths (sine, cosine...) but you need to ask the math pros for that ;)
  • MrshoestoreMrshoestore Member Posts: 181
    cheers, that demo helps a lot!
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    i definetly prefer going the math route. All it takes is a little sin and cos, and if u understand what the expressions do itll will help you alot and you can tweak however you want

    have a look at this itll help you alot

    http://gamesalad.com/wiki/how_tos:gsc_wave_movement
  • old_kipperold_kipper Member Posts: 1,420
    JohnPapiomitis said:
    i definetly prefer going the math route. All it takes is a little sin and cos, and if u understand what the expressions do itll will help you alot and you can tweak however you want

    have a look at this itll help you alot

    http://gamesalad.com/wiki/how_tos:gsc_wave_movement

    I prefer to use John's preferred method now... Mine is much more limited.
  • MrshoestoreMrshoestore Member Posts: 181
    Well I have a basic understanding of wave functions, but it's been years since I've used any math outside of basic functions and statistics.

    And that page was the first place I went, but I'm trying to prototype my game quickly, so the lazy way is more preferred!

    But my plan is to just set up a base prototype, and then go back and change things proper so that everything is more precise. So thanks for the suggestion!
Sign In or Register to comment.