executing in sequence

andy_the_bakerandy_the_baker Member Posts: 25
edited November -1 in Working with GS (Mac)
i can't seem to synch my animations with the timer. say there's a 30 frame animation, at 30fps, and a timer that spawns something every 1 second.

barring this, and better actually, i would like to animate a certain number of frames, spawn the attack collision actor, and then spawn the remaining frames. but i don't seem to be able to execute things in a sequence?

(i guess i could create an integer variable, if it's 1 then run the first thing and increase to 2, run 2 and increase to 3... but is there a better way?

Comments

  • andy_the_bakerandy_the_baker Member Posts: 25
  • chosenonestudioschosenonestudios Member Posts: 1,714
    I'm not exactly sure what your trying to do, but there is an animation behavior, so you don't need to spawn frames? Yeah, I don't really understand, if you could clarify that would be great.
  • quantumsheepquantumsheep Member Posts: 8,188
    Could you try putting a random time in?

    So, after random (1, 4) seconds
    Play animation
    Spawn enemy projectile

    Then use
    OTHERWISE:
    Play 'normal' animation.

    Not sure it'll work - give it a try :D

    QS

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

  • andy_the_bakerandy_the_baker Member Posts: 25
    sorry, i'm not very clear about my intentions.

    i have a series of sprites, showing an attack animation of a character. there are 30 frames, animating at 30 fps (for example). after 30 frames (actually around frame 25 but that's another issue) or 1 second i would like to cause damage to the enemy.

    so i have:

    - when detect collision of enemy
    [animate] - 30 frames at 30 fps
    [timer] - every 1 second spawn attack collision (damage enemy)

    and the animation and the timer are wildly out of synch. (wildly i tellz ya).

    so i'm seeking another way of doing this. any other thoughts? thanks.
  • chosenonestudioschosenonestudios Member Posts: 1,714
    Alright got what your saying. (At least I think I do)

    What I would do is use the self.image command and activate "spawn attack collision" when you get to the image you need.

    Hope this helps! Good Luck!
  • andy_the_bakerandy_the_baker Member Posts: 25
    thanks!!! time to research the self.image command.
  • chosenonestudioschosenonestudios Member Posts: 1,714
    Under rules attributes: self.image
  • andy_the_bakerandy_the_baker Member Posts: 25
    totally got it working. didn't even think of the problem this way. and! i avoided the use of another timer.

    THANKS!!!
  • chosenonestudioschosenonestudios Member Posts: 1,714
    Hey, no prob! Glad I could help!
Sign In or Register to comment.