Sei sulla pagina 1di 28

A Mini Project Report

on

SAVE OUR CITY

By
M.ABHINAY REDDY-1602-14-733-001
M.ADARSH-1602-14-733-002

Department of Computer Science & Engineering


Vasavi College of Engineering
(Autonomous)
Ibrahimbagh, Hyderabad-31
2016

ACKNOWLEDGEMENT
The success and final outcome of this project required a lot of guidance and assistance
from many people and we are extremely fortunate to have got this all along the
completion of our project work. Whatever we have done is only due to such guidance
and assistance and we would not forget to thank them.
We are highly indebted to Mr. Shashi and Mr. Vinay for giving us an opportunity to
do the project.
We are thankful to and fortunate enough to get constant encouragement, support and
guidance from all Teaching staffs of Department of computer science which helped us
in successfully completing our project work. Also, we would like to extend our
sincere regards to all the non-teaching staff of department of computer science for
their timely support.

Table of Contents
1 INTRODUCTION:...........................................................................1
1.1 Purpose:..........................................................................................................1
1.2

Scope:..........................................................................................................1

1.3

Definitions, Acronyms, and Abbreviations:................................................1

1.4 Overview:.....................................................................................................2
2.0

OVERALL DESCRIPTION...........................................................................2

2.1 Product Perspective:......................................................................................3


2.2

User Characteristics...................................................................................... 3

3.0 PERFORMANCE REQUIREMENTS............................................................4


3.1 Usability:........................................................................................................4
3.2 Performance:..................................................................................................4
4 SPECIFIC REQUIREMENTS............................................................................5
5 FIGURES..............................................................................................................8
6 CODE...................................................................................................................8
7 SCREENSHOTS.................................................................................................11
8 CONCLUSION AND ENHANCEMENTS...............................................14
9 REFERENCES....................................................................................................14

List of Figures
Figure 1
Shooter
.. 9
Figure 2 Enemy Flight.................................................................................. 9
Figure 3 Bomb Explosion..........................................................................9
Figure 4 Enemy Explosion............................................................................9
Figure 5 Shooter
Laser
..9
Figure 6 Enemy Laser.................................................................................. 9
Figure 7
shield
.9
Figure 8 Special Power................................................................................. 9
Figure 9 Home Page of The Game.............................................................26
Figure 10 Game while Playing...................................................................26
Figure 11 Game over Page........................................................................27
Figure 12 About The Game........................................................................27

Abstract
This is a game similar to the shooting games popular thesedays. Here, the aliens
attack the city with their weapons and at the same time the citizens of the city will try
to save themselves by shooting the aliens back. Save our city is a
game which can be implemented using Python language which can run on
anydesktop..

1.0 INTRODUCTION:
1.1 Purpose:

This document is a proposal for requirement specifications in response to the


Game Save Our City. We are very excited about the idea of the game and
prospects of working on its development. We are also very confident that our
level of expertise will match the sophistication of the games requirements.

1.2 Scope:

The requirements specified in this document will be used for designing all the
aspects and components of the game. The document will be updated as the
requirements grow and change over the design and development process.

1.3Definitions, Acronyms, and Abbreviations:

RS = Requirements Specifications
IDE = Integrated Development Environment
GUI = Graphical users interface
PyGames =Game library for Python

1.4 Overview

This will provide an overview of our vision of the game including our
perspectives of the game, assumptions of user characteristics and interactions,
and some design constraints.

2. Overall Description
2.1 Product Perspective
2.1.1 System Interfaces

There are no external system interfaces that Game will interact with.

2.1.2 User Interfaces

The interface for the users will be entertaining and engaging. The function of
the buttons will be easy to understand and simple to use. Menus will be
interactive and easily accessible throughout the game. Once the game is in playing
mode, everything a user needs will be clearly visible on the screen and easily
accessible.

2.1.3 Hardware Interfaces


1 | Page

The game should be able to adjust to one button mouse input or two button
mouse input depending on the system its running on. the total size of the
game remains under the 80mb limit.

2.1.4 Software Interfaces

Python

2.1.5 Operating System Environment

Windows-7
Windos-10

2.1.6 Operations
The game will provide the following minimal operations:
Provide user interface and controls for the targeted audience.
Provide Entertainment to the Users.

2.2 User Characteristics

This game is targeted directly towards children .This typically correspond to


ages ranging from 6 to 8 years. They also tend to be very curious.

