What logic this game?

Example : http://www.kidsfront.com/match-shadows/3.html

i have image shadows 50 pic and image color 20 color

in 1 scene random shadow 8 pic and image color 1 pic

i will drag image color check with shadow image

what use logic

if i use math.random(50) and math.random(20) it have event not match too.

thanks [import]uid: 163834 topic_id: 29873 reply_id: 329873[/import]

HI there,

If I understand your question, you’re asking how you can guarantee that each scene has an answer, i.e., that the color image matches one of the shadows you display.

To do that, your code would have to store, for each color image, which shadow it matches against. When you create the scene, first randomly pick a color image. Then, pick the shadow image that it matches against, plus 7 other random ones.

Hope that helps.

  • Andrew [import]uid: 109711 topic_id: 29873 reply_id: 119836[/import]

HI there,

If I understand your question, you’re asking how you can guarantee that each scene has an answer, i.e., that the color image matches one of the shadows you display.

To do that, your code would have to store, for each color image, which shadow it matches against. When you create the scene, first randomly pick a color image. Then, pick the shadow image that it matches against, plus 7 other random ones.

Hope that helps.

  • Andrew [import]uid: 109711 topic_id: 29873 reply_id: 119836[/import]