Final Submission for Pong


Sources/References

// Used to limit the player's (paddle's) vertical movement so that it couldn't go through the walls (the reference is a comment in the thread).

krynal. (2014, May). Stop Pong Paddle from moving offscreen: Unity. https://discussions.unity.com/t/stop-pong-paddle-from-moving-offscreen/106450

// Used to generate a vertical dotted line image for the centre line.

Mistral. (2025). Le Chat [Large language model]. https://chat.mistral.ai/chat/8ab98d4d-1ea6-43d3-bc60-6e61c570973a

// Used to figure out how to spawn a new Ball Prefab at the centre of the screen (since tutorials shows with bullets was at player location).

Unity. (2019). Instantiating Prefabs at run time. Unity3D. https://docs.unity3d.com/es/2019.4/Manual/InstantiatingPrefabs.html

// Used to figure out how to use Color so that I could change the colour of the winner message.

Varaquilex. (2015, January 13). Changing color of UI Text in Unity into custom values. StackExchange. https://gamedev.stackexchange.com/questions/92149/changing-color-of-ui-text-in-unity-into-custom-values

// Used to figure out how to pause the game (when the player score reaches 10) (reference is a comment in the thread).

Kutligin. (2023, November). How to Freeze and Unfreeze my game?. Unity. https://discussions.unity.com/t/how-to-freeze-and-unfreeze-my-game/311091

// Used to figure out how to randomize a selection of either -1 or 1 (used for direction of ball spawn) (reference is a comment in the thread).

Bunny83. (2013, December). Getting -1 or 1 randomly without including the 0. Unity. https://discussions.unity.com/t/getting-1-or-1-randomly-without-including-the-0/...

// Used to generate a background image for the title screen.

Mistral. (2025). Le Chat [Large language model]. https://chat.mistral.ai/chat/8471b2b0-0d9a-4f21-8ab7-e4bd3aeb0e02

// Used for the font type for every UI text element except the score board (used font 7).

Lazy Fox. (2023, April 18). Lazy Fonts Library. itch.io. https://lazy-fox.itch.io/lazy-pixel-fontshttps://lazy-fox.itch.io/lazy-pixel-fonts

Features

  • ensure when the ball is lost off the edge of the screen, that it resets to the centre and chooses another random direction to move in
  • that the paddles don't leave the screen (this can be hard with the physics-based approach)
  • add scores (using UI techniques learnt in Practical 4)
  • add game logic, so when the first player to 10 points wins the game stops and a UI message is shown declaring the winner
  • add further game logic, so that when a game ends it should be possible for a new game to be started (again, with more UI)
  • the ball slowly increases in speed the more hits it takes per round (resetting to normal speed each time it goes offscreen)
    • A 5% increase on speed each bounce.

Use of AI in Project

Used twice for generating images used within the game:

  • Used to generate a vertical dotted line image for the centre line.
  • Used to generate a background image for the title screen.

Files

PongAssignment1Build.zip Play in browser
Mar 15, 2025

Leave a comment

Log in with itch.io to leave a comment.