This week we are finishing our VR Bowling game. In order to make it look fancier we wanted to add some textures, background, add animated hands instead of cubes... But first things first, we still need to solve last week's problem: The score counter issue.
As we explained on the most recent post, we struggled on counting the score, which should equal the amount of pins knocked down. At first, we considered that a pin was knocked down if its position dropped under a certain height. That gave us a lot of problems and it seemed like it was counting every pin several times. To solve it, we created an array where the pins were listed as they fell, and before adding them to the score we made sure that they weren't already in the list. This way we managed to have a functional score counter.
To check the code you can have a look at it on our github repo, to make it easier and quicker to understand we've prepared a flow chart where you can see the main idea behind the code:
Okay, this looks good!
But let's try to get closer to actual bowling adding a 2nd ball...
Again, if you want to see the code behind it, check our github repo, for a quick over view here's the logic flow chart's evolution:


Comments
Post a Comment