IN THIS WEEKS LECTURE:
“you have 45 minutes to make pong, get to it. Also, here’s GitHub and itch.io, they are your world now”
It took me about 10 hours finish making the game, but the end product is quite fun. The paddles are nothing special, and the enemy AI just moves towards the ball’s height, with a limited speed. Nice and simple. However, the ball itself is a tricky character; it rotates by a random amount every time he hits a paddle, and every frame adds force to its local positive x axis, meaning that the ball travels in sometimes very strange patterns.
I spent ages refreshing myself with how to use certain bits of code with the unity API’s, but found that the plan of what had to be done came fairly easily.
There are four scripts, one for the players paddle, one for the AI, one for the ball and one for a game controller. The game controller, ball and AI all run methods from each other, and the ball is a prefab that is destroyed and spawned for each new set, the AI finds the ball every frame by searching for its tag so that the ball can be destroyed when needed. The game controller keeps track of the scores, sets the text boxes to the appropriate messages and handles exiting and resetting the game.
so It’s all working fine, I fixed a bug where the death zones were too small and the ball could escape, and I had a browser version running too. Then my brother suggests multiplayer. So I got that done with very little fuss too!
Itch.io is awesome, has simple to use tools to present my game in a nice professional meets gamer style, and helps me keep track of the popularity of those games.
I’m looking forward to learning more about source control and how to use GitHub more effectively (like committing every 20-30 mins instead of after 10 hours of work. I was on a roll, will avoid from now on).
Here is a link to the game, for free!
I got the font used in game here:
And followed this tutorial to figure out how to display text on screen:
I made the game sounds using this: