[go: up one dir, main page]

0% found this document useful (0 votes)
108 views14 pages

Project Flappy

Uploaded by

Mamata swain
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)
108 views14 pages

Project Flappy

Uploaded by

Mamata swain
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/ 14

MINI PROJECT REPORT

ON
“FLAPPY BIRD”
Submitted for the partial fulfillment of the requirement for the
4TH semester
Bachelor of Technology
in
COMPUTER SCIENCE & ENGINEERING-
ARTIFICIAL INTELLIGENCE
By
Student Name: Debadutta Dash RegNo: 2201287469
Student Name: Dishant ku. Mohapatra RegNo:2201287477
Student Name: Dibya Jyoti Parida RegNo: 2201287474
Student Name: Suvranshu Sekhar Behera RegNo: 2321287028

Supervised By:
Prof. Bimal prasad kar

GITA AUTONOMOUS COLLEGE, BHUBANESWAR

1
APR 2024

GITA AUTONOMOUS COLLEGE, BHUBANESWAR


Department of Computer Science and Engineering-Artificial Intelligence

Mini Project Information Page 4th semester

1. Type of Project: a) Research Based

(Choose any one) b) Development Based yes

2. Proposed Area of the Project:

a) Research Based:

b) Development Based:

3. Group Details (Maximum Five members in a group):

1.

Name of the Members Roll Number Signature of the members

Debadutta Dash 2203049

Dishant ku. Mohapatra 2203057

Dibya jyoti Parida 2203054

Suvranshu sekhara Behera 2203L03

4. Objectives of the proposed project work:

i) The game speed increases as the score rises, making it progressively more challenging.

ii) There are a limited number of lives, and the game ends when all lives are lost.

iii) Include power-ups that grant the bird temporary abilities, like invincibility or increased flight duration.

5. Software used in this project:Python,pygame(library)


6. H/W used in this project:Laptop(RAM:8gb,ROM:512gb,PROCESSOR:intel core i5)
7. H/W and S/W requirement to run the project:-laptop with python sdk
2
Department of Computer Science & Engineering-Artificial
Intelligence
Gandhi Institute for Technological Advancement, Bhubaneswar
Ref no:…………………… Date:-13 MAY 2024

Certificate
This is to certify that the mini project report entitled “Title of the project”

submitted by

i) Mr.Debadutta Dash Reg No:-2201287469

ii) Mr.Dishant ku. Mohapatra Reg No:-2201287477

iii) Mr.Dibya jyoti Parida Reg No:-2201287474

iv) Mr.Suvranshu Sekhar Behera Reg No:-2321287028

is an authentic work carried out by them at GITA under my guidance. The matter embodied
in this project work has not been submitted earlier for the award of any degree or diploma to
the best of my knowledge and belief.

3
Prof. (Dr.) Prasanta Kumar Bal
(H.O.D, Dept. Of CSE-AI)
(Supervisor)

Department of Computer Science & Engineering-Artificial


Intelligence
Gandhi Institute for Technological Advancement, Bhubaneswar

ACKNOWLEDGEMENT

I express and gratitude to Prof. Bimal prasad kar, project supervisor for his
guidance and constant support.
I also take this opportunity to thank Prof. (Dr.) Prasanta Kumar Bal,head of
Department, Computer Science & Engineering, for his constant support and
timely advice.
Lastly, words run to express my gratitude to all the faculties of the CSE Dept.
and friends for their support and co-operation, constructive criticism and
valuable suggestion during preparation of this project report.
Thanking All…

