How to make a sprite duplicate itself?

0 favourites
  • 2 posts
From the Asset Store
A set of 10 pixel art animated magic effects with icons. 2 Fire, 2 Earth, 2 Wind, 2 Water, Portal, Explosion.
  • I want to make a sprite that gradually grows and split in 2 after 10 seconds...

    Basically I was planing to do that by changing the scale of the sprite every tick, destroying it after 10 seconds, while at the same time, 2 new sprites spawn and loop the behavior from there. Anyone knows how I could do that?

    The purpose is to make it behave in a similar way than living cells do.

    UPDATE:

    so far this is what I have to make the behavior

    //this makes it grow

    Every tick:

    Plant: set height to Plant.Height+0.1

    Plant: set width to Plant.Width+0.1

    From here I'm thinking maybe I make it record the size of the height or width and once it gets to a precise number, I make it split in two or something?

    Yeah it took a while but I think I figured most of it out.

    If you are curious to see how it turned out: https://www.scirra.com/arcade/other-gam ... on=updated

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Remember that computer number precision can catch the unwary, for instance, if you compare against a float, eg x = 2, it may not work, as the number may actually be 1.9999 recurring.

    Much better would be to compare if a number is greater or lesser than a value, and try to control your values using the built-in expressions, such as Int, Ceiling, Floor, Round etc.

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