top of page
Top page

Classic Pong

Project name: Pong
Made in Summer vacation
Juli/2021

GitHub:

github.png
Screenshot (16).png

Team size: 1

Tools used: Unity, visual studio (2019)  C#, GitHub.

Description: I wanted to try something simple but classic, I was inspired of making the classic pong game because it was a great example of a simple but fun game, personally I thought it was a good start for practicing programming on my own. This was my first attempt at a working AI, this game turned out to be successful.

My contribution

This project I made all on my own during my vacation to keep learning outside of my education hours. The project mostly only contains code for the player the ball and the AI computer. The art style for this game only contains the basic unity squares to use as a ball and the two paddles for the players.

Schermopname (505)_edited_edited.jpg

Code snippets

Screenshot (3)_edited.jpg

Computer Paddle (AI)

This script is used to bring the opponent paddle to life. It contains a few if statements where in the AI reads the position of the ball so the AI can calculate where to go to.

At first, the program checks where the ball is going and then it sends the computer to the position it will possibly end, eventually the AI can't keep up and then the player scores.

Moving Ball Script

This script is used to control the ball by giving it a basic movement speed of 200.0f and using a Rigidbody to make the ball interactable. The ball resets it's position each time after a point is made. then it's starts again to a random direction floating either to the opponent or to the player with the basic move speed, the ball also contains a bounce component to increase the speed each time the ball hit either the wall or a paddle.

Screenshot (1)_edited.jpg
bottom of page