Enemy wave patterns

tekkendptekkendp Member Posts: 49
edited November -1 in Working with GS (Mac)
Hello all.

I'm very new to this - just found about Gamesalad yesterday. I have been working on my own shoot 'em up. I really need help with my enemy wave patterns. I want to have a pattern like in Galaxians. Where they swoop down, and then settle down and move left to right. Does anyone have any tips please.

Thanks in advance - TDP.

Comments

  • BeyondtheTechBeyondtheTech Member Posts: 809
    GameSalad does not yet have "Actor Paths" yet, which would have an enemy travel in a predefined pattern. However, you can make use of math equations such as sin() that will move Actors in curves, as well as building your own patterns by using Attributes:

    in theory

    Create an Actor Attribute called Movement.
    For 2 seconds, set Movement Attribute to 1
    After 2 seconds, for 2 seconds, set Movement Attribute to 2
    etc.

    Create Rules such as if Movement is 1, go down
    if Movement is 2, go right...
    if Movement is 3, go up...
    etc.
  • tekkendptekkendp Member Posts: 49
    Wow!!! Thanks for the speedy response. Loving the sense of community here.

    Will give that a try. Thanks BeyondtheTech. (you haven't watch Gungrave by any chance have you - your name made me think of that anime).
  • tekkendptekkendp Member Posts: 49
    Double post. Sorry.
  • quantumsheepquantumsheep Member Posts: 8,188
    Quantum Sheep, the math genius*, is asking for help.

    Brace yourselves.

    I want a 'wavy' path for an enemy coming in from the right and moving to the left of the screen.

    I had a look at this on the wiki: http://gamesalad.com/wiki/how_tos:gsc_wave_movement

    Under the 'sine movement' section, there's an explanation of how to get an actor moving left to right.

    I tried this, and it works fine. But as I said, I want it to move right to left.

    I tinkered with the equation but to no avail. Anyone have an idea of what I should change to make it go the other way? I'm sure it's something very simple I'm missing!

    Cheers in advance,

    QS :)

    *this may be a lie

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • rebumprebump Member Posts: 1,058
    Look up the graphs associate with tan, cot, parabolas and just plain old diagonal lines (y=mx+b). You may be able to use an equation based on some of them by setting the actor into motion in either a strictly horizontal or a strictly vertical way. Then constrain the other coordinate value (i.e. if starting move is horizontal, constrain Y - if starting move is vertical, constrain X) to one of the equations related to those items I mentioned previously. You may be able to "rotate" any graphs you find by just swapping X for Y and Y for X.

    Been meaning to look into this myself but it is not pertinent to my projects currently.
  • quantumsheepquantumsheep Member Posts: 8,188
    rebump,

    Firstly, thanks for trying to help.

    Secondly, you lost me at 'graphs' :O

    I've tried swapping x for y and subtracting instead of adding etc to no avail.

    I really don't think anyone realises just how shockingly bad I am at math. A 10 year old could do better, and I'm not exaggerating.

    Ime aphraid mi strengphs lye inn writting :)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • firemaplegamesfiremaplegames Member Posts: 3,211
    Hey QS,

    Just put a minus sign in front of the Time Attribute in the equation.
    You know, negative Time!
  • quantumsheepquantumsheep Member Posts: 8,188
    It worked!

    Marry me?

    QS :)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • rebumprebump Member Posts: 1,058
    @QS: Sorry...my response was mainly to the OP, tekkendp. :-(
Sign In or Register to comment.