PDA

View Full Version : [AS3] randomly selected images for t or f game


LLo
03-02-2009, 06:53 PM
Hello,
I am building a game that will have an animal image and an animal habitat image. The user has to click either true or false if the animal is with the right habitat or not. Does anyone know the code to have the images randomly selected and still have the true or false part correct to the images chosen? Thanks in advance!

bluemagica
03-03-2009, 02:50 AM
you are making the game, so why are you asking us for code? If you want help with code, then show us what you yourself have tried first!

Anyway, the logic of the game can be quite simple from a designer point of view....
1) create 2 mc, "animal" and "habitat".

2) put 1 animal in every frame of "animal" mc, and same for "habitat", but make sure the habitat in each frame, matches its animal in the same frame, so the animal in 1st frame should have its habitat in 1st frame of habitat.

3) when you pick randomly, just check both mc are at same frame number or not, if they are same, its true, else false!