diff --git a/js/Overworld.js b/js/Overworld.js index 1b7f045..931dc74 100644 --- a/js/Overworld.js +++ b/js/Overworld.js @@ -9,7 +9,6 @@ class Overworld { // this.gameContainer.style.width = window.innerWidth; // this.gameContainer.style.height = window.innerHeight; - // this.canvas.height = 1000; // TODO: Change this! // this.canvas.width = 1500; @@ -21,10 +20,8 @@ class Overworld { init() { this.startMap(window.OverworldMaps.DemoRoom); - this.bindActionInput(); this.bindHeroPositionCheck(); - this.directionInput = new DirectionInput(); this.directionInput.init(); diff --git a/js/OverworldMap.js b/js/OverworldMap.js index 7462948..f12b644 100644 --- a/js/OverworldMap.js +++ b/js/OverworldMap.js @@ -58,7 +58,6 @@ class OverworldMap { this.isCutscenePlaying = false; - // reset npc's to do their normal behaviour Object.values(this.gameObjects).forEach(object => object.doBehaviorEvent(this)) } @@ -173,6 +172,57 @@ window.OverworldMaps = { // {type: "walk", direction: "down"} // ] }), + + + hemanth: new Person({ + x: utils.withGrid(2), + y: utils.withGrid(10), + src: "./images/brownGuy1.png", + behaviorLoop: [ + {type:"walk",direction:"right"}, + {type:"walk",direction:"up"}, + {type:"walk",direction:"right"}, + {type:"walk",direction:"right"}, + {type:"walk",direction:"down"}, + {type:"walk",direction:"right"}, + {type:"walk",direction:"right"}, + {type:"walk",direction:"right"}, + {type:"walk",direction:"right"}, + {type:"walk",direction:"right"}, + // {type:"stand",direction:"r",time:500}, + {type:"walk",direction:"down"}, + {type:"walk",direction:"left"}, + {type:"walk",direction:"left"}, + {type:"walk",direction:"left"}, + {type:"walk",direction:"left"}, + {type:"walk",direction:"left"}, + {type:"walk",direction:"down"}, + {type:"walk",direction:"left"}, + {type:"walk",direction:"left"}, + // {type:"stand",direction:"u",time:500}, + {type:"walk",direction:"up"}, + {type:"walk",direction:"left"}, + {type:"walk",direction:"up"}, + ], + talking: [ + { + // defined this way so that people can say different things, at different points in time + events: [ + {type: "textMessage", text: "It's about drive, it's about power", faceHero: "hemanth"}, + {type: "textMessage", text: "We stay hungry, we devour!"}, + // {who: "hero", type: "walk", direction: "left"} + ] + }, + + // saying a different thing later + // { + // events: [ + // {type: "textMessage", text: "Congrats on beating that boss!"} + // ] + // } + ] + }), + }, walls: { [utils.asGridCoord(7,6)]: true, diff --git a/js/generatePath.py b/js/generatePath.py new file mode 100644 index 0000000..cb4e0d9 --- /dev/null +++ b/js/generatePath.py @@ -0,0 +1,28 @@ +# Generate path for npc + +def f(_type, direction, time=0): + if _type == "walk": + print("{type:\"" + _type + "\",direction:\"" + direction + "\"},") + else: # "stand" + print("{type:\"" + _type + "\",direction:\"" + direction + "\",time:" + str(time) + "},") + + +def p(direction_string): + i = 0 + while i < len(direction_string): + dir = direction_string[i] + if dir == "l": + f("walk", "left") + elif dir == "r": + f("walk", "right") + elif dir == "u": + f("walk", "up") + elif dir == "d": + f("walk", "down") + elif dir == "s": # stand + i += 1 + D = direction_string[i] + f("stand", D, 500) + i += 1 + +p("rurrdrrrrrsrdllllldllsuulu") diff --git a/styles/TextMessage.css b/styles/TextMessage.css index 9301add..1b78dd9 100644 --- a/styles/TextMessage.css +++ b/styles/TextMessage.css @@ -3,9 +3,12 @@ left: 0; right: 0; bottom: 0; - height: 36px; - font-size: 12px; - padding: 4px; + /* height: 36px; */ + height: 96px; + /* font-size: 12px; */ + /* font-size: 48px; */ + /* padding: 4px; */ + padding: 20px; background: var(--menu-background); border-top: 1px solid var(--menu-border-color); @@ -14,7 +17,8 @@ .TextMessage_p { margin: 0; - font-size: 12px; + /* font-size: 12px; */ + font-size: 24px; } /* for typewriter effect */ @@ -28,8 +32,10 @@ .TextMessage_button { margin: 0; - font-size: 8px; - padding: 0; + /* font-size: 8px; */ + font-size: 24px; + padding: 20px; + /* padding: 30px; */ -webkit-appearance: none; background: none; border: 0; @@ -40,5 +46,3 @@ right: 2px; bottom: 0; } - -