How do I generate random cercles with the same behavior

Get help using Construct 2

Post » Fri Feb 13, 2015 12:44 pm

Hi, everyone.
i'm recently working on a game (my first one) i want to publish on android, it consists of colored cerles (two colors red and blue) generated randomly, moving top down (bullet behavior), you click on a cercle and some actions occur. but that's not the problem. my problem consists of generating those cercles randomly in the top of the screen, and once the're there they move top down (bullet behavior). how can i do this ?

an image of the concept of the game:
Image
B
3
Posts: 6
Reputation: 187

Post » Fri Feb 13, 2015 1:08 pm

for the X system create object at random(layoutWidth)
for the Y it depends how far from top you want to spawn just play with numbers
Image
B
25
S
9
G
2
Posts: 139
Reputation: 3,024

Post » Sat Feb 14, 2015 2:56 am

thank you Fidasx, it worked
B
3
Posts: 6
Reputation: 187

Post » Sat Feb 14, 2015 4:03 am

Fidasx wrote:for the X system create object at random(layoutWidth)
for the Y it depends how far from top you want to spawn just play with numbers


still have one problem.
this is the code:
Image
and this is the result:
Image

it put the squares on the top of each other,
i want them seperated and random: not red blue red blue red blue...

how can i do it ?
B
3
Posts: 6
Reputation: 187

Post » Sat Feb 14, 2015 5:57 am

You should make it one object with two frames/frame speed Zero. the make a on created event setframe random(2). then use the code you already have but i think you have to increase the -y ALSO DEPENDing on speed you might need to increase time between spawn or speed they travel
edit made it for you
nabster023Help.capx
You do not have the required permissions to view the files attached to this post.
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Sat Feb 14, 2015 11:32 am

try this
You do not have the required permissions to view the files attached to this post.
B
226
S
31
G
14
Posts: 1,899
Reputation: 38,302


Return to How do I....?

Who is online

Users browsing this forum: Boxels, Google [Bot], qroft and 8 guests