How do I Make a random image pop up?

Get help using Construct 2

Post » Wed May 21, 2014 11:40 pm

I'm making a touch screen game where you're making a sandwich by catching falling ingredients.

In the game you are given an image that prompts you to make the shown sandwich which is shown for a few seconds and then vanishes and the sandwich ingredients begin to fall from the top of the screen.

I know I might need to make several possible sandwich pictures and it should be on it's own layer, what I need to know is how can I have the image pop up randomly and does it need to be a tiled background or a sprite?

Thanks!
B
10
S
1
Posts: 69
Reputation: 641

Post » Thu May 22, 2014 9:36 am

For all that is random, using random ()

random(0,5)
Give a number beetwen 0 & 5.


Use round() or int() for get an integer number.
You do not have the required permissions to view the files attached to this post.
B
13
S
3
G
2
Posts: 49
Reputation: 1,675

Post » Tue May 27, 2014 3:19 pm

Thanks! I'll let you know if it works, now another question how do I manage with an incorrect ingredient? For example, the prompted sandwich is a Peanut butter and grape jelly how do I make the game end if they get Strawberry Jelly or bacon?
B
10
S
1
Posts: 69
Reputation: 641

Post » Thu May 29, 2014 10:46 pm

Okay the image is appearing now is there a way where I can make it vanish after say 4 seconds but can be seen again at the cost of 5 seconds?
B
10
S
1
Posts: 69
Reputation: 641

Post » Thu May 29, 2014 11:08 pm

Look at the Timer behaviour.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Fri May 30, 2014 5:03 pm

Okay will do.

Edit:

Actually, how an I loop this?
B
10
S
1
Posts: 69
Reputation: 641


Return to How do I....?

Who is online

Users browsing this forum: Euduardo, Kin and 30 guests