- Home /
not a Unity specific technical question
A question about wack-a-mole games
https://www.youtube.com/watch?v=4R61n2yKn5M
Like the wack-a-mole game in this link. How does it manage to have the mole vanish inside the hole? It obviously doesn't have enough space for the entire mole to hide down there if I want to use another sprite to cover it up. And making the mole and background different layers would not help, since the bottom of the mole is below the background but the top of it is on top of the background.
I'm very appreciated if anyone can help><.
Answer by NoseKills · Dec 20, 2014 at 12:43 AM
Pretty sure they are 3D models that pop up from under the other model that is the "board". The holes are black meshes too so the moles are not visible under them.
If you stop the video at a time when the mole's helmet is poking through the black "film" of a hole, you can see the ~10 sides of the helmet mesh (it's not perfectly round)
You can do the same with 2D as explained in the comments. Here's an image to explain it better
Of course you need to close the gaps to make it look like 1 image.
Wow, I didn't think of that before. Thanks.
But I'm trying to make the same effect with only 2D sprites, I wonder if it is possible?
Thank you for your answer though, too bad that I don't have enough karma to vote it up :(
You can do it in 2D by slicing the board graphic (that has the holes) into many slices horizontally.
Start going upwards from the bottom of the board image and slice the board image horizontally from the middle of every hole. Use the first/bottom slice as you foreground graphic and place the first mole graphic behind this layer in sorting order. SLice the remaining graphic again at the height of the second hole, place this slice behind the first mole and then place another mole behind this slice... and so on.
I can't upload an image because the question is closed :(
not sure why you cannot edit the answer (to include image), reopened.
O$$anonymous$$....not sure what just happened, but thanks for reopening it.:D
Follow this Question
Related Questions
Set a constant 2d background? 2 Answers
GameObject behind the background 0 Answers
How to set background for 2D game. 1 Answer
How to make background for 2D game 3 Answers
GameObject With Background Covers GameObject Without Background 1 Answer