0% found this document useful (0 votes)
34 views7 pages

2D Game - Synopsis

Synopsis on 2-D Game using pygame

Uploaded by

Harsh Raj
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)
34 views7 pages

2D Game - Synopsis

Synopsis on 2-D Game using pygame

Uploaded by

Harsh Raj
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/ 7

A

Synopsis
on
2-D Game

Submitted
by

Harsh Raj, Kartikeya, Jayant Dubey

Nikhil Gupta

In partial fulfillment for the award of the degree of


B. TECH DEGREE
in
COMPUTER SCIENCE & ENGINEERING
Semester – III
Under the Supervision of

Dr. Priyanka Saini

Galgotias College of Engineering & Technology


Greater Noida 201306
Affiliated to

Dr. APJ Abdul Kalam Technical University, Lucknow

September, 2024

BCC-351 CSE DEPARTMENT, GCET, GREATER NOIDA


ABSTRACT

This program is a simple game built using Pygame, where the objective is to catch falling shapes with co
lor-matching collectors at the bottom of the screen. The game has three primary components:
1. FallingShape Class: Represents the falling shapes. Each shape has a random color, position, and
speed.
2. Collector Class: Represents the collectors that the player controls. Each collector has a fixed col
or and can move left and right to catch falling shapes.
3. Game Class: Manages the overall game logic, including event handling, spawning shapes, detect
ing collisions between shapes and collectors, updating the game state, and rendering the game scr
een.
The player's score increases when a shape of a matching color is caught by the appropriate collector. If a
shape of a different color is caught or falls off the screen, the player loses a life. The game continues unt
il the player runs out of lives, at which point a game over screen is displayed.

Keywords: Pygame, Falling shapes, Color matching, Collectors, Game logic, Event handling, Collision
detection, Score tracking, Lives management, Game over screen.
Literature survey is a very important part of a research project. It achieves the following:

a. Familiarizes the reader to the problem under study.


b. It describes the work done by others either at local or international level on it or similar subject.
c. It helps the researcher to understand the difficulties faced by others and the corrective steps taken or
modifications made by them. The researcher can anticipate similar or additional problems during the
study and review of literature (or literature survey) helps him in anticipating them.
d. Research methodology of the researcher can be structured and modified after reviewing the literature.
e. The review assists in identifying various variables in the research project and conceptualizes their
relationship.
f. Review of literature (or literature survey) in a synopsis helps the reviewer in assessing the knowledge
of the researcher. The reviewer can assess the work put in by the researcher and also assists in
assessing the feasibility of the study.

The review of literature (or literature survey) in a synopsis need not be exhaustive. The relevant
information should be covered in about 300 words quoting 8-10 authentic, easily retrievable references.
Literature can be reviewed by using various scientific-information-gathering methods. These are journals,
national or international; bulletins of organizations like WHO, CDC, and ICMR; books; computer-
assisted searches like Medline and Medlar; and personal communications with other researchers. Internet
provides a vast avenue for information gathering. Care must be taken to retrieve only relevant
information. In this era of information technology review of literature is literally "just a click away".

BCC-351 CSE DEPARTMENT, GCET, GREATER NOIDA


1. Introduction:

The code is for a simple, yet engaging game called "Color Catcher," developed using the Pygame libr
ary. The primary objective of the game is to catch falling shapes with collectors of matching colors. T
he game involves three main components:

1. FallingShape Class: Defines the properties and behaviors of the shapes that fall from the top of th
e screen. Each shape has a random position, color, and speed.
2. Collector Class: Represents the player-
controlled collectors at the bottom of the screen. These collectors can move left and right and hav
e fixed colors to match the falling shapes.
3. Game Class: Manages the overall game mechanics, including handling player inputs, spawning n
ew shapes, checking for collisions between shapes and collectors, updating the game state, and re
ndering everything on the screen.

As shapes fall from the top, players must maneuver the collectors to catch shapes of the same color, s
coring points for correct matches and losing lives for incorrect ones. The game continues until the pla
yer runs out of lives, at which point a game over screen is displayed with the final score. This project
is a great demonstration of fundamental game development concepts, including object-
oriented programming, event handling, collision detection, and screen rendering.

2. Literature Survey:

A literature survey for your game code involves exploring existing resources, projects, and research r
elated to Pygame, game development, and similar concepts. Here are some areas and resources you
might explore:

1. Pygame Documentation and Tutorials: The official Pygame documentation and community tutori
als provide extensive knowledge on game development using Pygame. They cover everything fro
m basic setup to advanced game mechanics.
2. Object-Oriented Programming in Game Development: Many resources discuss the use of object-
oriented programming (OOP) in creating games. Your use of classes like FallingShape, Collector,
and Game is a great example of OOP in action.
3. Collision Detection Techniques: Research papers and articles that delve into various collision det
ection algorithms and techniques. Your code uses simple bounding box collision detection, but th
ere are many other methods like pixel-perfect collision detection.
4. Game Mechanics and Design: Books and articles on game design principles and mechanics, such
as "The Art of Game Design" by Jesse Schell. Understanding game design helps in making the ga
me more engaging and balanced.
5. Similar Games and Projects: Look for other Pygame projects or open-
source games that have similar mechanics. Analyzing these can give insights into different approa
ches and enhancements you could incorporate.

BCC-351 CSE DEPARTMENT, GCET, GREATER NOIDA


