0% found this document useful (0 votes)
19 views5 pages

Pong Game Development Project Report

Uploaded by

esraayaksiz
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views5 pages

Pong Game Development Project Report

Uploaded by

esraayaksiz
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Project Report: Pong Game Development

1. Project Definition and Purpose


The purpose of this game is to digitize the table tennis game in a simpler form and present it
to the user. The aim is for the players to catch the ball with their own paddle before it hits the
wall they are standing on and send it to the opposing team's court. In this way, it is possible to
entertain the users with a tennis-like activity without requiring too much effort from the
players.

Project Goals:
- Make a simple pong game similar to table tennis
- A game where players must pass the ball back and forth using their paddles.
- Creating basic graphics and user interface designs for the game.
- To engage the player with the keyboard to engage the user in the game.

2. Design Process

Game Mechanics Design:


Designed things in the game are ball paddle and score system

Ball Movement: The ball changes direction when it hits the edges of the screen and the
paddler.
Scoring System: When the ball hits the edges of the screen, if the ball goes off the screen
without hitting a paddle, the other player gets 1 point.

Timer and Counter: a 3-second timer is set to alert players to prepare before starting each
game.

Player Controls:
Player 1 (Blue): Moves the paddle up and down using the "W" and "S" keys.
Player 2 (Red): Moves the paddle using the arrow keys ("↑" and "↓").

Game Over Conditions:


The game ends when one of the players reaches 30 points. The winner’s name and color are
displayed on the screen.
A "Restart" option is provided at the game over screen, allowing players to start a new match.

Graphics and Interface Design:

Screen: The game takes place on a black background with dimensions of 800x600.
Colors: The background color is black, the ball is white and the paddles colors are white. The
teams are divided into red and blue teams and the score is divided according to the team
colors.

Font: At the beginning of the game, a large white font is used to display the counters.

Technologies Used

Programming Language: Python 3.x


Library: Pygame (for graphics and interaction)
Tools: Visual Studio Code

[Link] Encountered

Change of Target

When we first started making the game that we thought about and planned, we had
difficulty solving our problems due to our lack of knowledge and lack of resources since it
was a new game.

Solution: We decided to leave the project that we had devoted our time to for a while and
make a recreated game.

System Did Not Support Emojis


We wanted to use emojis in the first game we made, but since our system did not have emoji
support, the emojis appeared as empty boxes on the screen.

Solution: We converted all emojis one by one to png files and put them in a folder and added
the folder to the code.

Paddler and Ball Move Off Screen


When we first made the game, we did not specify an area for the ball and pads and because
we did not make any restrictions, they were going off the screen and the continuity of the
game was disrupted.

Solution : We restricted the area by using this code:


if paddle_x < 0: paddle_x = 0
if paddle_x > screen_width - paddle_width:
paddle_x = screen_width - paddle_width

Adjusting the Direction of Ball Movement


Our aim in the double ball section was to make it more difficult, but since we did not
determine the starting positions of the balls, they were moving together in the same direction,
so we could not reach the desired goal.

Solution: We solved this problem by randomizing the directions of movement of the two balls
at the beginning.

The Restarting Option

The logic for restarting the game after a win was problematic at first, especially concerning the
resetting of paddles and ball positions.

Solution: This was resolved by resetting the positions of all objects (paddles, balls, and scores) and
adding a countdown before starting a new round.

Countdown Timer

The countdown timer posed a minor challenge, especially when implementing it to appear at
both the start of the game and after a restart. Initially, the countdown only appeared after a
game reset. After fixing this, the countdown timer now works as expected at the beginning
and after every reset, ensuring a brief delay before the game starts.

Solution: We implemented a function to trigger the countdown timer on both events.

Graphics Not Showing on Screen in Time

When we created and ran our code for the counter, the counter was not visible. We could only
see the word start for a millisecond when the game started, but there was no three-second
countdown. After a lot of trials, we had difficulty getting the game to work without giving any
errors in the code. The counter needs a proper timing mechanism to track how time passes.
The use of [Link]( ) in our code prevented the counter from working correctly.

Solution: Then we changed it and used [Link].get_ticks() for time control, this way we
can measure a certain time accurately and update our counter in each loop.
[Link] Learned

Learning How to Use Pygame


We learned to install a different library in Python with Pygame. We entered a field we did not
know with Pygame, but we went through the code by researching, if we could not learn in
detail, what we learned was permanent.

Progress with Patience and Experience


We really experienced and learned how to be patient at the desk. We experienced how to find
and investigate our mistakes, we thought a lot about what could be the reason when we made
a mistake, and thanks to this, we learned how to think, even if a little

We Gained Awareness
As people who are new to programming, we were excited to see that we could create
something concrete. In fact, although we knew up until now that we could transfer what we
wanted to the computer if we continued to learn and know what we wanted with our
imagination, we felt it much more deeply by making this game.

Project Management and Planning


