Math Jenga Script
Math Jenga Script
Middle School, with their fragility corresponding to mastery of said skills. The
Jenga model is to visualize this in a game engine.
The core of the architecture for this short demo is the Math Block Manager, which
sits in an empty scene object.
Update uses the screen cursor to highlight blocks, swapping out their material on
the fly and updating the UI based on the info deserialized to their component
scripts.
[Highlight to show off]
The deserialized data itself is stored in MathBlockData.
[Show MathBlockData script]
As a personal touch, I decided to have the block instances spawn with minute
alterations in their scale - this is to simulate actual jenga blocks, which have
tiny, random variations from the standard dimensions which lead to the stacks more
easily toppling. Their deserialized data is assigned to a component at this point
as well.
[Show MathBlockComponent]
[Show OrbitOnClick]
Controlling the Camera by comparison has a very simple pair of controllers - one to
rotate around a stack on clicks with right click
[Show SwapCameraFocus]
And another to Swap the Camera Focus, which is the empty game object the camera
orbits around. You can switch down the line with the Q and E keys.
[Show UI instructions]
And all this is in the game UI on the upper left, so the user knows right off what
to do
[Click on Main Camera in scene hierarchy]
Another personal touch I did here was also attach the 3D text for stack grades to
the same Orbiting script.
[Demonstrate camera controls]
This makes the grade texts follow the camera rotation no matter where they are.
And that's it! More game types, such as Strengthen My Stack, Earthquake, Build My
Stack, and Challenge can be added on with additional buttons and building off the
existing prefabs.