Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

spawn cloned sprites, each playing a different animation?

Hey all,

How could I populate my game's screen with several instances of a Sprite object?
Either scattered randomly or in incremental positions like 200,30 200,60 200,90 200,120..

Another problem: Say the Sprite has 3 variations of an "idle" animation. I'd like each of these spawned sprites to randomly play one of the idle anims, not all the same one.

Any help is greatly appreciated.

:sad: :wink: :crazy: :wink: :wink:
 

onzephyr

Awesome Bro

Try this .capx and see if it helps. It has contains two examples. First one creates sprites at a random location on screen and set animation to a choice at random of three. And an organized column and row version that also sets the animation to a choice at random of three. Tweaking the X and Y of the system create action can get you pretty much any organized or disorganized pattern you wish.


Example .CAPX download
create_organized_random_example.png
 
Thank you so much onzephyr, it is suddenly so clear how to use the loopindex..

I will use this in my Skeletor in Space game (you can find it on the "in Development" Forum).

:dead: :biggrin: :biggrin: :smile: :grin:
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top