0% found this document useful (0 votes)
30 views

Doom Game

Uploaded by

FAWAZ KM
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Doom Game

Uploaded by

FAWAZ KM
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

A PROJECT REPORT ON SOFTWARE

FOR DOOM GAME

SUBMITTED TO
ASSISI
CENTRAL SCHOOL

Submitted By:-
Project Guide:-
K.M Fawaz Mr.vineeth
SOFTWARE
FOR
DOOM GAME

Tools Used

Front End:- PYTHON


Back End:- PYGAME

Developed At
ASSISI CENTRAL SCHOOL
CERTIFICATE

This to certify that the project report entitled “DOOMS DAY GAME”
submitted by KM FAWAZ SRduring the academic year 2022-2023 is a bonafied piece
of work conducted under my supervision and guidance. The data sources have been
duly acknowledged.
I wish him/her success in all his/her future endeavours.

SUPERVISED BY

(Principal)
Sr.Shanti willma d almeda (ProjectGuide)
Mr. vineeth
PREFACE
PREFACE

The computers have gained a lot of importance in the past five


decades. Most of our day-to-day jobs are being influenced by the
use of computers. Now a day, computers are used for performing
almost every function, which were performed by humans in the past.
In some areas such as science and technology, targets can’t be
achieved without the use of computers. The characteristics that
make the computer so important include its extra ordinary speed,
large storage capacity, accuracy and consistency.

Today computers play a great role in various industries and a


large number of industries are using computers for various
application such as maintaining cashbook, sales book, purchase
book and other books of accounts. Computers can also be used for
the designing of various products. Computers provide many options
for the designing of products.

The analysis of the project has been undertaken with utmost


sincerity and honesty and we will be extremely satisfied if the effort
is appreciated.
DEDICATION
DEDICATION

Dedicated
To
The brave hero’s of my country who sacrificed their lives for freedom, security and
integrity of mother India, upkeeping the honour of our tricolor.
Their family members who suffered for our future.
My dear parents and my respected teachers.
INDEX
INDEX

1. Acknowledgement

2. Requirements Analysis

3. Feasibility Study

4. Coding

5. Output Screen

6. System Specifications

7. Bibliography
ACKNOWLEDGEMENT
ACKNOWLEDGEMENT

I take this opportunity to express my profound sense of gratitude and


respect to all those who helped me throughout this venture.

I owe my regards to Sr. Wilma D.Almeda Principal of my School for


her cooperation and valuable support and for giving us the
opportunity to undertake this project work and providing the
necessary infrastructure.

I would like to express my heartfelt thanks to my revered teacher


Mr.Vineeth for his valuable guidance, encouragement and support
throughout my Dedication under herat the institute. This project is his
visualization and owes a lot of its functionality to her.

Last but not the least, I owe my overwhelming gratitude to my family


and friends who gave me constant support and motivation to continue
with this endeavour.

K.M Fawaz
REQUIRMENT ANALYSIS
Proposed system

Made for entertainment purpose and help to reduce stress :)

Benefits Of Purposed System:-


1. No Age-Restriction

Everyone can access to this game and play at anytime .

2. Benefits

Enhances human eye-hand coordination and improve multi-tasking skills.

Reduces stress and depression and improve mood and feel relaxed .

3. Free to play

U don’t have to pay to play u can easily get it from and web or store.

4. How to download

First download the game rar file for web and u need to extract the file then u need to
run main.py file and you are ready to play.

5. Data-connection

No network is required to run the game this is a offline game u can play anywhere at
anytime.

6. User-friendly Software

The Game is easily accessible and is very easy to use.

7. Flexibility

The system is more flexible than the manual system being used presently.

8. How to play

W|A|S|D keys is used for movement of player and left click is used for firing
FEASIBILITY STUDY
FEASIBILITY STUDY

During the course of completion of this project work, the complete analysis of proposed
system was done. In the analysis task, a complete care about the feasibility of the proposed
system was taken. The following feasibility analyses were carried out during the course of
this project work on call management system for customer care:

