Skip to content

added a ninja fight game #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"singleQuote": true,
"semi": false,
"trailingComma": "none",
"overrides": [
{
"files": "*.html",
"options": {
"parser": "html"
}
}
]
}
136 changes: 136 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
<head>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap"
rel="stylesheet"
/>
<style>
body{
background-color: black;
}
* {
box-sizing: border-box;
font-family: 'Press Start 2P', cursive;
}
.f{
display: flex;
justify-content: center;
}
</style>
</head>
<body>
<h1 style="color: white">Let's play the Game For The Throne!</h1>
<!-- red container div -->
<div style="position: relative; display: inline-block">
<!-- smaller red container div -->
<div
style="
position: absolute;
display: flex;
width: 100%;
align-items: center;
padding: 20px;
"
>
<!-- player health -->
<div
style="
position: relative;
width: 100%;
display: flex;
justify-content: flex-end;
border-top: 4px solid white;
border-left: 4px solid white;
border-bottom: 4px solid white;
"
>
<div style="background-color: red; height: 30px; width: 100%"></div>
<div
id="playerHealth"
style="
position: absolute;
background: #818cf8;
top: 0;
right: 0;
bottom: 0;
width: 100%;
"
></div>
</div>

<!-- timer -->
<div
id="timer"
style="
background-color: black;
width: 100px;
height: 50px;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
color: white;
border: 4px solid white;
"
>
10
</div>
<!-- enemy health -->
<div
style="
position: relative;
width: 100%;
border-top: 4px solid white;
border-bottom: 4px solid white;
border-right: 4px solid white;
"
>
<div style="background-color: red; height: 30px"></div>
<div
id="enemyHealth"
style="
position: absolute;
background: #818cf8;
top: 0;
right: 0;
bottom: 0;
left: 0;
"
></div>
</div>
<div></div>
</div>
<div
id="displayText"
style="
position: absolute;
color: white;
align-items: center;
justify-content: center;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: none;
"
>

</div>
<div class="f">
<canvas></canvas></div>
</div>
<h2 style="color: blue">controls:</h2>
<h3 style="color: blue">for player1:left-a, right-d, up-w,attack-spacebar</h3>
<h3 style="color: red">for player2:left-leftarrow, right-rightarrow, up-uparrow,attack-downarrow</h3>

<script
src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.9.1/gsap.min.js"
integrity="sha512-H6cPm97FAsgIKmlBA4s774vqoN24V5gSQL4yBTDOY2su2DeXZVhQPxFK4P6GPdnZqM9fg1G3cMv5wD7e6cFLZQ=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<script src="js/utils.js"></script>
<script src="js/classes.js"></script>
<script src="index.js"></script>
</body>
Loading