[How to] Randomize sprites....

0 favourites
  • 7 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.
  • How do I go about randomizing sprites appearing at the top of the screen

    and going down. When it reaches down it would disappear. Let's say the sprites (enemy), is coming down from the top. How do I do that. Currently my sprites appear randomly next to the player.

    Here's is my event sheet:

    Because I can't post links please go to puush site ending. /5iKgE.png

    Any suggestions??

  • small example of "enemies" falling from a random position at the top of the screen to the bottom and then being deleted

    enjoy

  • That link doesn't work :(

  • for some reason he added a space behind it try this one new link

  • Thank you for the link. But for some reason the objects aren't spawning

    on the screen. Its only when I implement

    is outside layout

    et angle toward (object.X, object.Y)

    but you can guess that it would be useless seeings it is suppose to be destroyed when it hits the bottom

    Any suggestions

  • Just checking with you Cuddle, you are not using the is outside layout without repositioning them inside the layout again, are you? In this case they would sit in a loop forever outside the layout.

    You could use an array to randomise them - there is a RandomArray plugin linked away from this website somewhere. Also try to maintain a pool of sprites rather than keep instantiating them, it's a more efficient approach and if you deploy to mobiles it will save you extra headaches when you get there.

    P.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you for your suggestion. I guess I was in a loop.

    For a better approach, I will try to implement it!!

    Thanks everyone!

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