[How to] Randomize sprites....

Get help using Construct 2

Post » Fri Nov 15, 2013 4:06 am

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??
B
4
Posts: 19
Reputation: 288

Post » Fri Nov 15, 2013 8:41 am

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

enjoy
B
9
S
3
G
3
Posts: 70
Reputation: 1,990

Post » Fri Nov 15, 2013 12:56 pm

That link doesn't work :(
B
4
Posts: 19
Reputation: 288

Post » Fri Nov 15, 2013 1:05 pm

for some reason he added a space behind it try this one new link
B
9
S
3
G
3
Posts: 70
Reputation: 1,990

Post » Fri Nov 15, 2013 1:44 pm

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
>Set 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
B
4
Posts: 19
Reputation: 288

Post » Fri Nov 15, 2013 2:46 pm

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.
IPete22013-11-15 14:49:09
B
4
Posts: 2
Reputation: 504

Post » Fri Nov 15, 2013 3:08 pm

Thank you for your suggestion. I guess I was in a loop.
For a better approach, I will try to implement it!!

Thanks everyone!
B
4
Posts: 19
Reputation: 288


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests