I am trying to decide how to structure my code for a simple "ball and hole" game. In this game, there is a table with several holes in it. The object of the game is to tilt the table along 2 axes to guide a ball into one of the holes, while avoiding the others.
I am going to create a class for the ball and one for the table. There are several variables that are needed by both the ball and the table.
These variables include:
current rotation around the axes
boundaries for table (we do not want to ball to roll into infinity, and we need this to draw the table too)
location of the holes (used to draw holes on table, and lets ball know when it should stop rolling along the top of the table and start falling into the hole)
What is the best way to structure the code so those variables are available to both the ball and the table?