A specific time period was set for each step. Progress was evaluated at the end of each stage
to adhere to the set timeline, improving the ability to prioritize tasks and manage time
effectively.

We now have a solid understanding of some key game development principles


Some key game development principles are as such:
- Game Loop: Managing the game loop and handling input, updates, and rendering at a
consistent frame rate is vital for a fluid gaming experience.
- State Management: Properly managing different game states (e.g., playing, game over,
restarting) and transitioning between them is essential for structuring the game logic.
- Sprite Management: Understanding how to manage game objects and update their positions
and behaviors (such as paddle and ball movement) was a key part of the project.

- Event Handling: Handling user input and other events like quitting the game and restarting it
was critical in making the game interactive.
- Time Handling: Using time-based functions, like the countdown timer, to control the flow of the
game.

- Collision Detection: Implementing efficient collision detection for objects like paddles and balls
is crucial for smooth gameplay.

Preparation for Future Projects


This project helped us form better habits in time management and modular development. The
experience we gained has provided guidance for larger and more complex projects in the
future.

[Link]
This Pong game project successfully combined basic game mechanics with enhancements to
improve the gameplay experience. Through challenges in collision detection, paddle shrinking,
and countdown implementation, the project provided valuable hands-on experience in game
development. The key takeaways include the importance of game loop management, collision
handling, and ensuring smooth transitions between different game states.

The game now functions as a complete two-player Pong game with dynamic difficulty through
paddle shrinking and a countdown timer.

Common questions

Powered by AI

The development of patience and the ability to pause while troubleshooting and developing was significant for the developers as it encouraged thoughtful consideration of issues. This mindset helped them identify and debug errors more effectively and improved their problem-solving skills. By fostering patience, the developers could take the time necessary to implement thoughtful solutions, which improved the overall quality and success of the Pong game project .

The Pong game project was developed using Python, with the Pygame library utilized for graphics and interaction. These tools were chosen for their simplicity and effectiveness in creating 2D games. Python's ease of use and availability of community resources make it an ideal choice for beginner game developers, while Pygame offers necessary functionalities for handling graphics, sound, and input, aligning well with the project's requirements for developing basic game mechanics and an interactive user interface .

Enhancing the structuring of game logic in managing game states involves clear state management and seamless transitions between states. Best practices include defining explicit states for each phase of the game (playing, game over, restarting), utilizing a centralized system to handle these states, and ensuring event-handling is aligned with state changes. Additionally, implementing robust conditions for switching states can ensure that transitions occur smoothly without errors, thereby maintaining a seamless gaming experience. Employing design patterns like state machines can also help manage complexity .

The primary goals of the Pong game development project were to create a simple pong game that digitizes table tennis in a more straightforward form and engages users by having them catch and send the ball back and forth using paddles. The game aimed to involve the players actively without requiring excessive effort, by engaging them with keyboard controls. This relates to enhancing user engagement as it creates an interactive experience that is easy to learn yet requires skill to master, thereby maintaining user interest and entertainment .

The project encountered a challenge with emoji display, as the system did not support emojis and displayed them as empty boxes on the screen. To resolve this, the team converted all emojis to png files and included them in the game's code, which allowed for the proper display of graphics without relying on direct emoji support .

To ensure accurate timing and display of the countdown timer, the development team replaced the use of time.sleep() with pygame.time.get_ticks(). This method allowed for proper timing control by making use of Pygame's built-in functions to track elapsed time without freezing the game loop. This change facilitated the consistent update of the timer on each loop iteration, thereby accurately managing the countdown display on-screen at both game start and after resets .

Through the development of the Pong game, developers improved their understanding of collision detection, which is essential for ensuring the ball and paddles interact correctly during gameplay. Efficient collision detection contributes to game fluidity by preventing the paddles and ball from moving off-screen and ensuring accurate score updating when points are scored. This understanding was pivotal in creating a smooth and responsive gaming experience, allowing for dynamic interactions between game elements while preventing gameplay interruptions .

Implementing a countdown timer at the start of the game and after a reset is crucial for user experience as it provides players with necessary preparation time. This brief pause ensures players can adjust before the action begins, enhancing the playability and fairness of the game. The countdown timer also adds a layer of excitement and anticipation, thereby improving overall engagement with the game .

To enhance difficulty by synchronizing multiple balls, the developers randomized the starting positions and directions of each ball. Initially, the balls moved together, failing to increase the game's complexity. By randomizing their initial trajectories, the developers achieved independent movement paths, thereby adding a layer of strategic challenge as players had to manage multiple moving targets simultaneously .

To prevent paddlers and balls from moving off-screen, the development team implemented area restrictions using code snippets that set boundaries for the movement of these game elements. For example, they applied checks and position limits to ensure paddlers did not exceed screen dimensions. These solutions ensured the continuity of the game by keeping all elements within the visible game area, preventing disruptions, and maintaining a stable and predictable game environment .

You might also like