- Home /
Does anybody have any good ideas on how to implement this?
Im having trouble trying to create a way to implement this idea I have.
As of now I have the following.
All the 5 colors are the bottom are buttons, and basically the game works like this. Random cubes are being generated with random speeds heading towards the princess. The game works by clicking the exact color of the cube to pop it, and prevent the princess from being hit, but only if the cube and the button match in color exactly. If they don't nothing happens.
I just need advice on how to implement this. I have everything else working.
Also score would be nice as well.
Any advice?
What have you tried, and with which part do you have problems specifically? Question is too broard at the moment.
Answer by Uzair1 · Apr 19, 2018 at 10:02 AM
@eid1550 Following might not be the most effective or fastest way but its how i would implement this, you can make an array which holds the hex values of all the available colors, when spawning the block that hits the princess you can randomly get an index and appoint the value to the spawned block, once the block is tapped you can check to see if the hex value of the generated block matches the hex of the tapped block, if they match, destroy or disable the block, add a point to an int named score and just display the score in the corner up above.