2.3 Constraints
The following constraints are specified :
Platform independence is necessary since each user may have a different OS.
It will be necessary to test the game on children to ensure that it is entertaining and
easy to use.
o Windows 7 and newer: DualCore, 16 MB ram, 80 MB HDD space, Mouse, SVGA
video card, 2x, or better, speed CD-ROM, DirectX compatible sound card.

3. Performance Requirements
In this section, we will specify detailed requirements for the game

3.1 Usability

The system will test basic computer abilities prior to beginning the game, and
provide the necessary tutorials

2 | Page

The system will provide in-game tutorials and help


Maximum time from launching the game until it is playable will be 5 minutes.
Familiar user interface provided for children.

3.2 Performance

Resource utilization The game will occupy at most 80mb of hard drive space.
It will also be kept simple enough to run smoothly on a system having no
more then a 60 Mhz processor and 16MB of ram.

4.Specific Requirements
In this section, we will specify detailed requirements for the game

Player Can Shoot the Enemy Flights.


Player Can get power ups in the middle of game like Shield ,Super Bomb
power.

5.Figures
3 | Page

Figure 1 Shooter
Enemy Flight

Figure 2

Figure 3 Bomb Explosion


Figure 4 Enemy Explosion

Figure 5 Shooter Laser

Figure 7 shield
Power

4 | Page

Figure 6 Enemy Laser

Figure 8 Special

6.Code:
#Import
import os, sys, pygame, random
from pygame.locals import *
pygame.init()
pygame.display.set_caption("Save Our City")
icon = pygame.image.load("airplane.png")
icon = pygame.display.set_icon(icon)
screen = pygame.display.set_mode((800, 600))
pygame.mouse.set_visible(0)
#Background
background = pygame.Surface(screen.get_size())
background.fill((0,0,0))
#Music
music = pygame.mixer.music.load ("data/music/blassic.ogg") #lost.ogg
pygame.mixer.music. play(-1)
#Load Images
def load_image(name, colorkey=None):
fullname = os.path.join('data', name)
try:
image = pygame.image.load(fullname)
except pygame.error, message:
print 'Cannot load image:', fullname
raise SystemExit, message
image = image.convert()
if colorkey is not None:
if colorkey is -1:
colorkey = image.get_at((0,0))
image.set_colorkey(colorkey, RLEACCEL)
return image, image.get_rect()
#Load Sounds
def load_sound(name):
class NoneSound:
def play(self): pass
if not pygame.mixer or not pygame.mixer.get_init():
return NoneSound()
fullname = os.path.join('data', name)
try:
sound = pygame.mixer.Sound(fullname)
except pygame.error, message:
print 'Cannot load sound:', fullname
raise SystemExit, message
5 | Page

return sound

#Sprites
#This class controls the arena background
class Arena(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
self.image, self.rect = load_image("menu/untitled.jpg", -1)
self.dy = 20
self.reset()
def update(self):
self.rect.bottom += self.dy
if self.rect.bottom >= 1200:
self.reset()
def reset(self):
self.rect.top = -1000
#Player
class Player(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
self.image, self.rect = load_image("sprites/airplane.png", -1)
self.rect.center = (400,500)
self.dx = 0
self.dy = 0
self.reset()
self.lasertimer = 0
self.lasermax = 5
self.bombamount = 1
self.bombtimer = 0
self.bombmax = 5
def update(self):
self.rect.move_ip((self.dx, self.dy))
#Fire the laser
key = pygame.key.get_pressed()
if key[pygame.K_SPACE]:
self.lasertimer = self.lasertimer + 1
if self.lasertimer == self.lasermax:
laserSprites.add(Laser(self.rect.midtop))
fire.play()
self.lasertimer = 0
6 | Page

#Fire the bomb


if key[pygame.K_LCTRL]:
self.bombtimer = self.bombtimer + 1
if self.bombtimer == self.bombmax:
self.bombtimer = 0
if self.bombamount > 0:
self.bombamount = self.bombamount -1
score.bomb += -1
bombSprites.add(Bomb(self.rect.midtop))
torpedo.play()
#Player Boundaries
if self.rect.left < 0:
self.rect.left = 0
elif self.rect.right > 800:
self.rect.right = 800
if self.rect.top <= 260:
self.rect.top = 260
elif self.rect.bottom >= 600:
self.rect.bottom = 600
def reset(self):
self.rect.bottom = 600
#Laser class
class Laser(pygame.sprite.Sprite):
def __init__(self, pos):
pygame.sprite.Sprite.__init__(self)
self.image, self.rect = load_image("sprites/laser.png", -1)
self.rect.center = pos
def update(self):
if self.rect.top < 0:
self.kill()
else:
self.rect.move_ip(0, -15)
#Bomb class
class Bomb(pygame.sprite.Sprite):
def __init__(self, pos):
pygame.sprite.Sprite.__init__(self)
self.image, self.rect = load_image("sprites/bomb.png", -1)
self.rect.center = pos
def update(self):
7 | Page

if self.rect.top < 0:
self.kill()
else:
self.rect.move_ip(0, -5)
if pygame.sprite.groupcollide(enemySprites, bombSprites, 1, 1):
bombExplosionSprites.add(BombExplosion(self.rect.center))
explode.play()
#Laser class
class EnemyLaser(pygame.sprite.Sprite):
def __init__(self, pos):
pygame.sprite.Sprite.__init__(self)
self.image, self.rect = load_image("sprites/elaser.png", -1)
self.rect.center = pos
def update(self):
if self.rect.bottom < 0:
self.kill()
else:
self.rect.move_ip(0, 15)
#Enemy class
class Enemy(pygame.sprite.Sprite):
def __init__(self, centerx):
pygame.sprite.Sprite.__init__(self)
self.image, self.rect = load_image("sprites/f161.png", -1)
self.rect = self.image.get_rect()
self.dy = 8
self.reset()
def update(self):
self.rect.centerx += self.dx
self.rect.centery += self.dy
if self.rect.top > screen.get_height():
self.reset()
#random 1 - 60 determines if firing
efire = random.randint(1,60)
if efire == 1:
enemyLaserSprites.add(EnemyLaser(self.rect.midbottom))
efire = load_sound("sounds/elaser.ogg")
efire.play()
#Laser Collisions
if pygame.sprite.groupcollide(enemySprites, laserSprites, 1, 1):
explosionSprites.add(EnemyExplosion(self.rect.center))
explode.play()
score.score += 10
8 | Page

#Bomb Collisions
if pygame.sprite.groupcollide(enemySprites, bombSprites, 1, 1):
bombExplosionSprites.add(BombExplosion(self.rect.center))
explode.play()
score.score += 10
#Bomb Explosion Collisions
if pygame.sprite.groupcollide(enemySprites, bombExplosionSprites, 1, 0):
explosionSprites.add(EnemyExplosion(self.rect.center))
explode.play()
score.score += 10
def reset(self):
self.rect.bottom = 0
self.rect.centerx = random.randrange(0, screen.get_width())
self.dy = random.randrange(5, 10)
self.dx = random.randrange(-2, 2)
class Shield(pygame.sprite.Sprite):
def __init__(self, pos):
pygame.sprite.Sprite.__init__(self)
self.image, self.rect = load_image("sprites/shield.png", -1)
self.rect.center = pos
self.counter = 0
self.maxcount = 2
def update(self):
self.counter = self.counter + 1
if self.counter == self.maxcount:
self.kill()
class EnemyExplosion(pygame.sprite.Sprite):
def __init__(self, pos):
pygame.sprite.Sprite.__init__(self)
self.image, self.rect = load_image("sprites/enemyexplosion.png", -1)
self.rect.center = pos
self.counter = 0
self.maxcount = 10
def update(self):
self.counter = self.counter + 1
if self.counter == self.maxcount:
self.kill()
class BombExplosion(pygame.sprite.Sprite):
def __init__(self, pos):
pygame.sprite.Sprite.__init__(self)
self.image, self.rect = load_image("sprites/bombexplosion.png", -1)
self.rect.center = pos
self.counter = 0
9 | Page

self.maxcount = 5
def update(self):
self.counter = self.counter + 1
if self.counter == self.maxcount:
self.kill()
#Bomb Powerup
class BombPowerup(pygame.sprite.Sprite):
def __init__(self, centerx):
pygame.sprite.Sprite.__init__(self)
self.image, self.rect = load_image("sprites/torpedopowerup.png", -1)
self.rect = self.image.get_rect()
self.rect.centerx = random.randrange(0, screen.get_width())
def update(self):
if self.rect.top > screen.get_height():
self.kill
else:
self.rect.move_ip(0, 6)
#Shield Powerup
class ShieldPowerup(pygame.sprite.Sprite):
def __init__(self, centerx):
pygame.sprite.Sprite.__init__(self)
self.image, self.rect = load_image("sprites/shieldpowerup.png", -1)
self.rect = self.image.get_rect()
self.rect.centerx = random.randrange(0, screen.get_width())
def update(self):
if self.rect.top > screen.get_height():
self.kill
else:
self.rect.move_ip(0, 6)
class Score(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
self.shield = 100
self.score = 0
self.bomb = 1
self.font = pygame.font.Font("data/fonts/Halo3.ttf", 28)
def update(self):
self.text = "Shield: %d Score: %d
Torpedo: %d" % (self.shield,
self.score, self.bomb)
self.image = self.font.render(self.text, 1, (0, 255, 0))
self.rect = self.image.get_rect()
self.rect.center = (400,20)
10 | P a g e

class Gameover(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
self.font = pygame.font.Font("data/fonts/Halo3.ttf", 48)
def update(self):
self.text = ("GAME OVER")
self.image = self.font.render(self.text, 1, (0, 255, 0))
self.rect = self.image.get_rect()
self.rect.center = (400,300)
class Gameoveresc(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
self.font = pygame.font.Font("data/fonts/Halo3.ttf", 28)
def update(self):
self.text = "PRESS ESC TO RETURN"
self.image = self.font.render(self.text, 1, (0, 255, 0))
self.rect = self.image.get_rect()
self.rect.center = (400,400)
#Game Module
def game():
#Game Objects
global player
player = Player()
global score
score = Score()
global fire
fire = load_sound("sounds/laser.ogg")
global explode
explode = load_sound("sounds/explode.ogg")
global torpedo
torpedo = load_sound("sounds/torpedo.ogg")
global powerup
powerup = load_sound("sounds/powerup.ogg")
#Game Groups
#Player/Enemy
playerSprite = pygame.sprite.RenderPlain((player))
global enemySprites
enemySprites = pygame.sprite.RenderPlain(())
enemySprites.add(Enemy(200))
enemySprites.add(Enemy(300))
11 | P a g e

enemySprites.add(Enemy(400))
#Projectiles
global laserSprites
laserSprites = pygame.sprite.RenderPlain(())
global bombSprites
bombSprites = pygame.sprite.RenderPlain(())
global enemyLaserSprites
enemyLaserSprites = pygame.sprite.RenderPlain(())
#Powerups
global bombPowerups
bombPowerups = pygame.sprite.RenderPlain(())
global shieldPowerups
shieldPowerups = pygame.sprite.RenderPlain(())
#Special FX
shieldSprites = pygame.sprite.RenderPlain(())
global explosionSprites
explosionSprites = pygame.sprite.RenderPlain(())
global bombExplosionSprites
bombExplosionSprites = pygame.sprite.RenderPlain(())
#Score/and game over
scoreSprite = pygame.sprite.Group(score)
gameOverSprite = pygame.sprite.RenderPlain(())
#Arena
arena = Arena()
arena = pygame.sprite.RenderPlain((arena))
#Set Clock
clock = pygame.time.Clock()
keepGoing = True
counter = 0
#Main Loop
while keepGoing:
clock.tick(30)
#input
for event in pygame.event.get():
if event.type == pygame.QUIT:
keepGoing = False
elif event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE:
keepGoing = False
12 | P a g e

elif event.key == pygame.K_LEFT:


player.dx = -10
elif event.key == K_RIGHT:
player.dx = 10
elif event.key == K_UP:
player.dy = -10
elif event.key == K_DOWN:
player.dy = 10
elif event.type == KEYUP:
if event.key == K_LEFT:
player.dx = 0
elif event.key == K_RIGHT:
player.dx = 0
elif event.key == K_UP:
player.dy = 0
elif event.key == K_DOWN:
player.dy = 0

#Update and draw on the screen


#Update
screen.blit(background, (0,0))
playerSprite.update()
enemySprites.update()
laserSprites.update()
bombSprites.update()
enemyLaserSprites.update()
bombPowerups.update()
shieldPowerups.update()
shieldSprites.update()
explosionSprites.update()
bombExplosionSprites.update()
arena.update()
scoreSprite.update()
gameOverSprite.update()
#Draw
arena.draw(screen)
playerSprite.draw(screen)
enemySprites.draw(screen)
laserSprites.draw(screen)
bombSprites.draw(screen)
enemyLaserSprites.draw(screen)
bombPowerups.draw(screen)
shieldPowerups.draw(screen)
shieldSprites.draw(screen)
explosionSprites.draw(screen)
bombExplosionSprites.draw(screen)
13 | P a g e

scoreSprite.draw(screen)
gameOverSprite.draw(screen)
pygame.display.flip()
#Spawn new enemies
counter += 1
if counter >= 20:
enemySprites.add(Enemy(300))
counter = 0
#Spawn Shield Power up
#shieldPowerupcounter += 1
spawnShieldpowerup = random.randint(1,500)
if spawnShieldpowerup == 1:
shieldPowerups.add(ShieldPowerup(300))
#Spawn Bomb Power up
spawnBombpowerup = random.randint(1,500)
if spawnBombpowerup == 1:
bombPowerups.add(BombPowerup(300))
bombPowerupcounter = 0
#Check if enemy lasers hit player's ship
for hit in pygame.sprite.groupcollide(enemyLaserSprites, playerSprite, 1, 0):
explode.play()
explosionSprites.add(Shield(player.rect.center))
score.shield -= 10
if score.shield <= 0:
gameOverSprite.add(Gameover())
gameOverSprite.add(Gameoveresc())
playerSprite.remove(player)
#Check if enemy collides with player
for hit in pygame.sprite.groupcollide(enemySprites, playerSprite, 1, 0):
explode.play()
explosionSprites.add(Shield(player.rect.center))
score.shield -= 10
if score.shield <= 0:
gameOverSprite.add(Gameover())
gameOverSprite.add(Gameoveresc())
playerSprite.remove(player)
#Check if player collides with shield powerup
for hit in pygame.sprite.groupcollide(shieldPowerups, playerSprite, 1, 0):
if score.shield < 100:
powerup.play()
score.shield += 10
14 | P a g e

#Check if player collides with bomb powerup


for hit in pygame.sprite.groupcollide(bombPowerups, playerSprite, 1, 0):
powerup.play()
player.bombamount += 1
score.bomb += 1
#Class Module
class SpaceMenu:
#Define the initalize self options
def __init__(self, *options):
self.options = options
self.x = 0
self.y = 0
self.font = pygame.font.Font(None, 32)
self.option = 0
self.width = 1
self.color = [0, 0, 0]
self.hcolor = [0, 0, 0]
self.height = len(self.options)*self.font.get_height()
for o in self.options:
text = o[0]
ren = self.font.render(text, 1, (0, 0, 0))
if ren.get_width() > self.width:
self.width = ren.get_width()
#Draw the menu
def draw(self, surface):
i=0
for o in self.options:
if i==self.option:
clr = self.hcolor
else:
clr = self.color
text = o[0]
ren = self.font.render(text, 1, clr)
if ren.get_width() > self.width:
self.width = ren.get_width()
surface.blit(ren, (self.x, self.y + i*self.font.get_height()))
i+=1
#Menu Input
def update(self, events):
for e in events:
if e.type == pygame.KEYDOWN:
if e.key == pygame.K_DOWN:
self.option += 1
if e.key == pygame.K_UP:
15 | P a g e

self.option -= 1
if e.key == pygame.K_RETURN:
self.options[self.option][1]()
if self.option > len(self.options)-1:
self.option = 0
if self.option < 0:
self.option = len(self.options)-1
#Position Menu
def set_pos(self, x, y):
self.x = x
self.y = y
#Font Style
def set_font(self, font):
self.font = font
#Highlight Color
def set_highlight_color(self, color):
self.hcolor = color
#Font Color
def set_normal_color(self, color):
self.color = color
#Font position
def center_at(self, x, y):
self.x = x-(self.width/2)
self.y = y-(self.height/2)

def missionMenu():
#Arena
arena = Arena()
arena = pygame.sprite.RenderPlain((arena))
#Title for Option Menu
menuTitle = SpaceMenu(
["Save Our City"])
#Option Menu Text
instructions = SpaceMenu(
[""],
["Aliens from the planet have entered earth's sub"],
[""],
["space and plan to destroy the Earth! You are our last hope!"],
[""],
16 | P a g e

["Navigate your space cruiser with the arrow keys and use"],
[""],
["the space bar to fire the proton laser. Use the left CTRL"],
[""],
["key to shoot a torpedo. Be careful, you have a limited"],
[""],
["supply. Kill as many enemies as you can!"],
[""],
[""],
["
PRESS ESC TO RETURN
"])
#Title
menuTitle.center_at(150, 150)
menuTitle.set_font(pygame.font.Font("data/fonts/Halo3.ttf", 48))
menuTitle.set_highlight_color((0, 255, 0))
#Title Center
instructions.center_at(440, 350)
#Menu Font
instructions.set_font(pygame.font.Font("data/fonts/Halo3.ttf", 22))
#Highlight Color
instructions.set_normal_color((0, 255, 0))
#Set Clock
clock = pygame.time.Clock()
keepGoing = True
while keepGoing:
clock.tick(30)
#input
for event in pygame.event.get():
if event.type == pygame.QUIT:
keepGoing = False
elif event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE:
keepGoing = False
#Draw
screen.blit(background, (0,0))
arena.update()
arena.draw(screen)
menuTitle.draw(screen)
instructions.draw(screen)
pygame.display.flip()

17 | P a g e

def aboutMenu():
#Arena
arena = Arena()
arena = pygame.sprite.RenderPlain((arena))
#About Menu Text
#Title for Option Menu
menuTitle = SpaceMenu(
["Save Our City"])
info = SpaceMenu(
[""],
["Save our city"],
[""],
["Devloped by"],
[""],
["
PRESS ESC TO RETURN

"])

#About Title Font color, alignment, and font type


menuTitle.center_at(150, 150)
menuTitle.set_font(pygame.font.Font("data/fonts/Halo3.ttf", 48))
menuTitle.set_highlight_color((0, 255, 0))
#About Menu Text Alignment
info.center_at(400, 310)
#About Menu Font
info.set_font(pygame.font.Font("data/fonts/Halo3.ttf", 28))
#About Menu Font Color
info.set_normal_color((0, 255, 0))
#Set Clock
clock = pygame.time.Clock()
keepGoing = True
while keepGoing:
clock.tick(30)
#input
for event in pygame.event.get():
if event.type == pygame.QUIT:
keepGoing = False
elif event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE:
keepGoing = False
#Draw
18 | P a g e

screen.blit(background, (0,0))
arena.update()
arena.draw(screen)
menuTitle.draw(screen)
info.draw(screen)
pygame.display.flip()
#Functions
def option1():
game()
def option2():
missionMenu()
def option3():
aboutMenu()
def option4():
pygame.quit()
sys.exit()

#Main
def main():
#Arena
arena = Arena()
arena = pygame.sprite.RenderPlain((arena))
#Defines menu, option functions, and option display. For example,
#Changing "Start" to "Begin" will display Begin, instead of start.
menuTitle = SpaceMenu(
["Save Our City"])
menu = SpaceMenu(
["Start", option1],
["Misson", option2],
["About", option3],
["Quit", option4])

#Title
menuTitle.center_at(150, 150)
menuTitle.set_font(pygame.font.Font("data/fonts/Halo3.ttf", 75))
menuTitle.set_highlight_color((0, 255, 0))
#Menu settings
menu.center_at(400, 320)
19 | P a g e

menu.set_font(pygame.font.Font("data/fonts/Halo3.ttf", 32))
menu.set_highlight_color((0, 255, 0))
menu.set_normal_color((0, 85, 0))
clock = pygame.time.Clock()
keepGoing = True
while 1:
clock.tick(30)
#Events
events = pygame.event.get()
#Update Menu
menu.update(events)
#Quit Event
for e in events:
if e.type == pygame.QUIT:
pygame.quit()
return
#Draw
screen.blit(background, (0,0))
arena.update()
arena.draw(screen)
menu.draw(screen)
menuTitle.draw(screen)
pygame.display.flip()
if __name__ == "__main__":
main()

7.ScreenShots:

20 | P a g e

Figure 9 Home Page of The Game

Figure 10 Game while Playing

21 | P a g e

Figure 11 Game over Page

Figure 12 About The Game

22 | P a g e

8. CONCLUSION AND ENHANCEMENTS


Conclusion:
The Game is Created for the fun and entertainment.

Future Enhancements:
Further enhancements for the project would be able to add new levels.

9. References:
1. http://www.pygame.org/docs/ref/image.html
2. http://www.pygame.org/hifi.html
3. http://www.pygame.org/docs/ref/mixer.html
4. http://www.pygame.org/docs/

23 | P a g e

Potrebbero piacerti anche