MINI REPORT Final PDF
MINI REPORT Final PDF
IN
COMPUTER SCIENCE AND ENGINEERING
BY
M.SHIVA SHANKAR 2210315843
M.SAI VENKATA CHAITANYA 2210315842
B.KRUTHIKA REDDY 2210315833
Y.VENKATA NARASIMHA REDDY 2210315863
SCHOOL OF TECHNOLOGY
GITAM(Deemed to be University)
HYDERABAD
I
SCHOOL OF TECHNOLOGY Rudraram Village, Patancheru Mandal
GITAM (Deemed to be university) Sangareddy Dist-502329,TS,INDIA
Hyderabad Ph:08455-220556/57;Fax:08455-20046
Website:-www.gitam.edu
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CERTIFICATE
1.
2.
3.
II
DECLARATION
This is a record of bona fide work carried out by us and the content embodied
in this project have not been reproduced /copied from any source. The content
embodied in this project report have not been submitted to any other university or
institute for the award of any other degree or diploma.
M.SHIVA SHANKAR
(2210315843)
B.KRUTHIKA REDDY
(2210315833)
III
ACKNOWLEDGEMENT
IV
LIST OF CONTENTS
TITLE I
CERTIFICATE II
DECLARATION III
ACKNOWLEDGEMENT IV
CONTENTS V,VI
ABSTRACT VII
LIST OF FIGURES VIII
LIST OF SCREENS XI
1. INTRODUCTION……………………………………………….….…1
2. LITERATURE SURVEY………………………………………..…….2
2.1 EXSISTING SYSTEM………………………………………….…2
2.2 LIMITATION…………………………………………..…….……3
2.3 PROPOSED SYSTEM..……………………………………..……3
2.4 ADVANTAGES………….……………………………….…….…5
2.5 PYTHON DISADVANTAGES………………………………..….6
3. ANALYSIS……………………………………………………………7
3.1 SOFTWARE FLOW………………………………………….…..7
3.2 SOFTWARE AND HARDWARE INTERFACE………..…..……7
3.3 MINIMUM SYSTEM REQUIREMENTS……………………….8
3.4 SOURCE CODE………………………………………………….9
3.5 SOUND INTEGRATION………………………………..………30
4. DESIGN……………………………………………………..………32
4.1 GAME DESIGN APPROACH……………………………….…32
4.1 UML DIAGRAMS………………………………………………36
4.2 MODULES AND FUNCTIONALITY……………………….…41
V
5. TESTING……………………………………………………………44
5.1 TESTING STRATEGIES………………………………………44
5.2 COMMON BUGS……………………………………………..45
6.SCREEN OUTPUTS………………………………..……….…..….47
7.COGNITIVE BENIFITS OF GAMING……..………………….…..52
8.DISADVANTAGES OF GAMING…..………………….…….……55
9.CONCLUSION………………………………………..…………….57
10.FUTURE WORKS………………………………………..……..…58
11.BIBLIOGRAPHY…………………………………………….……59
VI
Python Game Development
ABSTRACT
Programming + Turtle + other advanced python modules are used to build graphical
user interfaces (GUI) and games from scratch. By learning from basics of Python i.e.
variables, slicing, string, some module, arithmetic and logical operations, looping,
functions, object oriented programming it creates the base for logical
implementation .After getting familiar with the basics & by understanding the
working of Pygame , Pymunk and OpenGL and Blender basics stuff. By using all the
tools, softwares mentioned above we are planning to make a game from the various
ideas we got such as 2d racing with some AI control for traffic or Arcade game.
VII
LIST OF FIGURES
Figure A……………………………………….…………………..7
Figure G:FlowChart…………………..……………………….….40
VIII
LIST OF SCREENS
IX
PYTHON GAME DEVELOPMENT
1.INTRODUCTION
The 2-D game is about Car Racing With Some AI control for Traffic. The
objective of the game is to collect the trophies placed in random location of map by
avoiding the traffic and collision by the other cars. The game can be integrated with
Music to get real gaming experience.
2.LITERATURE SURVEY
The existing system explains that Raspberry Pi is a single board computer with
ARM11 microprocessor and sizes in the dimension of a credit card. The main idea of
this paper is about controlling a game, written in Python Tkinter, using Accelerometer
and Hand Gestures. Accelerometer is conjoined with Raspberry Pi for detecting left or
right movements and by the tilting of the device, the game is controlled by Pi. Hand
gestures will be captured by camera module which is interfaced with Raspberry Pi
then ascertains the hand gestures using SimpleCV and an image processing program
written in python, which is installed in Raspberry Pi.
At present the input device which is primarily used to manipulate video games
is called a game controller, and varies across platforms. For example, a controller
might consist of only a button and a joystick, while another may feature a dozen
buttons and one or more joysticks.
2.2 Limitations
The following points express the limitations of the existing system :
The existing system uses a accelerometer and other sensors to get the inputs for the
game but , the sensor might get some noise in the values due to external
environment factors .
Since the input is taken through sensors the processing of input might take long
time .
Raspberry Pie being a Mini computer with limited capabilities and system
configuration it usually crashes when there are a lot of processes running .
Raspberry Pie due to its restricted System configuration , it sometimes can’t render
the required frames per second (FPS) for the game and the game becomes too
slow . It takes a lot of time to load environment in the game.
Since the Raspberry Pie doesn’t have any GPU or graphic card it is impossible for
rendering some graphics and it is not possible to output the threshold amount of
resolution and pixels .
The 2-D game development is done using Python and the modules supporting
it. It makes use of PyGame module for implementing the graphics ,movements and
actions that should be performed on objects in the game for the input given by the
gamer. Nowadays, pip is probably the best method for installing PyGame, since it
comes with the latest versions of Python 2 and Python 3.Pygame is a cross-platform
set of Python modules designed for writing video games. It includes computer
graphics and sound libraries designed to be used with the Python programming
language.
Pygame is a python module used to program games like tkinter is also python
module pygame programming is a bit complicated, Built over the Simple DirectMedia
Layer (SDL) library, with the intention of allowing real-time computer game
development without the low-level mechanics of the C programming language and its
derivatives. This is based on the assumption that the most expensive functions inside
games (mainly the graphics part) can be abstracted from the game logic, making it
possible to use a high-level programming language, such as Python, to structure the
game.
Applications using pygame can run on Android phones and tablets with the
use of Pygame Subset for Android . Sound, vibration, keyboard, and accelerometer
are supported on Android.The 2-D python game is about a Car game . The description
of the game is given with respect to the performance , environment ,actuators and
other percepts (inputs) .
Initially the car appears in some random location of the map .The car may end
up on dead end road , T junction road , X road or on a Straight lane road . The user or
gamer is supposed to control the car using the arrow keys , the forward pointing
arrow is for accelerating forward and backward pointing arrow is for decelerating .the
left ,right arrows keys are used to turn the car lest and right respectively . The time
duration of the game is usually 60 seconds or 1 minute . The user can get points by
collecting the violets trophies that he/she finds in the different locations of the map .
The user can get to know the location of the trophies by analysing the arrow direction
shown on the bottom right of the screen .The real challenge comes into play when
user is subjected to the traffic caused by the other cars which run in random locations
or others ways in the map. The gamer or user when makes any collision with the other
cars using his own car then the score is deducted.
The number of cars running on the road can be changed. The acceleration and
top speed of the other cars and the gamer car can be changed .
2.4The Advantages
The advantages when compared to the existing system are mentioned below:-
The game takes input from the keyboard rather than the sensors , so there is no
question of discrepancy or noise in the input which the game gets .
A major advantage of using Python for game development is that the language is
very easy to learn Apart from that, you will be heavily into Object oriented with
Python even though it may seem that you aren't doing anything related to object
oriented Python is completely object oriented for that fact .
The language is agile by nature and makes refactoring easy, thus ensuring constant
improvement of your game design and higher code quality. Python is designed to
easily call from and to C, C++ and Java code, so, say, the need to write
performance-intensive modules of your game in C++ will not bring trouble .
Rapid prototyping
With Python, you can try out new ideas and solutions in a day, not weeks, or you can
even integrate prototyping in the development process. The language is agile by
nature and makes refactoring easy, thus ensuring constant improvement of your game
design and higher code quality.
Integration
Python is designed to easily call from and to C, C++ and Java code, so, say, the need
to write performance-intensive modules of your game in C++ will not bring trouble. It
is possible to write and debug code in Python and then convert it by hand into C++.
Cross-platform
Python games perform smoothly on a platform, making support cost-saving and easy.
2.5Python Disadvantages
Performance
An interpreted language, Python is expected to run slower than compiled languages.
However, according to Brian Curtin, a member of the Python Software Foundation
board of directors and a core contributor to CPython, it’s all about separating the
language from the runtime. “Certain benchmarks of Python code run under PyPy run
faster than the equivalent C code or others,” he says.
Design limitations
As a dynamically typed language, Python requires considerable testing, bringing
errors that only show up at runtime.
3.ANALYSIS
VGA SCREEN DRIVER Render and show cars and background environment
Mac:
• Mac OS X 10.8 or higher
• 1 GB RAM minimum
• 2 GB RAM recommended
• Python 2.4 or higher, Jython, PyPy or IronPython
Linux:
• 512 MB RAM minimum,
• 1 GB RAM recommended
• 1024x768 minimum screen resolution
• Python 2.4 or higher, Jython, PyPy or IronPython
mixer.init()
mixer.music.load('/Users/shivashankar/Desktop/RACEGAME/media/uturn.mp3')
mixer.music.play()
TRAFFIC_COUNT = 500
CENTER_W = -1
CENTER_H = -1
#Main function.
def main():
#initialize objects.
clock = pygame.time.Clock()
running = True
font = pygame.font.Font(None, 24)
car = player.Player()
cam = camera.Camera()
target = gamemode.Finish()
bound_alert = bounds.Alert()
time_alert = timeout.Alert()
info = menu.Alert()
pointer = direction.Tracker(int(CENTER_W * 2), int(CENTER_H * 2))
#create sprite groups.
map_s = pygame.sprite.Group()
player_s = pygame.sprite.Group()
traffic_s = pygame.sprite.Group()
tracks_s = pygame.sprite.Group()
target_s = pygame.sprite.Group()
pointer_s = pygame.sprite.Group()
timer_alert_s = pygame.sprite.Group()
bound_alert_s = pygame.sprite.Group()
menu_alert_s = pygame.sprite.Group()
#generate tiles
for tile_num in range (0, len(maps.map_tile)):
maps.map_files.append(load_image(maps.map_tile[tile_num], False))
for x in range (0, 10):
for y in range (0, 10):
map_s.add(maps.Map(maps.map_1[x][y], x * 1000, y * 1000,
maps.map_1_rot[x][y]))
#load tracks
tracks.initialize()
#load finish
target_s.add(target)
#load direction
pointer_s.add(pointer)
#load alerts
timer_alert_s.add(time_alert)
bound_alert_s.add(bound_alert)
menu_alert_s.add(info)
#load traffic
traffic.initialize(CENTER_W, CENTER_H)
for count in range(0, TRAFFIC_COUNT):
traffic_s.add(traffic.Traffic())
player_s.add(car)
cam.set_pos(car.x, car.y)
while running:
#Render loop.
sys.exit(0)
cam.set_pos(car.x, car.y)
#Render Scene.
screen.blit(background, (0,0))
#cam.set_pos(car.x, car.y)
map_s.update(cam.x, cam.y)
map_s.draw(screen)
#Conditional renders/effects
car.grass(screen.get_at(((int(CENTER_W-5), int(CENTER_H-5)))).g)
if (car.tracks):
tracks_s.add(tracks.Track(cam.x + CENTER_W, cam.y + CENTER_H,
car.dir))
#Just render..
tracks_s.update(cam.x, cam.y)
tracks_s.draw(screen)
player_s.update(cam.x, cam.y)
player_s.draw(screen)
traffic_s.update(cam.x, cam.y)
traffic_s.draw(screen)
target_s.update(cam.x, cam.y)
target_s.draw(screen)
#Conditional renders.
if (bounds.breaking(car.x+CENTER_W, car.y+CENTER_H) == True):
bound_alert_s.update()
bound_alert_s.draw(screen)
if (target.timeleft == 0):
timer_alert_s.draw(screen)
car.speed = 0
text_score = font.render('Final Score: ' + str(target.score), 1, (224, 16, 16))
textpos_score = text_fps.get_rect(centery=CENTER_H+56,
centerx=CENTER_W-20)
if (info.visibility == True):
menu_alert_s.draw(screen)
#Blit Blit..
screen.blit(text_fps, textpos_fps)
screen.blit(text_score, textpos_score)
screen.blit(text_timer, textpos_timer)
pygame.display.flip()
#Check collision!!!
if pygame.sprite.spritecollide(car, traffic_s, False):
car.impact()
target.car_crash()
target.generate_finish()
target_s.add(target)
clock.tick(64)
#initialization
pygame.init()
screen = pygame.display.set_mode((pygame.display.Info().current_w,
pygame.display.Info().current_h),
pygame.FULLSCREEN)
pygame.display.set_caption('Race of Math.')
pygame.mouse.set_visible(False)
font = pygame.font.Font(None, 24)
BOUND_MIN = 380
BOUND_MAX = 620
TURN_LOCK = 375
DISPLACEMENT = 65
CENTER_W = -1
CENTER_H = -1
HALF_TILE = 500
cars = []
car_files = ['traffic1.png', 'traffic2.png', 'traffic3.png',
'traffic4.png', 'traffic5.png']
#Rotate cars.
def rot_center(image, rect, angle):
"""rotate an image while keeping its center"""
rot_image = pygame.transform.rotate(image, angle)
rot_rect = rot_image.get_rect(center=rect.center)
return rot_image,rot_rect
#Initialize cars.
def initialize(center_w, center_h):
CENTER_W = center_w
CENTER_H = center_h
def road_tile(self):
x = randint(0,9)
y = randint(0,9)
while (maps.map_1[x][y] != 0):
x = randint(0,9)
y = randint(0,9)
return x * 1000 + HALF_TILE, y * 1000 + HALF_TILE
#turn controller
if tile_type == maps.turn:
if (tile_rot + 2 == self.dir / 90) or (-(tile_rot + 2) == self.dir / 90):
self.dir += 90
else:
self.dir -= 90
#split controller
if tile_type == maps.split:
self.dir = -180 - tile_rot * 90
self.dir += randint(-1, 1) * 90
#crossing controller
if tile_type == maps.crossing:
self.dir += randint(1,3) * 90
except:
return
#base variables
GRASS_SPEED = 0.715 #what is speed of car on grass
GRASS_GREEN = 75
CENTER_X = -1
CENTER_Y = -1
#Rotate car.
def rot_center(image, rect, angle):
"""rotate an image while keeping its center"""
rot_image = pygame.transform.rotate(image, angle)
rot_rect = rot_image.get_rect(center=rect.center)
return rot_image,rot_rect
def reset_tracks(self):
self.tracks = False
def soften(self):
if self.speed > 0:
self.speed -= self.softening
if self.speed < 0:
self.speed += self.softening
#Deaccelerate.
def deaccelerate(self):
#Steer.
def steerleft(self):
self.dir = self.dir+self.steering
if self.dir > 360:
self.dir = 0
if (self.speed > self.maxspeed / 2):
self.emit_tracks()
self.image, self.rect = rot_center(self.image_orig, self.rect, self.dir)
#Steer.
def steerright(self):
self.dir = self.dir-self.steering
if self.dir < 0:
self.dir = 360
if (self.speed > self.maxspeed / 2):
self.emit_tracks()
self.image, self.rect = rot_center(self.image_orig, self.rect, self.dir)
# Map filenames.
map_files = []
map_tile = ['X.png', 'I.png', 'L.png', 'T.png', 'O.png', 'null.png'] #images of file
# Map to tile.
crossing = 0
straight = 1
turn = 2
split = 3
deadend = 4
null = 5
# tilemap.
map_1 = [
[2, 1, 3, 1, 1, 3, 1, 1, 1, 4],
[1, 5, 1, 5, 4, 0, 1, 2, 5, 4],
[1, 4, 3, 1, 3, 3, 1, 3, 2, 1],
[3, 1, 3, 1, 3, 5, 4, 5, 1, 1],
[3, 2, 1, 5, 1, 5, 3, 1, 0, 3],
[1, 2, 0, 1, 0, 3, 0, 4, 1, 1],
[1, 5, 1, 4, 2, 1, 1, 2, 3, 1],
[1, 2, 0, 1, 3, 3, 0, 0, 2, 1],
[1, 1, 4, 2, 2, 5, 1, 2, 1, 3],
[2, 3, 1, 3, 1, 1, 3, 1, 1, 2]
]
class Map(pygame.sprite.Sprite):
def __init__(self, tile_map, y, x, rot):
pygame.sprite.Sprite.__init__(self)
self.image = map_files[tile_map]
self.rect = self.image.get_rect()
if rot != 0:
self.image = pygame.transform.rotate(self.image, rot * 90)
self.x = x
self.y = y
NOTE_HALF_X = 212
NOTE_HALF_Y = 112
#Alert body.
class Alert(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
self.image = load_image('timeout.png')
self.rect = self.image.get_rect()
self.x = int(pygame.display.Info().current_w /2) - NOTE_HALF_X
self.y = int(pygame.display.Info().current_h /2) - NOTE_HALF_Y
self.rect.topleft = self.x, self.y
PI = 3.14
#rotate the arrow.
def rot_center(image, rect, angle):
"""rotate an image while keeping its center"""
rot_image = pygame.transform.rotate(image, angle)
rot_rect = rot_image.get_rect(center=rect.center)
return rot_image,rot_rect
BOUND_MIN = 0
BOUND_MAX = 1000 * 10
NOTE_HALF_X = 211
NOTE_HALF_Y = 112
#alertbox.
class Alert(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
self.image = load_image('bounds.png')
self.rect = self.image.get_rect()
self.x = int(pygame.display.Info().current_w /2) - NOTE_HALF_X
self.y = int(pygame.display.Info().current_h /2) - NOTE_HALF_Y
self.rect.topleft = self.x, self.y
NOTE_HALF_X = 212
NOTE_HALF_Y = 112
#Alert body.
class Alert(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
self.image = load_image('timeout.png')
self.rect = self.image.get_rect()
self.x = int(pygame.display.Info().current_w /2) - NOTE_HALF_X
self.y = int(pygame.display.Info().current_h /2) - NOTE_HALF_Y
self.rect.topleft = self.x, self.y
BOUND_MIN = 0
BOUND_MAX = 1000 * 10
NOTE_HALF_X = 211
NOTE_HALF_Y = 242
#Alert box.
class Alert(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
self.image = load_image('menu.png')
self.rect = self.image.get_rect()
self.x = int(pygame.display.Info().current_w /2) - NOTE_HALF_X
self.y = int(pygame.display.Info().current_h /2) - NOTE_HALF_Y
self.rect.topleft = self.x, self.y
self.visibility = True
Video games are meant to immerse the player into a sort of virtual reality. We
do this mainly visually, but it can make a massive difference and be a massive
improvement to your game if you add sounds as well.
Sounds generally come in two major forms: Either "ambient" noise or as
results of player actions. With PyGame, you get two choices: Music or Sounds. Music
will just play in the background when you call it to, and sounds will play at any time
you call them to play. We're going to cover both here by adding them both to our
current game. First, use a simple tune from YouTube as our game's music and then
add a "crash" sound that will play if we hit any of the blocks.
The above will assign the crash.wav sound file to play when we call
crash_sound within PyGame's sound playing functionality. Notice the file is .wav.
PyGame can handle .mp3 as well, but it is somewhat glitchy, and will work
sometimes and other times it wont. For the safest bet, go with .wav.
Now that we know how to call sounds, how can we do music?
pygame.mixer.music.load('jazz.wav')
pygame.mixer.music.play(-1)
The above code will play the music file indefinitely (though you can call it to
stop). The -1 signals PyGame to just play forever, but, if you put, say, a 5 in there,
then the music would play once and 5 more times.
Now, want the music to play, and it is, then crash sound to play when
crashed. Also, like to stop the music if this is the case.
So, within our crash function…
def crash():
pygame.mixer.Sound.play(crash_sound)
pygame.mixer.music.stop()
largeText = pygame.font.SysFont("comicsansms",115)
TextSurf, TextRect = text_objects("You Crashed", largeText)
Above, calling PyGame to play the crash_sound, as well as to stop the music.
This means the music will start over again if the game is re-played.
Now, the only other thing to do is learn how to pause/unpause music when the
player pauses the game. This is easy enough.
def unpause():
global pause
pygame.mixer.music.unpause()
pause = False
4.DESIGN
Examining complex processes is never an easy task; thus, approaches that try
to divide such complexity into smaller parts that can be more easily understood are
necessary. This is called analysis. Analysing the game design cognition process is a
critical part of developing a deeper understanding about how such process works.
Therefore, proposing the following layered view as a breakdown of the game design
cognitive process, where each layer corresponds to a generalisation or
abstraction of the layers below it, and a specialisation or concretisation of the layers
above it.
Therefore, the game concept is the topmost layer of our proposed architecture,
tying all the other layers together into cohesive game design.As an example of a game
with a strong concept behind it, let's take a look at Blizzard's blockbuster Diablo. The
game could be described as “a fantasy role-playing game with a strong focus on hack-
and-slash action, item collection and dungeon exploration”.
The whole game has been constructed around this concept, such that items
with increasing power both allow and drive the player to explore the dungeon deeper
and deeper, killing more and more monsters to get another, even more powerful item,
and so on.
Context Layer
The context of a game, as far as the proposed architecture is concerned,
comprises the story, circumstances and motivation presented to the player. Why must
the player do what he is doing? Does he have to save the princess from the castle or
must he save the world from an alien invasion? The context does not have to be story-
driven, but it must define a more concrete view of the game that the players can easily
refer to.
Contents of a game are basically what players see and most often can touch
inside the game space. The player's avatar itself is game content, together with any
other characters, weapons, items, scenario objects, etc., that are there for the player to
interact with, using the game system. We can think of content as the concretisation of
the game from the perspective of the player.
Features, on the other hand, are the mid-level description of gameplay, often
represented as use cases (“squad control”, ”vehicle riding”) and broad system
descriptions (“price fluctuation”, “real-time cloth physics”), which comprise the
different ways in which the player can touch the game or be touched by it. They also
define the nature of the player's interaction, in terms of the feedback perceived by the
player from his actions in the game world (“destructible environments”, “believable
emotional NPCs”).
intended to do). Game mechanics must be designed to be the gears that spin under the
hood; all the player must do is step on the gas and feel the car moving. He does not
need to understand how the engine works to be able to drive.
Verbs are related to specific game states, that define which verbs are available
to the player at any given moment. For example, if “in car” is a game state for Grand
Theft Auto, “accelerate” and “brake” might be some of the available game verbs, as
“shoot” and “reload” would be verbs for the “weapon drawn” game state
All the modules are connected to main module and the execution of program
starts from main module . Few classes are dependent on each other for their
execution.
Upon the keys or action performed by the user or the gamer the score is
calculated by the computer and the result is displayed .
Incase the car goes out of bound or game is completed you can restart the game and
the gamer can quit game by pressing Q .The Score displayed depends upon the score
calculated .
Another way of expressing a use case diagram of race and track where in it
describes the action of the car such as moving ,stopping and completing game .
The Game completes as soon the timer stops and the game should start at the
start of timer .
4.2.5 FLOWCHART
The fundamental running order of car racing game is simply demonstrated as
following flowchart.
The Start of the game is from user side and its end also from user side .
(Figure G)
Player
Maps
Camera
Direction
Game Mode
Time out
Tracks
Main
Bounds
Loader
Menu
Traffic
Most of the above modules are mandatory for the functioning of the game .Few
module are optional they are meant adding additional functionality and creativity to
game .
Main Module :- This is the module from where the execution of the program starts ,
all the modules are imported into this main module , the type of user input is verified
here and the required function is called . It checks for input given by user during the
menu . It is responsible for the loading the maps ,cars and others images shown by
calling the function of the required modules.
Maps Module:- This module is responsible for loading the map images ,mapping to
tiles and realigning maps according to user turns . It is a module where in the code is
available free to use in the internet .
Player Module:- This module is responsible for rotating the car ,find the residing
location of he car in the map , emitting or demmiting tracks , accelerating /
decelerating ,steering the car the left and right and to decrease the speed on impact .
Traffic Module:- This is a module which is responsible for the traffic creation in the
game .The number of cars ,their speeds can be increased or decreased .This module is
also responsible for the AI control of the cars in the maps .
Time out Module:- This module is responsible for loading the time out image after
the gamer has exceeded the time given to him/her.
Menu Module:- This module is used for responsible for loading the menu image
during the initial starting of the game.
Camera Module:- This module is responsible for keeping tracking track of the
coordinates of the car when moving in the maps .
Loader Module:- This module is used for loading the image and media use for the
game . It is used for assigning the path of the media.
Bounds Module:- It is used for showing the alert message when the car is out of the
bounds of the map . It is used for checking whether the car is in the bounds of the map
or not and it is used to send alert when the car is out of bounds.
Direction Module:- Thos module is used for showing the player where to find the
violet flag in the map . It is used for rotating the arrow to indicate the location of the
flag and updating the arrow according to the location of the flag.
Gamemode Module:- This module is used for calculating the points the player
gained upon the actions he/she performed . The player gains points when the player
collects the violet flag . The points the player gains is equal to 15 . If the player has
crashed into another vehicle 2 points are deducted . Upon the end of the game the
variable are again initialised to initial values.
5.TESTING
Testing plays an important role in every development step of a game. A game
testing is done at different levels of development process to detect various defects and
bugs. Including test cases, there are many unconventional methods involved in
finding bugs.
Exploratory testing: Game testers play games like the regular end users do, to find
bugs and defects. Different testers have various ways and approach to play the
game that helps in discovering bugs or defects.
Break the rules: Do not follow the same set of instructions every time while
testing. Go beyond the scope of test cases to find potential vulnerability or defect
and choose different ways to achieve the same result
Use all functions everywhere: Try to use all functions even at every stage even if
it is not of any use at that point.
Try things that are not allowed: Press buttons rapidly at different places. Before
finishing level retrace steps and check the result
Examine Effects: Try playing games with minimum inputs or minimum user
actions. Similarly, try playing games with maximum inputs. Try to walk through
walls, obstructions or objects and examine the effects
Test cases: Production or development team suggests testers the specific areas of a
game that needs to be tested. Testers follow test cases given by the development
team and complete each action as per given directions.
Functionality testing: Test menu and every menu function, and assure that it is
working correctly.
Durability testing: Test for odd situations like load game without a memory card,
run the game for 48 hours and check how game respond
Appoint different testers for the same job: If a same tester is performing test cases
over and over for every new build, then the person may lose enthusiasm and focus.
This can lead to missed defects or bugs. New testers will start work with a new
point of view and can find new bugs if any. Always rotate testers to get best results.
Performance Testing:A game with incredible graphics and features may still fail to
satisfy a player if the game is too slow or freeze up at certain levels. The critical
success factor of a game is its underlying development and testing. For this, run a
game without pause or keep on increasing the number of players if it is a multi-
player game.
Running such tests would give you data on how the performance is at high load and if
there is any bugs detected. If the results show performance issues, then it means that
your game has bugs that need to be fixed.
Crash or Hang: If game suddenly freezes or closes, then it is a very important bug
that slows down the development process.
Game Play defects: When a particular feature is not doing its intended function, it
is said to be a game play defect
Text: wrong, missing or wrongly spelled text, text extending out of the textbox
Sound: missing or wrong sound effects, lip sync not matching sound
There are many more similar defects which can be found in peripherals, dialogues,
loading games, networks, consumer rating, etc.
6. SCREEN OUTPUTS
1.Initial display of the game the program has been ruined or executed for the main
module .
(Figure H)
2.After the gamer has entered the M key on the keyboard the game starts.
(Figure I)
3.The gamer can reach his goal by analysis the position of pink flag by taking help of
pink arrow on the bottom right of the screen.
(Figure J)
4.The user should reach the pink trophy by avoiding the collision from cars on his/her
way and take turns with precision and care
(Figure K)
5.The user is supposed to take a U turn when observes a dead and should take
necessary efforts to avoid collision and collision leads to deduction in the score by 4.
Negative score is also valid
(Figure L)
6.The user should collect as many as pink trophies possible to score +15 for each
pink trophy
(Figure M).
7.At end of the timer .The screen shows game over menu and shows score calculated
after collecting trophies and considering collision .You can either continue the game
by restarting or Exit by pressing Q.
(Figure N)
1. Improves coordination
When an adult or child is playing a video game, he or she is not only staring at
the computer inactively. The activities and actions on the screen provide a lot of
mental stimulation. For one to play, he or she will need to coordinate their visual,
audial and physical movement.
3. Enhances memory
Playing your favourite video game may require both visual and audial
memory. The player is required to read or listen to the instructions which might only
be provided at the beginning of the game, thus the need to remember them throughout
the entire game. Mastery of the keys on your keyboard helps you easily move your
characters in the game. This helps improve your memory, whether short- term or long-
term.
Talk about gamers in the 21st century and you’re probably referring to those
who play games on computer systems, a medium which has all but replaced formats
such as board games and pen-and-paper role-playing games. While some people
suggest playing games on a computer can aid in the development of skills such as
improving reflexes, critics point out some disadvantages.
General Health
Spending a long period of time playing at a computer can have detrimental
effects on your health. For a start, you're sitting in one position, pressing the same
buttons repeatedly, which can lead to hand and eye strain. A long game session can
leave you physically tired, affecting your performance at school or work; overall, this
could result in lower personal attainment.
Epilepsy
Computer games can trigger epileptic attacks in sufferers who play, which can
be extremely dangerous. Often, such an attack is a result of flashing images contained
in the game. However, according to “The Effect of Video-game Software in Video-
game Epilepsy” by S. Ricci et al., attacks can also result from emotional excitement
or sleep deprivation which stems from playing these games.
Aggressive Behaviour
Some critics of computer gaming have pointed toward the violent content of
some games, such as the “Grand Theft Auto” series, as being a factor in influencing
players toward aggressive action and attitudes in real life. Researchers from the
University of Missouri-Columbia found a causal link between game playing and
aggression after studying the brain patterns of 39 gamers. Critics also fear that gamers
become desensitised to violence as a result of what they see on computer screens.
High Cost
The cost of computer gaming can fluctuate based on how many games you buy and
the type of titles you like to play, but with new games costing as much as $60, gaming
can be a pricey hobby. A larger expense can come in the form of the computer
upgrades needed to run the most recent games; for example, you might need to
purchase a new graphics card, costing around $60 or $70.
9.CONCLUSION
Therefore by using the language python , IDE PyCharm and IDLE , the
python libraries such as pygame for multimedia and sound the game has been created
and is functioning to the level that it meets its objective .The Game worked on
different OS and different Specification computers and delivered the same
performance on all . There may be some areas of improvements and efficiency which
will be carried out in future.
10.FUTURE WORKS
This project or game takes in consideration that all cars move at same speed in
every situation and the game has same kind of automobiles all round ,this situation is
not same in the real world . In the real world there are cars ,trucks ,2 wheelers and
others automobiles moving at different speeds .This project has background music
associated with the game but we can add sound of collision ,acceleration in the car to
make more real and entertaining .Multiplayer can also be implemented wherein the
player who collects more pink flags is considered the winner.
11.BIBLIOGRAPHY
https://pythonprogramming.net/adding-sounds-music-pygame/
https://www.python.org
http://www.gamasutra.com
https://www.pygame.org/docs/
https://en.wikipedia.org/wiki/Pygame
https://www.jetbrains.com
https://stackoverflow.com/questions/1347791/unicode-error-unicodeescape-codec-
cant-decode-bytes-cannot-open-text-file
https://www.testbytes.net/blog/bugs-in-game-testing/
Author: Bill Lubanovic, Introducing Python: Modern Computing in Simple
Packages , Publisher: Shroff/O'Reilly; First edition (1 December 2014)