简体   繁体   中英

Matching random number pair game in unity 3d?

It's like any matching image game just instead of images we have random numbers. Need to create matching pair of random number game in an 2*2 matrix such that on clicking the matched pairs it should show you had won the game and it should contain timer within that you have to match the numbers. It's need to be created via c# scripting in unity 3d?

I'm not going to write the codes for you, instead i'll point you in the direction to go in.

Create a master script that handles the game, things it needs

  • int Timer
  • bool isGameOver
  • Random generation between 1 - 4 for where to spawn objects, cannot repeat
  • 1 Gameobject to spawn for clicking
  • SendMessage on player click to objects
  • Player mouse input commands

Create a gameobject script that handles being clicked.

  • bool isClicked
  • bool isCorrect
  • function that is called when clicked.

That's... about all you need, Good luck.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM