How do I make a projectile sprite randomized

  • First off I apologize if this has in fact been solved before. I had a scroll through the forums to try and find an answer but could not find one.

    What I am looking to do is have a projectile possibly be 5 different sprites. The idea is every time you fire or throw there is chance of the projectile be 1 of 5 different items.

    If someone could help me with this that'd be great!

    Thanks in advance.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 2 Solutions: Either use the same sprite and put all bullets in different frames of the default animation or Put all 5 sprites in a Family called BULLETS for example

    For family method:

    On [SHOOT BUTTON] pressed | Gun Create BULLETS >>> This randomly creates one bullet from the family.

    For same sprite method:

    On [SHOOT BUTTON] pressed | Gun Create BULLET <<< Sprite

    On BULLET created | Stop Animation.

    |Set frame to int(random(0,4))

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