Mini - Project - Format - by Aryan Panwar
Mini - Project - Format - by Aryan Panwar
Session: 2020-2021
Submitted to-
Submitted by
Student Name – Yashi Sharma and Shivam Roll No. –
1900680130062 and 1900680130046
3 RD SEMESTER
DEPARTMENT OF INFORMATION TECHNOLOGY
MEERUT INSTITUTE OF ENGINEERING AND TECHNOLOGY, MEERUT
DECLARATION
We hereby declare that the project entitled - “I-dragon JavaScript game”, which is being submitted
as Mini Project in department of Information Technology to Meerut Institute of Engineering and
Technology, Meerut (U.P.) is an authentic record of our genuine work done under the guidance of
Prof. “ ” of Information Technology, Meerut Institute of Engineering and
Technology, Meerut.
This is to certify that mini project report entitled – “I-dragon JavaScript game” submitted by
“Yashi and Shivam” has been carried out under the guidance of Prof. “ ” of
Information Technology, Meerut Institute of Engineering and Technology, Meerut. This project
report is approved for Mini Project (KCN 354) in 3 rd semester in “department name” from
Meerut Institute of Engineering and Technology, Meerut.
Internal Examiner
Date:
ACKNOWLEDGEMENT
I would also like to thank to our HoD Dr. (Prof.) “Swati Sharma”, Department of Computer
Science and engineering, Meerut Institute of Engineering and Technology, Meerut for his expert
advice and counseling from time to time.
I owe sincere thanks to all the faculty members in the department of Information Technology for
their kind guidance and encouragement time to time.
Introduction
References
1)Introduction
In the world of software development, what’s built falls into two
categories: everything that’s seen by the user and the processes
happening in the background. What we see and interact with as
the visitors of a website, or as the end user of a mobile app, is
considered front-end technology. All the behind-the-scenes
activity that delivers the data and the speed with which that data
is delivered falls into back end Technology and DevOPs.
By using all this, I have created an Animated- Game in which Html work
as the structure of the game by using tags, links etc to create the body of
the game and
CSS designs the layout, topology, animations, image positions, font style, font
weight, margin, padding etc and
JavaScript help to control audio, onclick events, duration of animation, time
intervals etc.
2) System Design
3) Technology Bucket
3.1 Description of HTML
HTML (HyperText Markup Language) is the most basic building
block of the Web. It defines the meaning and structure of web
content. Other technologies besides HTML are generally used to
describe a web page's
appearance/presentation (CSS) or functionality/behavior
(JavaScript).
<html>
<head>
<title>Page Title</title>
</head>
<body>
</html>
.
3.2 Description Of CSS
This section is dedicated to the JavaScript language itself, and not the parts
that are specific to Web pages or other host environments. For information
about API specifics to Web pages, please see Web APIs and DOM.
The standard for JavaScript is ECMAScript. As of 2012, all modern
browsers fully support ECMAScript 5.1. Older browsers support at least
ECMAScript 3. On June 17, 2015, ECMA International published the sixth
major version of ECMAScript, which is officially called
ECMAScript 2015, and was initially referred to as ECMAScript 6 or ES6.
Since then, ECMAScript standards are on yearly release cycles. This
documentation refers to the latest draft version, which is currently
ECMAScript 2020.
In <head> or <body>
You can place any number of scripts in an HTML document. Scripts can be placed in
the <body>, or in the <head> section of an HTML page, or in both.
Syntax :-
OR
External scripts are practical when the same code is used in many different web p
ages.JavaScript files have the file extension .js.To use an external script, put the name of
the script file in the src (source) attribute of a <script> tag:
Syntax:-
<script src="myScript.js"></script>
4) Output Screen
1) It starts with a welcome to I-dragon adventure, where one person
walking on path and tries to jump above the obstacle without
touching it, which is coming towards the person and moves
forward with the increase in scores.
2) When the person Jump and moves itself in forward and backward
direction using keyboard keys, there will be an increase in score as
well as in the speed of the obstacle as time passes.
3) When person hit the obstacle, the score board and obstacle stop and
Game over appears with the stop audio. To restart the game, click
refresh icon.
5) Implementation Code
Code :- HTML
<!DOCTYPE html >
<html lang = "en" >
<head>
<meta charset = "UTF-8" >
<meta name = "viewport" content = "width=device-width, initial-
scale=1.0" >
<title> iDragon - JavaScript Game </title>
<link href
=
"https://fonts.googleapis.com/css2?family=Ubuntu:wg ht@300&display=swap"
rel = "stylesheet" >
<link rel = "stylesheet" href = "style.css"
> <script src = "script.js" ></script>
</head>
<body>
<div class = "gameContainer" >
<div class = "gameOver" > Welcome to iDragon
Adventures </div>
<!-- <div class="gameOver">Welcome to iDragon -
Created by Harry</div> -->
<div class = "dino" ></div>
<div id = "scoreCont" > Your Score: 0 </div>
<div class = "obstacle obstacleAni" ></div>
</div>
</body>
</html>
cross = true ;
setTimeout(() => {
audio.play() },
1000 );
if (e.keyCode == 38 ) {
dino.classList.add( 'animateDino' );
setTimeout(() => {
if (e.keyCode == 39 ) {
if (e.keyCode == 37 ) {
setInterval(() => {
ox = parseInt(window.getComputedStyle(obstacle,
null ).getPropertyValue( 'left' ));
oy = parseInt(window.getComputedStyle(obstacle, null
).getPropertyValue( 'top' ));
offsetX = Math.abs(dx - ox);
// console.log(offsetX, offsetY)
setTimeout(() => {
audiogo.pause();
audio.pause();
}, 1000 );
}
else if (offsetX < 145 && cross) {
score += 1 ;
updateScore(score);
cross = false ;
setTimeout(() => {
cross = true ;
}, 1000 );
setTimeout(() => {
10 );
function updateScore(score) {
padding : 0 ; }
body {
background-color : red ;
overflow : hidden ;
} .gameContainer
background-image : url(bg.png);
background-repeat : no-repeat ;
width : 100% ;
height : 100vh ;
.dino {
background-size : cover ;
width : 233px ;
height : 114px ;
position : absolute ;
bottom : 0 ;
left : 52px ;
.obstacle {
width : 166px ;
height : 113px ;
background-image : url(dragon.png);
background-size : cover ;
position : absolute ;
bottom : 0 ;
left : 44vw ;
.animateDino {
animation : dino 0.6s linear ;
.obstacleAni {
.gameOver {
position : relative ;
top : 63px ;
font-size : 53px ;
text-align : center ;
#scoreCont {
font-size : 25px ;
color : #54212f ;
font-weight : bold ;
position : absolute ;
right : 45px ;
top : 31px ;
padding : 10px ;
border-radius : 10px ;
@keyframes
dino{ 0%{
bottom : 0 ;
}
50%{
bottom : 422px ; }
100%{
bottom : 0 ; }
@keyframes
obstacleAni{ 0%{
left : 100vw ; }
100%{
left : -10vw ; }