1. Economical feasibility
2. Technical feasibility
3. Operational feasibility

Economical Feasibility:-
Economic analysis is the most frequently used method for evaluating the effectiveness
of a candidate system. The proposed system is economically feasible because the benefits
and the savings that are expected from a candidate system outweigh the cost incurred. In
this case we are getting the intangible benefits in terms of low cost of maintenance of data,
less redundancy and getting the quick results.

Technical Feasibility:-

The existing Hardware and Software facilities support the proposed system. Computer
and storage media are available and software can be developed.

Hardware configuration:
a) Processor : intel pentinium gold
b) Memory : 2 GB RAM
c) HD capacity : 128 gb

Software configuration:-
a) Operating system : Windows 7,10
b) Back end : pygame
c) Front end : Python
There is nothing which is not technically feasible.
Operational feasibility:-

As in the case of present system the entire work is being done manually. So the data
being scattered, information retrieval becomes difficult and maintaining database is also very
tedious. In case of proposed system, entire work will be done automatically. So the above
details regarding the feasibility study show that the design of the proposed system is very
effective.
CODING
import pygame as pg

import math

from settings import *

class RayCasting:

def __init__(self, game):

self.game = game

self.ray_casting_result = []

self.objects_to_render = []

self.textures = self.game.object_renderer.wall_textures

def get_objects_to_render(self):

self.objects_to_render = []

for ray, values in enumerate(self.ray_casting_result):

depth, proj_height, texture, offset = values

import pygame as pg

import math

from settings import *

class RayCasting:
def __init__(self, game):

self.game = game

self.ray_casting_result = []

self.objects_to_render = []

self.textures = self.game.object_renderer.wall_tex tures

def get_objects_to_render(self):

self.objects_to_render = []

for ray, values in enumerate(self.ray_casting_result):

depth, proj_height, texture, offset = values

if proj_height < HEIGHT:

