Skip to content

Commit

Permalink
Merge pull request #2 from JhonFXA/update
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
JhonFXA authored Nov 9, 2023
2 parents 8e8161a + 64dabfa commit 619809a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
18 changes: 9 additions & 9 deletions html/game.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/src/css/game.css">
<link rel="stylesheet" href="/src/css/fonts.css">
<link rel="stylesheet" href="/src/css/reset.css">
<link rel="stylesheet" href="../src/css/game.css">
<link rel="stylesheet" href="../src/css/fonts.css">
<link rel="stylesheet" href="../src/css/reset.css">
<title>Demon Slayer Game</title>
</head>
<body>
<!-- red container div -->
<div class="game-display">
<div class="players-info">
<img class="character1-icon" src="/src/imagens/tanjiro-icon.jpg" alt="">
<img class="character1-icon" src="../src/imagens/tanjiro-icon.jpg" alt="">
<div class="player1-info">
<div class="character1-name">Player 1</div>
<div class="player1-health">
Expand All @@ -30,13 +30,13 @@
</div>
<div class="player2-stamina"></div>
</div>
<img class="character2-icon" src="/src/imagens/zenitsu-icon.jpg" alt="">
<img class="character2-icon" src="../src/imagens/zenitsu-icon.jpg" alt="">
</div>
<canvas></canvas>
</div>

<script src="/src/js/utils.js"></script>
<script src="/src/js/classes.js"></script>
<script src="/src/js/game.js"></script>
<script src="../src/js/utils.js"></script>
<script src="../src/js/classes.js"></script>
<script src="../src/js/game.js"></script>
</body>
</html>
</html>
File renamed without changes
File renamed without changes
19 changes: 9 additions & 10 deletions src/js/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const background = new SpriteScenery({
x: 0,
y: 0
},
imageSrc: '/src/imagens/game-assets/scenery1.jpg'
imageSrc: '../src/imagens/game-assets/scenery1.jpg'
}, window.innerWidth, window.innerHeight)


Expand All @@ -28,45 +28,45 @@ const player1 = new Character({
x: 0,
y: 0
},
imageSrc: '/src/imagens/game-assets/tanjiro/tanjiro-idle.png',
imageSrc: '../src/imagens/game-assets/tanjiro/tanjiro-idle.png',
scale: 2,
offset: {
x: 215,
y: 0
},
sprites: {
idle: {
imageSrc: '/src/imagens/game-assets/tanjiro/tanjiro-idle.png',
imageSrc: '../src/imagens/game-assets/tanjiro/tanjiro-idle.png',
framesMax: 8,
framesHold: 10
},
idleInverted: {
imageSrc: '/src/imagens/game-assets/tanjiro/tanjiro-idle-inverted.png',
imageSrc: '../src/imagens/game-assets/tanjiro/tanjiro-idle-inverted.png',
framesMax: 8,
framesHold: 10
},
run: {
imageSrc: '/src/imagens/game-assets/tanjiro/tanjiro-run.png',
imageSrc: '../src/imagens/game-assets/tanjiro/tanjiro-run.png',
framesMax: 8,
framesHold: 10
},
runInverted: {
imageSrc: '/src/imagens/game-assets/tanjiro/tanjiro-run-inverted.png',
imageSrc: '../src/imagens/game-assets/tanjiro/tanjiro-run-inverted.png',
framesMax: 8,
framesHold: 10
},
jump: {
imageSrc: '/src/imagens/game-assets/tanjiro/tanjiro-jump.png',
imageSrc: '../src/imagens/game-assets/tanjiro/tanjiro-jump.png',
framesMax: 2,
framesHold: 10
},
jumpInverted: {
imageSrc: '/src/imagens/game-assets/tanjiro/tanjiro-jump-inverted.png',
imageSrc: '../src/imagens/game-assets/tanjiro/tanjiro-jump-inverted.png',
framesMax: 2,
framesHold: 10
},
attack: {
imageSrc: '/src/imagens/game-assets/tanjiro/tanjiro-attack.png',
imageSrc: '../src/imagens/game-assets/tanjiro/tanjiro-attack.png',
framesMax: 5,
framesHold: 5
}
Expand Down Expand Up @@ -209,7 +209,6 @@ function animate() {
animate()

window.addEventListener('keydown', (event) =>{
console.log(event.key)
//Player 1 keys
switch (event.key) {
case 'd':
Expand Down

0 comments on commit 619809a

Please sign in to comment.