How do I spawn a object with random x position

Get help using Construct 2

Post » Fri May 27, 2016 6:18 pm

Hi there

Im looking for a way to spawn a object (Bullet) at the imagine Point with a variable X position. I want to spawn more than one bullet. But i want that they dont spawn at the same time at the same point. It should spawn a little bit one after another. I have try to set a wait function bevore. It seams to work but when i shoot in other direction the Bullets sometimes change the direction.
So i think about to spawn the bullets like that: Spawn Bullet at imagine Point 0 + X (random(1,2)). But i dont know how to write it correctly. Can anyone help me?

Thanks

Edit:
Solved. I have give it up to try to make it into the spawn call. I make a extra line how set position. :roll:
B
9
S
1
Posts: 22
Reputation: 473

Post » Sat May 28, 2016 7:09 am

So, I see you've solved it but I actually had this problem at one point and your solution isn't how I solved it. It could be a "tomato, tahmato" thing but this info may help?

for every X instance > system > create object ___ > at [random (Z, Z), random (Z, Z)

So if the trigger is pressing the space bar then, depending on your layout size and where you want the spawn, the system will create the item randomly between the two X coordinates, and between the two Y coordinates listed -- every time the space bar is pressed.

You can also do a random trigger for the spawn: system > every random (1, 20) seconds > spawn bullet, etc.

Sorry if this doesn't help at all -- not sorry if it does.
B
6
S
1
Posts: 8
Reputation: 353


Return to How do I....?

Who is online

Users browsing this forum: stevenode, tarek2 and 9 guests