How do I make plants sprites look like they're moving AND growing?

  • Hello community, this is my first post ever and I hope we'll be able to solve this together or maybe you guys can teach me a way around this little issue.

    I'll explain what I'm trying to do first:

    I'm making a game in which the main character is able to grow plants of all kinds as he walks. I've made this plants so they have 5 stages of growth. Kinda like this:

    What I've done (maybe not the correct way) to simulate the growth oh plants is to make an animation by using 5 frames, one with each stage of growth and making it so it has looong frame speeds (so each frame lasts longer).

    My problem appears when I had the idea of making the plants look more "alive" by animating them so they look like they're constantly moving a bit (like they're being affected by wind).

    I've allready done animations for the movement of each stages. I show one of the here (I'm not really sure how to embed it):

    https://gph.is/2SIr8Ha

    what I dont know how to acomplish is:

    How do I get the plants to have the "windy" animation as well as the "growing behaviour"?

    I've thought of a solution wich I dont know how to implement:

    To make 5 "windy animations" for each plant, one for every stage of growth, and using the every x seconds event, switch to the next animated stage of growth of each plant.

    By the way, I'm sorry if english is bad somewhere, not my native language!

    Thanks in advanced!!

  • What you described is pretty much the solution. Each stage/size of the plant should be a different animation. Each animation is a looping plants blowing in the wind animation. As the plant grows, based on a variable or time, you set the next animation. You can also start the next animation 'from the current frame' so it doesn't pop back to the start of one animation and look weird.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks for the answer! Awesome then!

    But as I said, I dont exactly know how to set the next animation :/

    I've been trying different aproaches but none of them seem to work, one of them beeing: Having a variable get its value increased by 1 each time the plant needs to grow, and use that value to set the next animation but how do I do that? :(

    I havent clarified that i dont have a lot of knowledge on the "coding" side of construct, so I dont know what expression to use or if I really NEED to use some expression to do stuff.

    Could you please help me on how to set the next animation?

    Thanks again!

  • Yeah sure, I made an example capx for you here.

    dropbox.com/s/pwdor687mfn6oyo/grow.capx

  • Wow thanks!

    I'll check it out right now.

    Thanks a lot!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)