Skip to content

Commit

Permalink
new map + treasure
Browse files Browse the repository at this point in the history
  • Loading branch information
Chasmiccoder committed Feb 10, 2022
1 parent 81491e4 commit 6fb1982
Show file tree
Hide file tree
Showing 12 changed files with 175 additions and 34 deletions.
File renamed without changes
Binary file added images/acmrpg.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 modified images/map_outline.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/map_outlineOld.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
8 changes: 1 addition & 7 deletions js/GameObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class GameObject { // all people
}

mount(map) {
console.log("Mounting");
// console.log("Mounting");
this.isMounted = true;
map.addWall(this.x, this.y);

Expand All @@ -42,12 +42,6 @@ class GameObject { // all people
let eventConfig = this.behaviorLoop[this.behaviorLoopIndex];
eventConfig.who = this.id;

// Event config for link teleportation
// eventConfig.link = this.link || '';
// eventConfig.newTab = this.newTab || false;

console.log(eventConfig.link);

// create an event instance out of our next event config
const eventHandler = new OverworldEvent({map, event: eventConfig});
await eventHandler.init(); // wait until the event gets revolved
Expand Down
14 changes: 11 additions & 3 deletions js/OverworldEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,21 @@ class OverworldEvent {

redirectPerson(resolve) {
let link = this.event.link;
let newTab = this.event.newTab || false;
let newTab = this.event.newTab || false; // NOT WORKING. Always opening new tab
if(newTab) {
console.log("AGAIN");
// console.log("AGAIN");
window.open(link, '_blank');
} else {
window.open(link);
}
resolve();
}
}

unlockTreasure(resolve) {
let box_id = this.event.box_id;
// console.log("BID: ", box_id);
applicantData['treasuresObtained'].push(box_id);
console.log(applicantData);
resolve();
}
}
33 changes: 29 additions & 4 deletions js/OverworldMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,24 @@ const getRoute = (x,y, name, link) =>{
return route;
}



const getTreasureBox = (x,y,box_id) => {
let box = new Person({
x: utils.withGrid(x),
y: utils.withGrid(y),
src: "./images/blankGuy.png",
useShadow:false,
talking: [
{
events: [
{type: "textMessage", text: `Secret Treasure Unlocked!`},
{type: "unlockTreasure", box_id:box_id},
// {type: "redirectPerson", link: link, newTab: true},
]
},
]
});
return box;
}

class OverworldMap {
constructor(config) {
Expand Down Expand Up @@ -259,14 +275,14 @@ class OverworldMap {

window.OverworldMaps = {
DemoRoom: {
lowerSrc: "./images/FINAL_FOR_REALZ_.png", // current best map is= ./images/official_assets/ourMap32.png
lowerSrc: "./images/acmrpg.png", // current best map is= ./images/official_assets/ourMap32.png
// upperSrc: "./images/blank_guy.png",
gameObjects: {
hero: new Person({
isPlayerControlled: true,
src: "./images/Hero.png",
useShadow: true,
x: utils.withGrid(28), // 32 44
x: utils.withGrid(28), // Starting point: 28,32
y: utils.withGrid(32),
}),

Expand Down Expand Up @@ -494,6 +510,15 @@ window.OverworldMaps = {
whatsappPerson1: getRoute(45,32,"Kick Start Learn Program", "https://with.acmvit.in/ksl"),
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),

},
walls: WALLS,
cutsceneSpaces: {
Expand Down
5 changes: 5 additions & 0 deletions js/init.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// contains the applicant's data (used to keep track of the treasure unlocked)
var applicantData = {
treasuresObtained: []
};

(function() {
// console.log("Working");
const overworld = new Overworld({
Expand Down
75 changes: 64 additions & 11 deletions js/walls.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ const WALLS = {
[utils.asGridCoord(8,13)]: true,
[utils.asGridCoord(20,13)]: true,
[utils.asGridCoord(30,13)]: true,
[utils.asGridCoord(31,13)]: true,
[utils.asGridCoord(33,13)]: true,
[utils.asGridCoord(34,13)]: true,
[utils.asGridCoord(35,13)]: true,
[utils.asGridCoord(36,13)]: true,
[utils.asGridCoord(41,13)]: true,
Expand Down Expand Up @@ -286,17 +289,21 @@ const WALLS = {
[utils.asGridCoord(47,33)]: true,
[utils.asGridCoord(2,34)]: true,
[utils.asGridCoord(47,34)]: true,
[utils.asGridCoord(-4,35)]: true,
[utils.asGridCoord(-3,35)]: true,
[utils.asGridCoord(-2,35)]: true,
[utils.asGridCoord(-1,35)]: true,
[utils.asGridCoord(2,35)]: true,
[utils.asGridCoord(35,35)]: true,
[utils.asGridCoord(47,35)]: true,
[utils.asGridCoord(-1,36)]: true,
[utils.asGridCoord(-5,36)]: true,
[utils.asGridCoord(0,36)]: true,
[utils.asGridCoord(1,36)]: true,
[utils.asGridCoord(2,36)]: true,
[utils.asGridCoord(34,36)]: true,
[utils.asGridCoord(35,36)]: true,
[utils.asGridCoord(47,36)]: true,
[utils.asGridCoord(-2,37)]: true,
[utils.asGridCoord(-6,37)]: true,
[utils.asGridCoord(23,37)]: true,
[utils.asGridCoord(24,37)]: true,
[utils.asGridCoord(33,37)]: true,
Expand All @@ -305,15 +312,10 @@ const WALLS = {
[utils.asGridCoord(38,37)]: true,
[utils.asGridCoord(39,37)]: true,
[utils.asGridCoord(46,37)]: true,
[utils.asGridCoord(-1,38)]: true,
[utils.asGridCoord(0,38)]: true,
[utils.asGridCoord(1,38)]: true,
[utils.asGridCoord(2,38)]: true,
[utils.asGridCoord(-5,38)]: true,
[utils.asGridCoord(3,38)]: true,
[utils.asGridCoord(4,38)]: true,
[utils.asGridCoord(8,38)]: true,
[utils.asGridCoord(9,38)]: true,
[utils.asGridCoord(10,38)]: true,
[utils.asGridCoord(5,38)]: true,
[utils.asGridCoord(20,38)]: true,
[utils.asGridCoord(21,38)]: true,
[utils.asGridCoord(22,38)]: true,
Expand All @@ -323,7 +325,11 @@ const WALLS = {
[utils.asGridCoord(38,38)]: true,
[utils.asGridCoord(44,38)]: true,
[utils.asGridCoord(45,38)]: true,
[utils.asGridCoord(5,39)]: true,
[utils.asGridCoord(-4,39)]: true,
[utils.asGridCoord(-3,39)]: true,
[utils.asGridCoord(-2,39)]: true,
[utils.asGridCoord(-1,39)]: true,
[utils.asGridCoord(2,39)]: true,
[utils.asGridCoord(6,39)]: true,
[utils.asGridCoord(7,39)]: true,
[utils.asGridCoord(11,39)]: true,
Expand All @@ -332,15 +338,26 @@ const WALLS = {
[utils.asGridCoord(26,39)]: true,
[utils.asGridCoord(31,39)]: true,
[utils.asGridCoord(44,39)]: true,
[utils.asGridCoord(-1,40)]: true,
[utils.asGridCoord(2,40)]: true,
[utils.asGridCoord(13,40)]: true,
[utils.asGridCoord(18,40)]: true,
[utils.asGridCoord(19,40)]: true,
[utils.asGridCoord(26,40)]: true,
[utils.asGridCoord(44,40)]: true,
[utils.asGridCoord(-5,41)]: true,
[utils.asGridCoord(-4,41)]: true,
[utils.asGridCoord(-3,41)]: true,
[utils.asGridCoord(-2,41)]: true,
[utils.asGridCoord(-1,41)]: true,
[utils.asGridCoord(2,41)]: true,
[utils.asGridCoord(13,41)]: true,
[utils.asGridCoord(17,41)]: true,
[utils.asGridCoord(26,41)]: true,
[utils.asGridCoord(44,41)]: true,
[utils.asGridCoord(-6,42)]: true,
[utils.asGridCoord(-1,42)]: true,
[utils.asGridCoord(2,42)]: true,
[utils.asGridCoord(4,42)]: true,
[utils.asGridCoord(5,42)]: true,
[utils.asGridCoord(6,42)]: true,
Expand All @@ -349,6 +366,7 @@ const WALLS = {
[utils.asGridCoord(13,42)]: true,
[utils.asGridCoord(17,42)]: true,
[utils.asGridCoord(44,42)]: true,
[utils.asGridCoord(-6,43)]: true,
[utils.asGridCoord(3,43)]: true,
[utils.asGridCoord(9,43)]: true,
[utils.asGridCoord(13,43)]: true,
Expand All @@ -359,6 +377,8 @@ const WALLS = {
[utils.asGridCoord(21,43)]: true,
[utils.asGridCoord(24,43)]: true,
[utils.asGridCoord(43,43)]: true,
[utils.asGridCoord(-5,44)]: true,
[utils.asGridCoord(2,44)]: true,
[utils.asGridCoord(3,44)]: true,
[utils.asGridCoord(10,44)]: true,
[utils.asGridCoord(11,44)]: true,
Expand All @@ -371,6 +391,12 @@ const WALLS = {
[utils.asGridCoord(33,44)]: true,
[utils.asGridCoord(41,44)]: true,
[utils.asGridCoord(42,44)]: true,
[utils.asGridCoord(-4,45)]: true,
[utils.asGridCoord(-3,45)]: true,
[utils.asGridCoord(-2,45)]: true,
[utils.asGridCoord(-1,45)]: true,
[utils.asGridCoord(0,45)]: true,
[utils.asGridCoord(1,45)]: true,
[utils.asGridCoord(3,45)]: true,
[utils.asGridCoord(22,45)]: true,
[utils.asGridCoord(25,45)]: true,
Expand Down Expand Up @@ -483,22 +509,49 @@ const WALLS = {
[utils.asGridCoord(24,66)]: true,
[utils.asGridCoord(25,66)]: true,
[utils.asGridCoord(36,66)]: true,
[utils.asGridCoord(15,67)]: true,
[utils.asGridCoord(16,67)]: true,
[utils.asGridCoord(17,67)]: true,
[utils.asGridCoord(22,67)]: true,
[utils.asGridCoord(36,67)]: true,
[utils.asGridCoord(15,68)]: true,
[utils.asGridCoord(17,68)]: true,
[utils.asGridCoord(23,68)]: true,
[utils.asGridCoord(33,68)]: true,
[utils.asGridCoord(34,68)]: true,
[utils.asGridCoord(35,68)]: true,
[utils.asGridCoord(15,69)]: true,
[utils.asGridCoord(17,69)]: true,
[utils.asGridCoord(24,69)]: true,
[utils.asGridCoord(30,69)]: true,
[utils.asGridCoord(31,69)]: true,
[utils.asGridCoord(32,69)]: true,
[utils.asGridCoord(15,70)]: true,
[utils.asGridCoord(17,70)]: true,
[utils.asGridCoord(18,70)]: true,
[utils.asGridCoord(19,70)]: true,
[utils.asGridCoord(20,70)]: true,
[utils.asGridCoord(21,70)]: true,
[utils.asGridCoord(22,70)]: true,
[utils.asGridCoord(23,70)]: true,
[utils.asGridCoord(24,70)]: true,
[utils.asGridCoord(30,70)]: true,
[utils.asGridCoord(25,71)]: true,
[utils.asGridCoord(15,71)]: true,
[utils.asGridCoord(26,71)]: true,
[utils.asGridCoord(27,71)]: true,
[utils.asGridCoord(28,71)]: true,
[utils.asGridCoord(29,71)]: true,
[utils.asGridCoord(30,71)]: true,
[utils.asGridCoord(15,72)]: true,
[utils.asGridCoord(16,72)]: true,
[utils.asGridCoord(17,72)]: true,
[utils.asGridCoord(18,72)]: true,
[utils.asGridCoord(19,72)]: true,
[utils.asGridCoord(20,72)]: true,
[utils.asGridCoord(21,72)]: true,
[utils.asGridCoord(22,72)]: true,
[utils.asGridCoord(23,72)]: true,
[utils.asGridCoord(24,72)]: true,
[utils.asGridCoord(25,72)]: true,
[utils.asGridCoord(26,72)]: true,
};
2 changes: 1 addition & 1 deletion wallGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
def removeFlagged(coordinate_list):

# For insta, twitter blocks
flagged = [[31,40],[32,40],[33,41],[34,41],[35,40],[36,40],[37,39],[38,39],[26,42],[25,42],[45,32],[46,32]]
flagged = [[31,40],[32,40],[33,41],[34,41],[35,40],[36,40],[37,39],[38,39],[26,42],[25,42],[45,32],[46,32],[10,38],[9,38],[8,38]]
newList = []

for point in coordinate_list:
Expand Down
Loading

0 comments on commit 6fb1982

Please sign in to comment.