Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Vital-Vuillaume authored Mar 3, 2024
1 parent 8c5cce3 commit 925897f
Show file tree
Hide file tree
Showing 12 changed files with 1,990 additions and 1,023 deletions.
42 changes: 42 additions & 0 deletions classes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
class Sprite {
constructor({position, velocity, image, frames = {max: 1} }) {
this.position = position;
this.image = image;
this.frames = frames;

this.image.onload = () => {
this.width = this.image.width / this.frames.max;
this.height = this.image.height;
};
}

draw() {
c.drawImage(
this.image,
0,
0,
this.image.width / this.frames.max,
this.image.height,
this.position.x,
this.position.y,
this.image.width / this.frames.max,
this.image.height
);
}
}

const t = 16
class Boundary {
static width = t;
static height = t;
constructor({position}) {
this.position = position;
this.width = t;
this.height = t;
}

draw() {
c.fillStyle = "rgba(255, 0, 0, 0)"
c.fillRect(this.position.x, this.position.y, this.width, this.height);
}
}
209 changes: 105 additions & 104 deletions collisions.js

Large diffs are not rendered by default.

Binary file added foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" type="text/css" href="pixel-adventure-game-desktop.css">
<link rel="stylesheet" type="text/css" href="menu.css">
<script defer src="collisions.js"></script>
<script defer src="menu.js"></script>
<script defer src="collisions.js"></script>
<script defer src="classes.js"></script>
<script defer src="pixel-adventure-game-desktop.js"></script>
<link rel="icon" href="pixel-adventure-game.ico" type="image/x-icon">
<link rel="icon" href="pixel-adventure-game.png" type="image/png">
Expand Down
4 changes: 4 additions & 0 deletions maison.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.10" tiledversion="git" name="maison" tilewidth="16" tileheight="16" tilecount="576" columns="24">
<image source="pack.png" width="384" height="384"/>
</tileset>
Binary file modified map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,137 changes: 800 additions & 337 deletions map.tmx

Large diffs are not rendered by default.

1,165 changes: 826 additions & 339 deletions mapJson.json

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions menu.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*if (window.location.protocol != "https:") {
window.location.protocol="https:";
}*/

document.addEventListener("contextmenu", function (event) {
event.preventDefault();
});

const body = document.querySelector("body");
const menu = document.querySelector(".menu");
const reprendre = document.querySelector(".reprendre");
Expand Down
Binary file added pack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 925897f

Please sign in to comment.