How do I gradually change sprites?

0 favourites
  • 3 posts
From the Asset Store
Animated Counter
$3.60 USD
10% off
Make a displayed number gradually increase or decrease, making an impression of a real-time counting.
  • Let's say I have 4 families of sprites and I want to spawn one sprite every x seconds. For the first 100 seconds from the start I want to spawn only sprites from the first family, then after another 100 seconds I want to spawn 80% of sprites from family A and 20% from family B, then after another 100 seconds I wanto spawn 50% of sprites from family A and 50% from family B and the percentage changes every x seconds.

    How would you do it?

  • I usually do this with random(100) expression. For example, if I want to make 80% chance to spawn SpriteA and 20% chance to spawn SpriteB:

    If random(100)<80 Spawn SpriteA
    Else Spawn SpriteB
    

    You can use a variable instead of the number 80.

    If random(100)<chanceVar Spawn SpriteA
    Else Spawn SpriteB
    

    After 100 seconds change chanceVar to 50.

    And by the way, don't use "Wait 100s" or "Every 100 seconds". Use Timer behavior instead.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • start a timer at the start of the game then whenever you want to spawn an object, compare the timers time and spawn the object based on your comparisons.

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