wall_column = self.textures[texture].subsurfa ce(

offset * (TEXTURE_SIZE - SCALE), 0, SCALE,


TEXTURE_SIZE

wall_column = pg.transform.scale(wall_column, (SCALE,


proj_height))

wall_pos = (ray * SCALE, HALF_HEIGHT - proj_height //


2)import pygame as pg

import math

from settings import *

class RayCasting:

def __init__(self, game):


self.game = game

self.ray_casting_result = []

self.objects_to_render = []

self.textures = self.game.object_renderer.wall_ textures

def get_objects_to_render(self):

self.objects_to_render = []

for ray, values in enumerate(self.ray_casting_result):

depth, proj_height, texture, offset = values

import pygame as pg

import math

from settings import *

class RayCasting:

def __init__(self, game):

self.game = game

self.ray_casting_result = []

self.objects_to_render = []

self.textures = self.game.object_renderer.wall_textures

def get_objects_to_render(self):

self.objects_to_render = []
for ray, values in enumerate(self.ray_casting_result):

depth, proj_height, texture, offset = values

if proj_height < HEIGHT:

else:

texture_height = TEXTURE_SIZE * HEIGHT / proj_height

wall_column = self.textures[texture].subsurface(

offset * (TEXTURE_SIZE - SCALE), HALF_TEXTURE_SIZE -


texture_height // 2,

SCALE, texture_height

wall_column = pg.transform.scale(wall_column, (SCALE,


HEIGHT))

wall_pos = (ray * SCALE, 0)

self.objects_to_render.append((depth, wall_column, wall_pos))

def ray_cast(self):

self.ray_casting_result = []

texture_vert, texture_hor = 1, 1

ox, oy = self.game.player.pos

x_map, y_map = self.game.player.map_pos

ray_angle = self.game.player.angle - HALF_FOV + 0.0001


for ray in range(NUM_RAYS):

sin_a = math.sin(ray_angle)

cos_a = math.cos(ray_angle)

# horizontals

y_hor, dy = (y_map + 1, 1) if sin_a > 0 else (y_map - 1e-6, -


1)

depth_hor = (y_hor - oy) / sin_a

x_hor = ox + depth_hor * cos_a

delta_depth = dy / sin_a

dx = delta_depth * cos_a

for i in range(MAX_DEPTH):

tile_hor = int(x_hor), int(y_hor)

if tile_hor in self.game.map.world_map:

texture_hor = self.game.map.world_map[ tile_hor]

break

x_hor += dx

y_hor += dy

depth_hor += delta_depth

# verticals
x_vert, dx = (x_map + 1, 1) if cos_a > 0 el se (x_map - 1e-6,
-1)

depth_vert = (x_vert - ox) / cos_a

y_vert = oy + depth_vert * sin_a

delta_depth = dx / cos_a

dy = delta_depth * sin_a

for i in range(MAX_DEPTH):

tile_vert = int(x_vert), int(y_vert)

if tile_vert in self.game.map.world_map:

texture_vert = self.game.map.world_map[tile_vert]

break

x_vert += dx

y_vert += dy

depth_vert += delta_depth

# depth, texture offset

if depth_vert < depth_hor:

depth, texture = depth_vert, texture_vert

y_vert %= 1

offset = y_vert if cos_a > 0 else (1 - y_vert)

else:

depth, texture = depth_hor, texture_hor


x_hor %= 1

offset = (1 - x_hor) if sin_a > 0 else x_hor

# remove fishbowl effect

depth *= math.cos(self.game.player.angle - ray_angle)

# projection

proj_height = SCREEN_DIST / (depth + 0.0001)

# ray casting result

self.ray_casting_result.append((depth, proj_he ight, texture,


offset))

ray_angle += DELTA_ANGLE

def update(self):

self.ray_cast()

self.get_objects_to_render()
import math

# game settings

#RES = WIDTH, HEIGHT = 1600, 900

RES = WIDTH, HEIGHT = 1920, 1080

HALF_WIDTH = WIDTH // 2

HALF_HEIGHT = HEIGHT // 2

FPS = 0

PLAYER_POS = 1.5, 5 # mini_map

PLAYER_ANGLE = 0

PLAYER_SPEED = 0.004

PLAYER_ROT_SPEED = 0.002

PLAYER_SIZE_SCALE = 60

PLAYER_MAX_HEALTH = 150

MOUSE_SENSITIVITY = 0.0002

MOUSE_MAX_REL = 40

MOUSE_BORDER_LEFT = 100

MOUSE_BORDER_RIGHT = WIDTH - MOUSE_BORDER_LEFT

FLOOR_COLOR = (30, 30, 30)

FOV = math.pi / 3
HALF_FOV = FOV / 2

NUM_RAYS = WIDTH // 2

HALF_NUM_RAYS = NUM_RAYS // 2

DELTA_ANGLE = FOV / NUM_RAYS

MAX_DEPTH = 20

SCREEN_DIST = HALF_WIDTH / math.tan(HALF_FOV)

SCALE = WIDTH // NUM_RAYS

TEXTURE_SIZE = 256

HALF_TEXTURE_SIZE = TEXTURE_SIZE // 2
SYSTEM SPECIFICATIONS
SYSTEM SPECIFICATIONS

HARDWARE SPECIFICATIONS
The following is the hardware specification of the system on which the software has
been developed:-

Operating System : Windows 7/10/11

Machine Used : i3-1005G1 Processor 2.6 GHz, 8 GB RAM,1 TB Hard Disk

SOFTWARE SPECIFICATIONS
Front End Used : Python

Backend Used : pygame


BIBLIOGRAPHY
BIBLIOGRAPHY

• SUMITHA ARORA – COMPUTER SCIENCE WITH


PYTHON-CLASS XI
• W3Schools.com
• Python.org
• YOUTUBE :- Coder space
OUTPUT SCREENS

You might also like