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

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)
31 views5 pages

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
You are on page 1/ 5

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

3.Challenges 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 time.sleep( ) in our code prevented the counter from working correctly.

Solution: Then we changed it and used pygame.time.get_ticks() for time control, this way we
can measure a certain time accurately and update our counter in each loop.
4.Lessons 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.

5.Conclusions
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.

You might also like