Skip to content

Commit

Permalink
home Inside
Browse files Browse the repository at this point in the history
  • Loading branch information
Vital-Vuillaume committed Apr 3, 2024
1 parent cb2dee8 commit cf2c0ec
Show file tree
Hide file tree
Showing 14 changed files with 784 additions and 123 deletions.
414 changes: 372 additions & 42 deletions Json/homeJson.json

Large diffs are not rendered by default.

Binary file modified Site/ImageGame/home.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 Site/ImageGame/homeForeground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file modified Site/ImageGame/ragnerus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 22 additions & 22 deletions Site/Js/JsGame/TiledData/collisionsHome.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Site/Js/JsGame/dialogue.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function dialogueFunction(usernames, texts) {
timeoutVillager = setTimeout(displaySegment, time);
} else {
timeoutVillager = setTimeout(function() {

villagers.forEach(villager => {
villager.sprite.movingVillager = false;
})
Expand Down Expand Up @@ -67,6 +68,6 @@ function keydialogue(villager) {
dialogueFunction("Ragnerus", "Bonjour, je vois que vous êtes nouveau. Ici, c'est le village d'Amarantis. Le vagabond vous a ramené à l'Hôpital du Village, on ne sait pas où il vous a trouvé. Vous êtes resté endormi pendant plusieurs mois. Le vagabond est bizarre... il ne parle avec personne... on ne le connaît pas tellement... Ce n'est pas un habitant d'Amarantis. Il habite dans la forêt à l'ouest. Le chef du village d'Amarantis attend avec impatience de vous parler. Il se trouve dans sa grande maison au sud du village.");
}
} else {
dialogueFunction("Maitre du jeu", "Veulliez d'abord parler au vagbond.");
dialogueFunction("Maitre du jeu", "Veuillez d'abord parler au vagbond.");
}
}
2 changes: 2 additions & 0 deletions Site/Js/JsGame/play.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ function animate() {
villager.sprite.draw();
});

foregroundHome.draw();

player.moving = false;

homeOfCollisions.forEach(homeOfCollision => {
Expand Down
42 changes: 26 additions & 16 deletions Site/Js/JsGame/sprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@ const mapBackground = new Image();
mapBackground.src = './Site/ImageGame/map.png';

const mapForeground = new Image();
mapForeground.src = './Site/ImageGame/foreground.png';
mapForeground.src = './Site/ImageGame/mapForeground.png';

// Houses image

const homeBackground = new Image();
homeBackground.src = './Site/ImageGame/home.png';

const homeForeground = new Image();
homeForeground.src = './Site/ImageGame/homeForeground.png';

// Player creation

const player = new Sprite({
Expand All @@ -60,8 +63,8 @@ const player = new Sprite({
const vagabond = {
sprite: new Sprite({
position: {
x: canvas.width / 2 + 50,
y: canvas.height / 2 + 20
x: canvas.width / 2 + 35,
y: canvas.height / 2 - 25
},
frames: {
max: 4
Expand All @@ -70,33 +73,33 @@ const vagabond = {
}),
};





const ragnerus = {
const chef = {
sprite: new Sprite({
position: {
x: canvas.width / 2 + 200,
y: canvas.height / 2 + 200
x: canvas.width / 2 + 155,
y: canvas.height / 2 + 390
},
frames: {
max: 4
},
image: ragnerusImage
image: chefImage
}),
};

const chef = {




const ragnerus = {
sprite: new Sprite({
position: {
x: canvas.width / 2 + 230,
y: canvas.height / 2 + 420
x: canvas.width / 2 + 195,
y: canvas.height / 2 + 195
},
frames: {
max: 4
},
image: chefImage
image: ragnerusImage
}),
};

Expand Down Expand Up @@ -214,7 +217,14 @@ const backgroundHome = new Sprite({
image: homeBackground
})

const foregroundHome = new Sprite({
position: {
x: offset.x,
y: offset.y
},
image: homeForeground
})

const movable = [backgroundMap , foregroundMap, ...mapOfCollisions,
...frontOfHomes, ...villagersMovable,
backgroundHome, ...homeOfCollisions];
backgroundHome, foregroundHome, ...homeOfCollisions];
Binary file added Tiled/ImageSet/homeInside1.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 Tiled/ImageSet/homeInside2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
394 changes: 352 additions & 42 deletions Tiled/TiledBackground/home.tmx

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions Tiled/TiledSet/homeInside1.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="homeInside1" tilewidth="16" tileheight="16" tilecount="234" columns="13">
<image source="../ImageSet/homeInside1.png" width="208" height="288"/>
</tileset>
4 changes: 4 additions & 0 deletions Tiled/TiledSet/homeInside2.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="homeInside2" tilewidth="16" tileheight="16" tilecount="234" columns="13">
<image source="../ImageSet/homeInside2.png" width="208" height="288"/>
</tileset>

0 comments on commit cf2c0ec

Please sign in to comment.