Fast Fun week 3: 4 button input Unity
Updated: Feb 20
This week, we were assigned to make a fast and simple game prototype in unity which uses 4 buttons to control. I created a modified version of the game shown in class where players can control the cube and dodge spheres falling down from above at random locations. pink rectangles serve as obstacles for both the falling spheres and the player cube, and the cube flashes black when hit by a sphere, while the hit counter text records the amount of hits.
The changing of the cube material while hit is written in the elimination script controlled by a "mathit" int variable which gets added in every update and reset to 0 when the cube is hit, and the material changes to black if mathit is under 10.
Additionally, I also removed the script which eliminates the object when touching.
With the changed elimination script, I detached the script from the rectangle and placed it on the cube. As a result, spheres no longer gets destroyed when they touch the rectangles, and instead causes the cube to flash black when it hits the cube.