4
ABSTRACT:-
Flappy Bird game in Python using Pygame. Players control a bird, navigating it through
pipes to score points. Pygame is used for visuals, and core mechanics include gravity,
collision detection, and scoring gameplay includes Players controling a bird, avoiding
pipes and the ground to score points. The bird will be represented by a sprite image
with flapping animation to create a sense of flight. Physics will be applied to simulate
gravity, affecting the bird's vertical movement. Pipes will be implemented as two
separate images, one for the top section and one for the bottom, creating a gap for the
bird to fly through. Pairs of pipes will be generated randomly at set intervals and move
horizontally across the screen at a constant speed.A simple background image will be
used to create a visually appealing environment for the game.The ground will be
represented by a solid object at the bottom of the screen. Collisions with the ground will
result in a game over state.Points will be awarded for each pair of pipes successfully
passed. The score will be displayed on the screen.The player will control the bird's flight
using a keyboard key. Pressing the key will add an upward force to the bird,
counteracting gravity for a short duration.The bird's position will be updated based on
its current coordinates, velocity (affected by gravity and player input), and time
elapsed. Pipes will move horizontally across the screen at a constant speed,Collision
detection will be implemented to check for any contact between the bird and the pipes
or the ground,A collision will result in a game over state,the game will run in a
continuous loop, updating the positions of the bird, pipes, and any other game elements.
It will also handle player input, collision detection, scorekeeping, and rendering the
game visuals on the screen.Upon collision, the game will transition to a game over state,
displaying the final score and providing options to restart or exit the game.The game
will utilize Pygame's functionalities to create a visually appealing experience.Sprites:
Image files will be used to represent the bird, pipes, background, and any other visual
elements

5
CONTENTS

Chapter No. Topics_______________Page No._______________

Chapter 1: Aim of this project work

Chapter 2: The Requirement Specification

Chapter3: Coding (As attachment)

Chapter 4: Conclusion and future work

Chapter 5: References.

6
Aim of this project work

This document outlines a Flappy Bird game in Python using Pygame. Players
control a bird, navigating it through pipes to score points. Pygame is used for
visuals, and core mechanics include gravity, collision detection, and scoring
gameplay includes Players controling a bird, avoiding pipes and the ground
to score points. The bird will be represented by a sprite image with flapping
animation to create a sense of flight. Physics will be applied to simulate
gravity, affecting the bird's vertical movement. Pipes will be implemented as
two separate images, one for the top section and one for the bottom, creating
a gap for the bird to fly through. Pairs of pipes will be generated randomly at
set intervals and move horizontally across the screen at a constant speed.A
simple background image will be used to create a visually appealing
environment for the game.The ground will be represented by a solid object
at the bottom of the screen. Collisions with the ground will result in a game
over state.Points will be awarded for each pair of pipes successfully passed.
The score will be displayed on the screen.The player will control the bird's
flight using a keyboard key. Pressing the key will add an upward force to the
bird, counteracting gravity for a short duration.The bird's position will be
updated based on its current coordinates, velocity (affected by gravity and
player input), and time elapsed. Pipes will move horizontally across the
screen at a constant speed,Collision detection will be implemented to check
for any contact between the bird and the pipes or the ground,A collision will
result in a game over state,the game will run in a continuous loop, updating
the positions of the bird, pipes, and any other game elements. It will also
handle player input, collision detection, scorekeeping, and rendering the
game visuals on the screen.Upon collision, the game will transition to a game
over state, displaying the final score and providing options to restart or exit
the game.The game will utilize Pygame's functionalities to create a visually
appealing experience.Sprites: Image files will be used to represent the bird,
pipes, background, and any other visual elements.

7
The Requirement Specification:-

 Technical Requirements

 Utilize Pygame library for game development functionalities:

 Sprite creation and animation for bird and pipes.

 User input handling for keyboard controls.

 Collision detection between objects.

 Game window and screen rendering.

 Additional Requirements

 Implement sound effects for game events (flapping, collisions, scoring).

 Explore difficulty levels with adjustable pipe speed and gap size.

 Consider basic animations for smoother bird movement (advanced).

 Computer Requirement

 Laptop or Desktop with 8 GB ram and Intel i5 or AMD X5

 Python SDK

8
Coding:
import random

import sys

import pygame

from pygame.locals import *

fps = 32

screen_width = 289

screen_height = 511

screen = pygame.display.set_mode((screen_width,screen_height))

ground_y = screen_height*0.8

game_images = {}

game_sounds = {}

def welcomeScreen():

player_x = int(screen_width/8)

player_y = int((screen_height - game_images['player'].get_height())/2)

message_x = int((screen_width - game_images['message'].get_width())/2)

message_y = int(screen_height*0.2)

