- Home /
Question by
rogiedodgie · Jun 05, 2015 at 04:12 PM ·
pausewaitshow
Show Fun Fact and Wait For Press
Ok, so I have what I think is a simple problem, but maybe not.
I have a game that has healthy and unhealthy objects moving down a conveyor belt and getting destroyed when they fall into a bucket.
I want to show a fun fact about the item that is destroyed on the screen and wait for the user to respond to continue. Here is the array that stores the fun facts about unhealthy items.
var unhealthyfacts: String[] =
["Although they are fruit flavored, this cereal is full of sugar and artificial flavor.",
"Fats from junk food trigger the brain to want more food. This effect can last for several days.",
"Ice cream has many nutrients but is full of sugar and fats.",
"Some hotdogs may contain nitrates and nitrates, which have been linked to cancer. ",
"Candy gives you a quick rush of energy from their simple sugars but leaves you feeling tired quickly after. "];
Is there a simple way to make it so that if an object is destroyed, 10% of the time i can show one of these facts in a Rect on the screen and wait for the player to press spacebar to remove it and continue the game?
Comment
Not related to your issue.. but I didn't know hotdogs contain nitrates AND nitrates! ;P