6. Educational Resources: Platforms like Coursera, edX, and Udemy offer courses on game develop
ment and Pygame. These can provide structured learning paths and deeper understanding.

Exploring these areas will give you a comprehensive understanding of the concepts, techniques, and b
est practices related to your game code, and help you improve and expand upon your project.

3. Problem formulation:

The goal is to design and develop a game using the Pygame library where players must catch falling s
hapes with color-
matching collectors. The game involves the following key objectives and challenges:

1. Shape Generation: Randomly generate falling shapes with different colors, positions, and speeds.

2. Collector Movement: Allow player-


controlled collectors to move left and right to catch the falling shapes. Each collector has a fixed c
olor.

3. Collision Detection: Implement collision detection to determine when a shape is caught by a colle
ctor and whether the colors match.

4. Scoring System: Increase the player's score when a shape of the same color is caught and decreas
e lives when a shape of a different color is caught or falls off the screen.

5. Game State Management: Manage the overall game state, including starting, updating, and ending
the game. Display a game over screen when the player runs out of lives.

Constraints and Requirements:

• Pygame Library: Utilize Pygame to handle graphics, input, and game loop.

• Screen Dimensions: The game window should be 800x600 pixels.

• Frame Rate: The game should run at a consistent 60 frames per second (FPS).

• Randomness: Shape attributes like color, position, and speed must be randomly generated to add
variability.

• User Input: Collectors should be controlled using keyboard inputs (left and right arrow keys).

• Feedback: Provide visual feedback for scoring and lives through on-screen text.

BCC-351 CSE DEPARTMENT, GCET, GREATER NOIDA


Approach:

1. Define Classes: Create classes for FallingShape, Collector, and Game to encapsulate relevant pro
perties and methods.

2. Event Handling: Handle keyboard inputs for moving collectors.

3. Update Loop: Update the game state every frame, including spawning new shapes, moving shape
s, and checking collisions.

4. Rendering: Draw all game elements on the screen, including shapes, collectors, score, and lives.

5. End Game: Detect when the game is over and display the final score.

4. Objectives :

The main objective of this game is to entertain players by providing a simple, yet challenging, color-
matching experience. Players must use their skills to control the collectors and catch falling shapes of the
same color, increasing their score while avoiding mismatches that reduce their lives. The goal is to maxim
ize the score and survive for as long as possible before running out of lives.

This game aims to:

1. Engage players with quick reflexes and strategic thinking.

2. Challenge players to improve their scores by mastering the mechanics.

3. Provide an enjoyable and visually appealing gaming experience.

4. Develop coding skills by implementing game mechanics, collision detection, and event handling in P
ygame.

5. Methodology / Planning of Work:

1. Requirement Analysis:

• Define the game's objective and gameplay mechanics.

• Identify the tools and libraries needed (Pygame, Python).

2. Design Phase:

• Game Design: Outline the game flow, including start, play, and game over phases.

BCC-351 CSE DEPARTMENT, GCET, GREATER NOIDA


• Class Design: Define the properties and methods for FallingShape, Collector, and Game.

3. Development Phase:

• Setup: Initialize Pygame and create the game window.

• Class Implementation:

o Implement FallingShape class with methods for movement and drawing.

o Implement Collector class with methods for movement and drawing.

o Implement Game class to manage game state, event handling, and game loop.

• Event Handling: Capture and process player inputs.

• Collision Detection: Implement logic to detect and handle collisions between shapes and
collectors.

• Scoring and Lives: Implement mechanisms to update and display the score and remaining
lives.

4. Testing Phase:

• Perform unit testing on individual components (e.g., shape generation, collector moveme
nt).

• Conduct integration testing to ensure all components work together seamlessly.

• Perform playtesting to refine gameplay mechanics and difficulty.

5. Debugging and Optimization:

• Identify and fix bugs.

• Optimize performance (e.g., efficient collision detection, minimizing lag).

6. Finalization:

• Polish the game with sound effects, animations, and enhanced visuals.

• Create a start menu and game over screen.

7. Documentation:

• Document the code with comments.

• Prepare a user manual or guide on how to play the game.

8. Deployment:

• Package the game for distribution.

BCC-351 CSE DEPARTMENT, GCET, GREATER NOIDA


• Share the game with others for feedback and improvement.

References:

1. Pygame Documentation: The official documentation is a comprehensive resource for understanding


all Pygame functionalities. Pygame Docs

2. "Making Games with Python & Pygame" by Al Sweigart: This book is an excellent introduction to ga
me development using Python and Pygame. Free PDF

3. Pygame Tutorials on Real Python: Real Python offers a series of tutorials on game development with
Pygame, covering basics to advanced topics. Real Python Pygame Tutorials

4. "Invent Your Own Computer Games with Python" by Al Sweigart: Another great resource for learnin
g game development with Python. Invent with Python

5. Pygame Community Wiki: The Pygame wiki is full of user-


contributed tutorials, examples, and resources. Pygame Wiki

6. Stack Overflow: A great place to find answers to specific coding questions and issues you may encou
nter while developing your game. Stack Overflow - Pygame

7. YouTube Tutorials: Channels like "Tech with Tim" and "Clear Code" have excellent video tutorials o
n Pygame development.

8. GitHub Repositories: Exploring open-


source projects on GitHub can give you a practical understanding of how different features are imple
mented. GitHub Pygame Projects

BCC-351 CSE DEPARTMENT, GCET, GREATER NOIDA

You might also like