How do I randomize time/location of sprite

Get help using Construct 2

Post » Tue Feb 10, 2015 3:48 am

I am currently working on a mobile game where I am trying t to randomize how the objects come down. There are 5 rows and I have about 20ish objects that i want to randomize.

These objects fall from the top to bottom of the screen.
My issue is i have the items randomized to location x(50)y(-1), x(140)y(-1), so on and time 1.2 sec, 1.4 sec, so on, what is happening is i currently have 4 different objects but it would be the same object in each row at each second interval.

I want it where at any given time its a random object in each row.

Please see attachments (sorry it was through paint so not perfectly lined up, but you get the idea)

This may sound confusing im not sure how to properly explain this. :oops:
You do not have the required permissions to view the files attached to this post.
B
8
S
1
Posts: 17
Reputation: 410

Post » Tue Feb 10, 2015 3:56 am

Do you want to create random objects in a 5x5 grid?
Image
B
15
S
6
Posts: 126
Reputation: 1,755

Post » Tue Feb 10, 2015 4:07 am

hmmm, I guess that wouldnt be a bad idea. If i would do that would the object fade in and out or what they still come scrolling from the top ?
B
8
S
1
Posts: 17
Reputation: 410

Post » Tue Feb 10, 2015 4:28 am

I suggest tha you share your capx
Image
B
15
S
6
Posts: 126
Reputation: 1,755

Post » Tue Feb 10, 2015 4:55 am

I have attached it
You do not have the required permissions to view the files attached to this post.
B
8
S
1
Posts: 17
Reputation: 410

Post » Tue Feb 10, 2015 12:06 pm

I saw your project and saw some triangles raining LOL

Do you want the triangles fall randomly in different intervals and fixed 5 columns?
Image
B
15
S
6
Posts: 126
Reputation: 1,755

Post » Tue Feb 10, 2015 1:39 pm

Lol I make it rain lol

Correct different colored triangle at different intervals in the 5 columns. So when all the objects are added and game is complete at any given time there will 20+ different objects
B
8
S
1
Posts: 17
Reputation: 410

Post » Tue Feb 10, 2015 1:51 pm

Do this:
  • Create a Family, and put all your falling objects in this family
  • Create a event with the condition System\Every random(1,3) seconds (you can change the numbers) and the action System\Create object, selecting the Family and Y position a fixed negative value (object will be created outside layout) and X position with choose(10,20,30,40,50) (change these values to match the columns positions).
  • Put Bullet Behavior in Family and adjust its proprieties.
  • Test and have fun! 8-)
Image
B
15
S
6
Posts: 126
Reputation: 1,755

Post » Wed Feb 11, 2015 6:22 pm

PERFECT!!!

You are the man, exactly what I needed.

Another question any way to have a quicker spawn interval, currently i have 0.3 which is perfect bc they dont overlap. Is it possible to spawn them 0.1 but with out already overlapping a current sprite that has been spawned?
B
8
S
1
Posts: 17
Reputation: 410


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests