-
Whack a mole tutorial
I am looking to build a game similar to whack a mole. I want an object to randomly appear in one of six locations and then give points when a key is pressed if that object is present. The object will disappear after a random period of time.
Could someone give me some direction to start....
-
For the six locations you could use 6 invisible active objects. Use the spread value function to number them within an alterable value they all share. You'd create one active, name the variable, clone it, then place them in the six required places.
Use the timer function and a counter to set a random number every second or so. Remember base number is one more than the max that could be generated (e.g. Random(5) will generate numbers 0-4).
Then at each time interval have your moles appear at the same location as the randomly selected invisible object, then disappear after a certain time. Whenever you click on a mole, you increase your score.
Hope that gets you started. If you have graphics ready to go that shouldn't take very long at all.
I'm not very experienced in MMF2 yet, so someone else may well suggest a more elegant/efficient way to do it.
-
Hi, I'm interested in making one too...
"For the six locations you could use 6 invisible active objects. Use the spread value function to number them within an alterable value they all share. You'd create one active, name the variable, clone it, then place them in the six required places.
Use the timer function and a counter to set a random number every second or so. Remember base number is one more than the max that could be generated (e.g. Random(5) will generate numbers 0-4)."
I don't quite get it..Can you explain more? Where should it set etc?
-
Another way is to have one active, duplicate it 6 times and put it in your locations. Make them invisible.
Then use restrict actions (special - limit - restrict actions) and use a calculation - random (2000)+1000 or whatever (this will restrict the action to 1 second plus a random interval between 0 and 1999ths of a second). Add 'pick object at random' to this event - this will choose a random location active that you can then set your mole's position to.
It's relatively easy to figure out the rest :)
-
Hi, thank you for answering :D
I'm sorry, I know this is a stupid case...I tried to make one sample, but I can't do it right
I am a designer, so programming language is very confusing for me @.@
I've tried the basic tutorial for MMF and done it well, but when I attached them to my game I'll become confused.
Here's the link for my work
http://www.mediafire.com/?y8tu6bg8gellmdy
Thank you
-
1 Attachment(s)
Here's a quick example:
Attachment 7840