kayooliveira / plinko-game

This game is a version of the game Plinko, here, you start with 100PPs (plinko points) and you can bet your points to earn more based on the multipliers in the bottom of game.
https://www.plinko.kayooliveira.com
61 stars 34 forks source link

Question #2

Closed r-labs closed 9 months ago

r-labs commented 1 year ago

How does the ball know which hole to go in, and how does it ensure that it actually goes into it? I presume the result is set before the ball falls through one of the pins below correct? Was looking through the code but wasn't able to figure it out. If you could point me to where this is being handled, would be much appreciated.

kayooliveira commented 1 year ago

How does the ball know which hole to go in, and how does it ensure that it actually goes into it? I presume the result is set before the ball falls through one of the pins below correct? Was looking through the code but wasn't able to figure it out. If you could point me to where this is being handled, would be much appreciated.

the ball doesn't "know" where it will land, it's pure physics, in the engine you define some settings like gravity, ball size and other settings. You can see these settings in '''src/pages/Games/Plinko/components/Game/config/index.ts'''

kayooliveira commented 1 year ago

much

sorry for the delay in answering