How Would I Do This?(android Whack-a-mole)
I'm making a simple whack-a-mole game as my first mini-project for android. I'm not sure how to go about this. I know the basics of setting everything up and such but I'm not sure
Solution 1:
I've created a simple whack a mole game before. I'll write this in a bullet format for easier viewing:
- First, you have to set a 3 cols and 4 rows table (depends on you).
- Place a picture of a hole in every cell, a total of 12 images.
- You have to place those images in an array.
- The logic is to create a timer and for every tick there's a for loop that reads the array.
- In each array, there's a random boolean generator.
- If it is true, change the picture in that array to a hole with a mole appearing
- If it is false, change the picture to a hole without a mole
- To sum it all up: Every tick, it will loop all the picture(array) and randomize each whether it's true or false. Depending on the value, the picture changes.
Post a Comment for "How Would I Do This?(android Whack-a-mole)"