Programmers only

Space pilot

ET phone home
Floater
Man on the Moon
Registered
So I made this Chrome dinosaur game but I wanted to add point counter and and death of dinosaur after touching cactus.
So please help me.

HTML:
<!DOCTYPE html>
<html lang="en" onclick="jump()">
<head>
    <meta charset="UTF-8">
    <title>Dinosaur game by SP :P</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="game">
        <div id="dinosaur"></div>
        <div id="cactus"></div>
    </div>
    <p>point: <span id="point"></span></p>
    <canvas id="game" width="500" height="410"></canvas>     <p>Click on screen to jump</p>
</body>
<script src="script.js"></script>
</html>

JavaScript:
var dinosaur = document.getElementById("dinosaur");
var cactus = document.getElementById("block");
var counter=0;
function jump(){
    dinosaur.classList.add("animate");
    setTimeout(function(){
        dinosaur.classList.remove
("animate");},300);
}

CSS:
*{
    padding: 0;
    margin: 0;
    overflow-x: hidden;
}
.game{
    width: 500px;
    height: 200px;
    border: 1px solid black;
    margin: auto;
}
#dinosaur{
    width: 20px;
    height: 50px;
    background-color: #DC0A0A;
    position:relative;
    top: 150px;
}
.animate{
    animation: jump 0.3s linear;
}
@keyframes jump{
    0%{top: 150px;}
    30%{top: 100px;}
    70%{top: 100px;}
    100%{top: 150px;}
}

#cactus{
    background-color: #14920F;
    width: 20px;
    height: 20px;
    position: relative;
    top: 130px;
    left: 500px;
    animation: block 1s infinite linear;
}
@keyframes block{
    0%{left: 500px}
    100%{left: -20px}
}
p{
    text-align: center;
}
 

Attachments

bobbblair123

ሁልጊዜ ንጹህ የውስጥ ሱሪዎችን ይልበሱ
TEAM HAWK
Swingin' on a Star
Atlas
Fly me to the Moon
Under Pressure
Registered
So I made this Chrome dinosaur game but I wanted to add point counter and and death of dinosaur after touching cactus.
So please help me.

HTML:
<!DOCTYPE html>
<html lang="en" onclick="jump()">
<head>
    <meta charset="UTF-8">
    <title>Dinosaur game by SP :P</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="game">
        <div id="dinosaur"></div>
        <div id="cactus"></div>
    </div>
    <p>point: <span id="point"></span></p>
    <canvas id="game" width="500" height="410"></canvas>     <p>Click on screen to jump</p>
</body>
<script src="script.js"></script>
</html>

JavaScript:
var dinosaur = document.getElementById("dinosaur");
var cactus = document.getElementById("block");
var counter=0;
function jump(){
    dinosaur.classList.add("animate");
    setTimeout(function(){
        dinosaur.classList.remove
("animate");},300);
}

CSS:
*{
    padding: 0;
    margin: 0;
    overflow-x: hidden;
}
.game{
    width: 500px;
    height: 200px;
    border: 1px solid black;
    margin: auto;
}
#dinosaur{
    width: 20px;
    height: 50px;
    background-color: #DC0A0A;
    position:relative;
    top: 150px;
}
.animate{
    animation: jump 0.3s linear;
}
@keyframes jump{
    0%{top: 150px;}
    30%{top: 100px;}
    70%{top: 100px;}
    100%{top: 150px;}
}

#cactus{
    background-color: #14920F;
    width: 20px;
    height: 20px;
    position: relative;
    top: 130px;
    left: 500px;
    animation: block 1s infinite linear;
}
@keyframes block{
    0%{left: 500px}
    100%{left: -20px}
}
p{
    text-align: center;
}
Nice! Mars Pathfinder will you show us yours? I'll see what I can do to:)
 

bobbblair123

ሁልጊዜ ንጹህ የውስጥ ሱሪዎችን ይልበሱ
TEAM HAWK
Swingin' on a Star
Atlas
Fly me to the Moon
Under Pressure
Registered
Space pilot
What's up?
I smooth forgot. I've started. I have my Knight, now I have to make a dragon that will move randomly and if the 2 occupy the same spot knight gets BBQed but if the knight gets into a location adjacent and diagonal to the dragon BOOM for the dragon.:eek::D damnit. Won't let me load a .pdf file
Anyone know why I can't load a .pdf or .docx file?
 

Attachments

Last edited:

Mars Pathfinder

«★★» CMDR «★★» // PT // FartFinder
Christmas Event Category Winner
TEAM HAWK
Swingin' on a Star
Atlas
Deja Vu
Fly me to the Moon
Under Pressure
Registered

Space pilot

ET phone home
Floater
Man on the Moon
Registered
Space pilot
What's up?
I smooth forgot. I've started. I have my Knight, now I have to make a dragon that will move randomly and if the 2 occupy the same spot knight gets BBQed but if the knight gets into a location adjacent and diagonal to the dragon BOOM for the dragon.:eek::D damnit. Won't let me load a .pdf file
Anyone know why I can't load a .pdf or .docx file?
Where to paste this code ??
 

Sheepy

Planet Sculptor
Biker Mice from Mars
ET phone home
Registered
C# flight controller that I am changing to add throttle and crash effects and maybe stall and some other things (I used a 7 year old unity tutorial for the base to help me get started with C# but I am changing it to be more up to date)
Edit: It seems videos don't show up like images and it's a download
 

Attachments

Space pilot

ET phone home
Floater
Man on the Moon
Registered
C# flight controller that I am changing to add throttle and crash effects and maybe stall and some other things (I used a 7 year old unity tutorial for the base to help me get started with C# but I am changing it to be more up to date)
Edit: It seems videos don't show up like images and it's a download
IMG_20210504_093506.jpg
 

Space pilot

ET phone home
Floater
Man on the Moon
Registered
Umm
Gta sa is about to finish second time
I killed ender dragon ~30 times:cool:

Now I'm back to coding after 8monthso_O

Let's start with style simple html


IMG_20210825_131201.jpg
IMG_20210825_131222.jpg

For now I'm just doing this simple x100 coding
Cus I don't trust space pilot