2014년 12월 1일 월요일

Mole Mash Variation

How do I modify Mole Mash so that there is some sort of hazard that will pop up instead of the Mole? I have it appearing in the game I just dont know how to make it only pop up sometimes instead of the mole....



In the MoveMole procedure you could ask for a random integer (from the math blocks) and store it in a local or global variable. If you ask for a number between 1 and 10, then the hazard would appear roughly one in 10 times, if you do between 1 and 5, it would appear once every 5 times (roughly). You should have an if block, testing if the random number = 1. In that case you show the hazard and make the mole invisible, else (the number is 2, 3, ...) you show the mole and make the hazard invisible. Of course you should also do something if the hazard is touched. Up to you now.


댓글 없음:

댓글 쓰기