Skip to content

Commit

Permalink
Added sumona, shreyas,fixed walls,misc
Browse files Browse the repository at this point in the history
  • Loading branch information
Chasmiccoder committed Feb 11, 2022
1 parent de3947a commit 37d0c19
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 24 deletions.
Binary file added images/shreyas.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 images/sumona.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 images/theRock.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 images/vinamra.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions js/Overworld.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Overworld {
// this.gameContainer.style.width = window.innerWidth;
// this.gameContainer.style.height = window.innerHeight;

console.log(this.canvas.width, this.canvas.height);
// console.log(this.canvas.width, this.canvas.height);

this.context = this.canvas.getContext("2d");
this.map = null;
Expand Down Expand Up @@ -64,7 +64,7 @@ class Overworld {
const match = Object.values(this.map.gameObjects).find(object => {
return `${object.x},${object.y}` === `${nextCoords.x},${nextCoords.y}`
});
console.log({match});
// console.log({match});

let interact_p = document.querySelector(".game-interact");

Expand Down
79 changes: 64 additions & 15 deletions js/OverworldMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ let allCutsceneSpaces = {
...generateCutsceneSpaces(diya_cutscene_set_of_coords_raw, diyaPath),
...generateCutsceneSpaces(rehber_cutscene_set_of_coords_raw, rehberPath),
...generateCutsceneSpaces(vinamra_cutscene_set_of_coords_raw, vinamraPath),
...generateCutsceneSpaces(shreyas_cutscene_set_of_coords_raw, shreyasPath),
...generateCutsceneSpaces(sumona_cutscene_set_of_coords_raw, sumonaPath),

// TODO
// [utils.asGridCoord(10,17)]: [{events: shreyasPath}],
Expand Down Expand Up @@ -172,7 +174,7 @@ class OverworldMap {
});

// if you press Enter, you'll get the match object depending on your position and direction!
console.log({match});
// console.log({match});

if(!this.isCutscenePlaying && match && match.talking.length) {
this.startCutscene(match.talking[0].events)
Expand Down Expand Up @@ -228,8 +230,17 @@ class OverworldMap {
}
}


else if(shreyas_cutscene_set_of_coords.includes(hero_tile)) {
for(let i = 0; i < shreyas_cutscene_set_of_coords.length; i++) {
delete this.cutsceneSpaces[shreyas_cutscene_set_of_coords[i]];
}
}

else if(sumona_cutscene_set_of_coords.includes(hero_tile)) {
for(let i = 0; i < sumona_cutscene_set_of_coords.length; i++) {
delete this.cutsceneSpaces[sumona_cutscene_set_of_coords[i]];
}
}
}

addWall(x,y) {
Expand All @@ -256,8 +267,8 @@ window.OverworldMaps = {
isPlayerControlled: true,
src: "./images/Hero.png",
useShadow: true,
x: utils.withGrid(15), // Starting point: 28,32
y: utils.withGrid(24),
x: utils.withGrid(28), // Starting point: 28,31
y: utils.withGrid(31),
}),

npcA: new Person({
Expand Down Expand Up @@ -443,7 +454,7 @@ window.OverworldMaps = {
vinamra: new Person({
x: utils.withGrid(23),
y: utils.withGrid(20),
src: "./images/brownGuy1.png",
src: "./images/vinamra.png",
useShadow: true,
behaviorLoop: [
{type: "stand", direction: "left", time: 800},
Expand All @@ -463,7 +474,7 @@ window.OverworldMaps = {
shreyas: new Person({
x: utils.withGrid(9),
y: utils.withGrid(20),
src: "./images/brownGuy1.png",
src: "./images/shreyas.png",
useShadow: true,
behaviorLoop: [
{type: "stand", direction: "left", time: 800},
Expand All @@ -481,6 +492,46 @@ window.OverworldMaps = {
]
}),

theRock: new Person({
x: utils.withGrid(38),
y: utils.withGrid(54),
src: "./images/theRock.png",
useShadow: true,
behaviorLoop: [
{type: "stand", direction: "down", time: 100}
],
talking: [
{
events: [
{type: "textMessage", text: "Dwayne: It's about drive, it's about power", faceHero: "theRock"},
{type: "textMessage", text: "We stay hungry, we devour!", faceHero: "theRock"},
{type: "textMessage", text: "Put in the work, put in the hour", faceHero: "theRock"},
{type: "textMessage", text: "To take what's ours!!", faceHero: "theRock"},
]
},
]
}),

sumona: new Person({
x: utils.withGrid(25),
y: utils.withGrid(37),
src: "./images/sumona.png",
useShadow: true,
behaviorLoop: [
{type: "stand", direction: "left", time: 800},
{type: "stand", direction: "down", time: 800},
{type: "stand", direction: "right", time: 1200},
{type: "stand", direction: "down", time: 300}
],
talking: [
{
events: [
{type: "textMessage", text: "It's about drive, it's about power", faceHero: "sumona"},
]
},
]
}),


twitterPerson1: getRoute(31,40,"Twitter", "https://twitter.com/ACM_VIT"),
twitterPerson2: getRoute(32,40,"Twitter", "https://twitter.com/ACM_VIT"),
Expand All @@ -496,21 +547,19 @@ window.OverworldMaps = {
whatsappPerson2: getRoute(46,32,"Kick Start Learn Program", "https://with.acmvit.in/ksl"),

treasureBox1: getTreasureBox(21,47,1),
treasureBox2: getTreasureBox(-2,37,2),
treasureBox3: getTreasureBox(44,32,3),
treasureBox4: getTreasureBox(32,19,4),
treasureBox5: getTreasureBox(26,19,5),
treasureBox6: getTreasureBox(43,18,6),
treasureBox7: getTreasureBox(15,68,7),
treasureBox8: getTreasureBox(37,50,8),
treasureBox9: getTreasureBox(12,2,9),
treasureBox2: getTreasureBox(44,32,2),
treasureBox3: getTreasureBox(32,19,3),
treasureBox4: getTreasureBox(26,19,4),
treasureBox5: getTreasureBox(43,18,5),
treasureBox6: getTreasureBox(15,68,6),
treasureBox7: getTreasureBox(37,50,7),
treasureBox8: getTreasureBox(12,2,8),

},
walls: WALLS,
cutsceneSpaces: {
...allCutsceneSpaces,
...allRedirects,
},

},
}
7 changes: 2 additions & 5 deletions js/gameStatistics.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,18 @@ const renderStats = () => {
let div = document.querySelector(".game-statistics");
let name = document.createElement("p");
name.setAttribute("id", "player_stats_p")
name.innerHTML = `Collected ${applicantData.treasuresObtained.size || 0}/9 treasures`;
name.innerHTML = `Collected ${applicantData.treasuresObtained.size || 0}/8 treasures`;
div.appendChild(name);

div = document.querySelector(".game-interact");
let interact = document.createElement("p");
interact.setAttribute("id", "game_interact_p");
interact.innerHTML = `Press 'Enter' to interact!`;
div.appendChild(interact);



}

// update when the player unlocks a chest
const updateStats = () => {
let name = document.getElementById("player_stats_p");
name.innerHTML = `Collected ${applicantData.treasuresObtained.size}/9 treasures`;
name.innerHTML = `Collected ${applicantData.treasuresObtained.size}/8 treasures`;
}
11 changes: 9 additions & 2 deletions js/npc_routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,15 @@ let shreyas_cutscene_set_of_coords_raw = [[10,17],[11,17],[11,18],[11,19],[11,20
let shreyas_cutscene_set_of_coords = getCutsceneSetOfCoords(shreyas_cutscene_set_of_coords_raw);




X = "sumona"
let sumonaPath = [
walkUp(X),walkRight(X),walkRight(X),walkRight(X),walkUp(X),standUp(X,200),
{type: "textMessage", text:"Welcome Message!"},
walkDown(X),walkLeft(X),walkLeft(X),walkLeft(X),walkDown(X),standUp(X,200),
];

let sumona_cutscene_set_of_coords_raw = [[27,33],[28,33],[29,33]]
let sumona_cutscene_set_of_coords = getCutsceneSetOfCoords(sumona_cutscene_set_of_coords_raw);



8 changes: 8 additions & 0 deletions js/walls.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// critical walls added and removed, so change this with care
const WALLS = {
[utils.asGridCoord(12,2)]: true,
[utils.asGridCoord(13,2)]: true,
Expand Down Expand Up @@ -554,4 +555,11 @@ const WALLS = {
[utils.asGridCoord(24,72)]: true,
[utils.asGridCoord(25,72)]: true,
[utils.asGridCoord(26,72)]: true,

[utils.asGridCoord(17,44)]: true,
[utils.asGridCoord(17,45)]: true,
[utils.asGridCoord(18,45)]: true,
[utils.asGridCoord(19,45)]: true,
[utils.asGridCoord(20,45)]: true,
[utils.asGridCoord(21,45)]: true,
};

0 comments on commit 37d0c19

Please sign in to comment.