Spawn in objects randomly everytime?

Get help using Construct 2

Post » Sun Dec 30, 2012 4:02 am

I want some asteroids, say 3 asteroids, to spawn in at different spots every time you run the game. Okay, I saw that at the start of layout create the object of asteroid at random, okay, but I put the asteroid out of the layout like you would a bullet or explosion and it always gets back into the margins. How do I fix this?
B
6
Posts: 90
Reputation: 690

Post » Sun Dec 30, 2012 10:05 am

Not sure what you mean, maybe try this: On start of Layout -> destroy Asteroid

Can you show your code?
GameForger2012-12-30 10:05:25
B
4
S
1
G
1
Posts: 49
Reputation: 997

Post » Sun Dec 30, 2012 2:01 pm

I think your code always re-position the asteroids when they are out of the layout , am I correct ? Make a variable that will change to 1 when the asteroids enter the layout and that will block the asteroids respawn ...

On start of Layout
If AsteroidsEnterred = 0
-- Spawn asteroids and position them
If Asteroids | Is on screen
-- Set AsteroidsEnterred = 1

Here you go , Cheers !
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Sun Dec 30, 2012 5:55 pm

https://www.dropbox.com/s/frvkbo71c9mribt/Asteroids.capx

Take a gander at that. I'm not sure if I did that right, but let me know. Any feedback is appreciated. Destroying the asteroid seemed to work. The modification isn't included in the .capx but I added it and everything seems to work now. Thank you.WAFFLE OF WAR2012-12-30 17:59:09
B
6
Posts: 90
Reputation: 690


Return to How do I....?

Who is online

Users browsing this forum: DiabloOvermind, emoticon, MrWhizm, Skebab, Yahoo [Bot] and 17 guests