-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2629 from priyashuu/master
Endless Runner
- Loading branch information
Showing
12 changed files
with
272 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# Endless Runner Game | ||
|
||
Welcome to the **Endless Runner** game! This is a fun, simple game where you control a chicken navigating through obstacles. The game ends when the chicken collides with an obstacle. | ||
|
||
## Table of Contents | ||
|
||
- [Features](#features) | ||
- [Demo](#demo) | ||
- [Installation](#installation) | ||
- [Usage](#usage) | ||
- [Contributing](#contributing) | ||
- [License](#license) | ||
- [Acknowledgments](#acknowledgments) | ||
|
||
## Features | ||
|
||
- **Dynamic Gameplay**: Navigate a chicken through obstacles. | ||
- **Jump Mechanics**: Jump to avoid obstacles. | ||
- **Responsive Design**: Adapts to different screen sizes. | ||
- **Scoring System**: Displays score when the game ends. | ||
- **Background Animation**: Dynamic background for a better visual experience. | ||
|
||
## Demo | ||
|
||
![Endless Runner Demo](path_to_your_demo_image.gif) | ||
|
||
You can play the game live [here](link_to_your_live_demo). | ||
|
||
## Installation | ||
|
||
To set up and run the Endless Runner game locally: | ||
|
||
1. **Clone the repository**: | ||
```bash | ||
git clone https://github.com/yourusername/endless-runner.git | ||
``` | ||
|
||
2. **Navigate to the project directory**: | ||
```bash | ||
cd endless-runner | ||
``` | ||
|
||
3. **Open `index.html` in your web browser**: | ||
Simply open the `index.html` file to start playing the game. | ||
|
||
## Usage | ||
|
||
- **Jump**: Click anywhere on the page to make the chicken jump and avoid obstacles. | ||
- **Score**: The game displays your score when the chicken collides with an obstacle. | ||
|
||
## Contributing | ||
|
||
We welcome contributions to improve the Endless Runner game. To contribute: | ||
|
||
1. **Fork the repository**. | ||
2. **Create a new branch**: | ||
```bash | ||
git checkout -b feature-branch | ||
``` | ||
3. **Commit your changes**: | ||
```bash | ||
git commit -m 'Add new feature' | ||
``` | ||
4. **Push to the branch**: | ||
```bash | ||
git push origin feature-branch | ||
``` | ||
5. **Create a Pull Request**. | ||
|
||
Please make sure to follow the existing coding style and write tests for any new features or fixes. | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. | ||
. | ||
|
||
## Contact | ||
|
||
For any questions or feedback, feel free to contact me at [[email protected]]. | ||
|
||
--- | ||
|
||
Happy coding and enjoy the game! |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+45.8 KB
Endless Runner/images/one-piece-desktop-kids-running-b5b3kgp79e5rebgg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.11 KB
...lipart-chicken-pou-pro-chicken-pou-pro-soccer-bird-chicken-liver-game-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.4 KB
Endless Runner/images/pngtree-game-pixel-scene-with-stone-png-image_2952040.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" onclick="jump()"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>EndlessRunner</title> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
|
||
<body> | ||
<h1>Endless Runner</h1> | ||
<div id="container"> | ||
|
||
<div id="game"> | ||
<img style="position: absolute;opacity: .6; width: 350px; height: 250px; " src="images/sky2.jpg" alt=""> | ||
<img style="position: absolute; left:350px;opacity: .6; width: 350px; height: 270px; " src="images/sky.jpg" | ||
alt="kop"> | ||
<div id="chicken"> | ||
<img src="images/png-clipart-chicken-pou-pro-chicken-pou-pro-soccer-bird-chicken-liver-game-white.png" | ||
width="60px" height="60px"> | ||
</div> | ||
<div id="obstacle"> | ||
<img src="images/images.jpeg" width="50px" height="50px" alt=""> | ||
|
||
</div> | ||
</div> | ||
<div id="ground"> | ||
<img src="images/pngtree-game-pixel-scene-with-stone-png-image_2952040.jpg" width="700px" height="50px" > | ||
</div> | ||
</div> | ||
<p>© 2024 Priya Ashu.</p> | ||
</body> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js" | ||
integrity="sha512-7eHRwcbYkK4d9g/6tD/mhkf++eoTHwpNM9woBxtPUBWm67zeAfFC+HrdoE2GanKeocly/VxeLvIqwvCdk7qScg==" | ||
crossorigin="anonymous" referrerpolicy="no-referrer"></script> | ||
<script src="script.js"></script> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
var chicken=document.getElementById("chicken"); | ||
var obstacle=document.getElementById("obstacle"); | ||
var counter=0; | ||
|
||
function jump(){ | ||
if (chicken.classList !="animate"){ | ||
chicken.classList.add("animate"); | ||
} | ||
setTimeout(function(){ | ||
chicken.classList.remove("animate"); | ||
},500) | ||
counter++; | ||
} | ||
var lose =setInterval(function(){ | ||
var chickenTop = | ||
parseInt(window.getComputedStyle(chicken). | ||
getPropertyValue("top")); | ||
var blockLeft= | ||
parseInt(window.getComputedStyle(obstacle). | ||
getPropertyValue("left")); | ||
if (blockLeft<20 && blockLeft>0 && chickenTop>=130){ | ||
obstacle.style.animation="none"; | ||
obstacle.style.display="none"; | ||
alert("SCORE:" + counter); | ||
counter = 0; | ||
} | ||
|
||
},10); | ||
var tl=gsap.timeline() | ||
tl.from("h1",{ | ||
y:-50, | ||
opacity:0, | ||
delay:0.4, | ||
duration:0.8, | ||
}) | ||
tl.from("p",{ | ||
y:60, | ||
opacity:0, | ||
duration:0.5, | ||
stagger:0.5, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
body{ | ||
background: url(images/one-piece-desktop-kids-running-b5b3kgp79e5rebgg.jpg); | ||
margin: 0; | ||
padding: 0; | ||
|
||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
/* Replace with your image path */ | ||
background-size: cover; /* Ensures the image covers the entire background */ | ||
background-position: center; /* Centers the image */ | ||
background-repeat: no-repeat; | ||
} | ||
#container{ | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
|
||
background-color: #111; | ||
} | ||
h1{ | ||
text-align: center; | ||
font-size: 50px; | ||
color: #fff; | ||
font-family: 'Arial', sans-serif; | ||
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7); | ||
letter-spacing: 2px; | ||
line-height: 1.2; | ||
margin-bottom: 20px; | ||
padding: 10px 20px; | ||
border-radius: 10px; | ||
background: linear-gradient(45deg, #b7d605, #f09d03); | ||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); | ||
} | ||
#game{ | ||
width:700px; | ||
height:250px; | ||
background-color:#111; | ||
position: relative; | ||
top:50px; | ||
|
||
|
||
|
||
|
||
|
||
} | ||
#chicken{ | ||
width:60px; | ||
height:60px; | ||
background: red; | ||
position:relative; | ||
top:190px; | ||
left:100px; | ||
|
||
} | ||
.animate{ | ||
animation:jump .5s linear 0s; | ||
} | ||
@keyframes jump{ | ||
0%{top:150px}; | ||
30%{top: 100px;} | ||
70%{top: 100px;} | ||
100%{top:100px} | ||
|
||
} | ||
#obstacle{ | ||
width:50px; | ||
height:50px; | ||
background: green; | ||
position: relative; | ||
|
||
top:150px; | ||
left:100%; | ||
animation:block 1.3s infinite linear; | ||
|
||
|
||
} | ||
@keyframes block{ | ||
0%{left:680px;} | ||
100%{left:-50px;} | ||
|
||
} | ||
#ground{ | ||
width:700px; | ||
height:50px; | ||
background: brown; | ||
position: relative; | ||
top:50px; | ||
|
||
} | ||
p{ | ||
color: aliceblue; | ||
text-align: center; | ||
font-size: larger; | ||
margin-top: 100px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
|
||
{ | ||
"manifest_version": 3, | ||
"name": "Guess the Correct Logo", | ||
"description": "Guess the Correct Logo", | ||
"name": "Endless_Runner", | ||
"version": "1.0", | ||
"permissions": [ | ||
"storage", | ||
"declarativeNetRequest", | ||
"declarativeNetRequestWithHostAccess", | ||
"tabs" | ||
], | ||
"host_permissions": [ | ||
"*://*/*" | ||
"storage", | ||
"declarativeNetRequest", | ||
"declarativeNetRequestWithHostAccess", | ||
"tabs" | ||
], | ||
"host_permissions": ["*://*/*"], | ||
"action": { | ||
"default_popup": "index.html" | ||
"default_popup": "index.html" | ||
} | ||
} | ||
} |