title_x = int((screen_width - game_images['message'].get_width())/2)

title_y = int(screen_height*0.04)

base_x = 0

while True:

for event in pygame.event.get():

if event.type == QUIT or (event.type == KEYDOWN and event.key == K_ESCAPE):

pygame.quit()

sys.exit()

elif event.type == KEYDOWN and (event.key == K_SPACE or event.key == K_UP):

9
return

else:

screen.blit(game_images['background'],(0,0))

screen.blit(game_images['message'],(message_x,message_y))

screen.blit(game_images['player'],(player_x,player_y))

screen.blit(game_images['base'],(base_x,ground_y))

screen.blit(game_images['title'],(title_x,title_y))

pygame.display.update()

fps_clock.tick(fps)

# Initialize Pygame

pygame.init()

pygame.display.set_caption('Flappy Bird')

fps_clock = pygame.time.Clock()

# Load images and sounds

game_images['background'] = pygame.image.load(r"C:\Users\background.png").convert()

game_images['base'] = pygame.image.load(r"C:\Users\base.jpg").convert()

game_images['player'] = pygame.image.load(r"C:\Users\flappybirb.png").convert_alpha()

game_images['pipe'] = (

pygame.image.load(r"C:\Users \pipe.png").convert_alpha(),

pygame.image.load(r"C:\Userspipe2.png").convert_alpha()

game_images['message'] = pygame.image.load(r"C:\Users\message.png").convert_alpha()

game_images['title'] = pygame.image.load(r"C:\Users \title.png").convert_alpha()

# Get the height of the pipe image

pipe_height = game_images['pipe'][0].get_height()

# Initialize the game variables

player_x = int(screen_width/5)

10
player_y = int(screen_height/2)

base_x = 0

# Create two pipes

upper_pipes = [

{'x':screen_width+100, 'y':random.randrange(0, int(screen_height*0.4 - pipe_height))},

{'x':screen_width+100+ (screen_width/2), 'y':random.randrange(0, int(screen_height*0.4 - pipe_height))}

lower_pipes = [

{'x':screen_width+100, 'y':screen_height - int(screen_height*0.2) - pipe_height},

{'x':screen_width+100+ (screen_width/2), 'y':screen_height - int(screen_height*0.2) - pipe_height}

11
Conclusion and future work

Conclusion
This document has outlined the development of a Flappy Bird game using
Python and Pygame. The project provides a platform to learn core game
development concepts and create a playable and engaging game. By
implementing the functionalities described in the programming
requirements, a functional Flappy Bird game can be achieved.

This project demonstrates the capabilities of Python and Pygame for


building simple yet entertaining games. The chosen approach allows for a
well-structured and maintainable codebase.
Future Work
There are several avenues for extending this project and exploring more
advanced game development concepts:

Enhanced Visuals: Explore more complex animations for the bird and pipes,
potentially incorporating background variations.

Difficulty Levels: Implement selectable difficulty modes with increasing


pipe speed and gap variations to challenge players.

Sound Effects and Music: Integrate sound effects for various game events
(flapping, collisions, scoring) and background music to enhance the user
experience.

High Score System: Implement a high score system that allows players to
track their best performances and compete with others.

Power-Ups and Obstacles: Introduce power-ups that grant temporary


abilities (e.g., speed boost, invincibility) and additional obstacles to dodge for
a more dynamic gameplay experience.

12
Online Scoreboard: For a more social experience, explore integrating an
online scoreboard where players can compete globally.

Porting to Mobile Platforms: Consider porting the game to mobile


platforms (Android, iOS) using frameworks that bridge Python with mobile
development environments.

By incorporating these future work possibilities, the Flappy Bird game can
be transformed into a more feature-rich and engaging experience. The
project can serve as a stepping stone for developers to delve deeper into
game development using Python and explore more complex game mechanics
and functionalities

13
References

1. StackOverflow.com, https://stackoverflow.co/,
Industry -Software Development, established in -2008.
2. Geeks for Geeks, https://www.geeksforgeeks.org, A-143, 9th Floor, Sovereign Corporate Tower,
Sector-136, Noida, Uttar Pradesh – 201305.

14

You might also like