Project Report (Sanjana) 1
Project Report (Sanjana) 1
TECHNOLOGY, LATUR
SEMINAR REPORT On
CERTIFICATE
This is to certify that the Seminar entitled “Space Shooter Combat Game In
Python” has been carried out by Sanjana Bandeppa Kante ,
Pratiksha Rajkumar Urgunde ,Sakshi Balaji Munde under my guidance in partial
fulfillment of the degree of Bachelor of Computer Science of SRTMU, Nanded during the
academic year 2023-2024
Munde Sakshi
Uragunde Pratiksha
Royal Education Society’s
TECHNOLOGY, LATUR
Dr.D.H.Mahamuni
HOD
Sr. No. Topic Name Page No.
1. Cover Page 1
2. Certificate 2
3. Acknowledgement 3
4. Abstract 5
5. Introduction 7
Project Module 7
Project Plan(Gantt Chart) 8
6. Project Requirement 9
Harware Requirement
Software Requirement
7. System Designing 10
E.R. Diagram
Data Flow Diagram
8. Designing
9. Coding
10 Conclusion
11. Bibilography
Abstract –
When playing a game, players seek challenge, mastery and reward, all packed in
entailing and motivating activities. From this stems the importance of gameplay as a crucial
game design cornerstone, and game mechanics as tools that the player has to interact with in
order to carry out gameplay activities.
We analyze the relevance of gameplay and game mechanics from a player centered
perspective, and provide insights and guidelines to improve game design in order to sustain
and enhance players’ motivation through gameplay.
Introduction:
The project basically uses the pygame module. We use images and animate the
images using pygame module. We use pygame module to do button mapping and several
other display function. We use classes to call functions after every iteration of the game
level .
Project Module:
1. Pygame Module:
It is used to make games and other multimedia applications, build on highly portable
development.
2. OS Module:
To command operating system (os) using python.
3. Random Module
For generating random numbers for the occurrence of enemies and other stuff
In the game randomly .
Project Plan:
Gantt chart:
Sr.no Task Name 15 Sep 1 Oct 11 Oct 14 Nov 15-Mar
1 Requirement
Gathering
2 Planning
3 Designing
4 Coding
5 Testing and
Deployment
Project Requirements:
Hardware Requirements:
1) Processor: I3and above
2) RAM: 4GB and above
3) Hard Disk: 160 GB or above
4) Input device: keyboard, Mouse
5) Output device : Monitor or LCD/LED
6) LAN Network or Internet Connection
Software Requirement:
Frontend-IDE: PyCharm Community Edition 2021.3.3
Language :python
Backend-Database: Xampp server
E R Diagram
Moves Move
Shoo Drop
Trigger player
Gets Hits
Data Flow Diagram:
start
spaceship
Find
Target FLOW DIAGRAM
Aim Target
yes
End
Code:
import math
import pygame
import random
pygame.init()
screen=pygame.display.set_mode((860,700))
pygame.display.set_caption("SPACE SHOOTER GAME ")
icon=pygame.image.load("space-invaders (8).pngs")
pygame.display.set_icon(icon)
background=pygame.image.load("space background.png")
background=pygame.image.load("bg1.png")
spaceshipimg=pygame.image.load("space-arcade - Copy.png")
ghostimg=pygame.image.load("ghost.jpg")
ghostimgx=random.randint(0,130)
ghostimgy=random.randint(20,350)
ghostimgspeedx=-1
ghostimgspeedy=10
bulletimg=pygame.image.load("BULLET1.png")
def player():
screen.blit(playerimg,(150,550))
check=False
bulletx=460
bullety=641
def collision():
distance=math.sqrt(math.pow(bulletx-
ghostimgx,2)+math.pow(bullety-ghostimgy,2))
if distance<27:
print("collision occured")
while running:
screen.blit(background,(0,0))
for event in pygame.event.get():
if event.type==pygame.QUIT:
running=False
if event.type==pygame.KEYDOWN:
if event.key==pygame.K_LEFT:
changex=-2
if event.key==pygame.K_RIGHT:
changex=2
if event.key==pygame.K_SPACE:
if check is False:
check=True
screen.blit(bulletimg,(150,350))
bulletx=spaceshipx+20
if event.type==pygame.KEYUP:
changex=0
spaceshipx+=changex
if spaceshipx<=0:
spaceshipx=0
elif spaceshipx>=563:
spaceshipx=563
ghostimgx+=ghostimgspeedx
screen.blit(background,(0,0))
for event in pygame.event.get():
if event.type==pygame.QUIT:
running=False
if event.type==pygame.KEYDOWN:
if event.key==pygame.K_LEFT:
changex=-2
if event.key==pygame.K_RIGHT:
changex=2
if event.key==pygame.K_SPACE:
if check is False:
check=True
screen.blit(bulletimg,(150,350))
bulletx=spaceshipx+20
def collision():
distance=math.sqrt(math.pow(bulletx-
ghostimgx,2)+math.pow(bullety-ghostimgy,2))
if distance<27:
print("collision occured")
if ghostimgx<=0:
ghostimgspeedx=1
ghostimgy+=ghostimgspeedx
if ghostimgx>=940:
ghostimgspeedx=-1
ghostimgy+=ghostimgspeedy
if bullety<=0:
bullety=690
check=False
if check:
screen.blit(bulletimg, (bulletx, bullety))
bullety-=2
collision()
screen.blit(spaceshipimg,(spaceshipx,spaceshipy))
screen.blit(ghostimg,(ghostimgx,ghostimgy))
pygame.display.update()
if event.type==pygame.KEYUP:
changex=0
spaceshipx+=changex
if spaceshipx<=0:
spaceshipx=0
elif spaceshipx>=563:
spaceshipx=563
while running:
background=pygame.image.load("space background.png")
background=pygame.image.load("bg1.png")
spaceshipimg=pygame.image.load("space-arcade - Copy.png")
ghostimg=pygame.image.load("ghost.jpg")
ghostimgx=random.randint(0,130)
ghostimgy=random.randint(20,350)
ghostimgspeedx=-1
ghostimgspeedy=10
bulletimg=pygame.image.load("BULLET1.png")
def player():
screen.blit(playerimg,(150,550))
check=False
bulletx=460
bullety=641
spaceshipx=450
spaceshipy=650
changex=0
running=True
if ghostimgx<=0:
ghostimgspeedx=1
ghostimgy+=ghostimgspeedx
if ghostimgx>=940:
ghostimgspeedx=-1
ghostimgy+=ghostimgspeedy
if bullety<=0:
bullety=690
check=False
if check:
screen.blit(bulletimg, (bulletx, bullety))
bullety-=2
collision()
screen.blit(spaceshipimg,(spaceshipx,spaceshipy))
screen.blit(ghostimg,(ghostimgx,ghostimgy))
pygame.display.update()
while running:
screen.blit(background,(0,0))
for event in pygame.event.get():
if event.type==pygame.QUIT:
running=False
if event.type==pygame.KEYDOWN:
if event.key==pygame.K_LEFT:
changex=-2
if event.key==pygame.K_RIGHT:
changex=2
if event.key==pygame.K_SPACE:
if check is False:
check=True
screen.blit(bulletimg,(150,350))
bulletx=spaceshipx+20
background=pygame.image.load("space background.png")
background=pygame.image.load("bg1.png")
spaceshipimg=pygame.image.load("space-arcade - Copy.png")
ghostimg=pygame.image.load("ghost.jpg")
ghostimgx=random.randint(0,130)
ghostimgy=random.randint(20,350)
ghostimgspeedx=-1
ghostimgspeedy=10
bulletimg=pygame.image.load("BULLET1.png")
while running:
screen.blit(background,(0,0))
for event in pygame.event.get():
if event.type==pygame.QUIT:
running=False
if event.type==pygame.KEYDOWN:
if event.key==pygame.K_LEFT:
changex=-2
if event.key==pygame.K_RIGHT:
changex=2
if event.key==pygame.K_SPACE:
if check is False:
check=True
screen.blit(bulletimg,(150,350))
bulletx=spaceshipx+20
ghostimgx+=ghostimgspeedx
if ghostimgx<=0:
ghostimgspeedx=1
ghostimgy+=ghostimgspeedx
if ghostimgx>=940:
ghostimgspeedx=-1
ghostimgy+=ghostimgspeedy
if bullety<=0:
bullety=690
check=False
if check:
screen.blit(bulletimg, (bulletx, bullety))
bullety-=2
collision()
screen.blit(spaceshipimg,(spaceshipx,spaceshipy))
screen.blit(ghostimg,(ghostimgx,ghostimgy))
pygame.display.update()
if event.type==pygame.KEYUP:
changex=0
spaceshipx+=changex
if spaceshipx<=0:
spaceshipx=0
elif spaceshipx>=563:
spaceshipx=563
Conclusion:
Books–
Think Python(2nd Edition) by Allen B. Downey
Links--
https://www.youtube.com/watch?v=- FoziIlV7N0
https://github.com/topics/space-shooter