Skip to content

Commit

Permalink
Added hemanth, but straying off path :(
Browse files Browse the repository at this point in the history
  • Loading branch information
Chasmiccoder committed Feb 9, 2022
1 parent 74f9bd7 commit bb98c90
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 12 deletions.
3 changes: 0 additions & 3 deletions js/Overworld.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -21,10 +20,8 @@ class Overworld {

init() {
this.startMap(window.OverworldMaps.DemoRoom);

this.bindActionInput();
this.bindHeroPositionCheck();


this.directionInput = new DirectionInput();
this.directionInput.init();
Expand Down
52 changes: 51 additions & 1 deletion js/OverworldMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down Expand Up @@ -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,
Expand Down
28 changes: 28 additions & 0 deletions js/generatePath.py
Original file line number Diff line number Diff line change
@@ -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")
20 changes: 12 additions & 8 deletions styles/TextMessage.css
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -14,7 +17,8 @@

.TextMessage_p {
margin: 0;
font-size: 12px;
/* font-size: 12px; */
font-size: 24px;
}

/* for typewriter effect */
Expand All @@ -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;
Expand All @@ -40,5 +46,3 @@
right: 2px;
bottom: 0;
}


0 comments on commit bb98c90

Please sign in to comment.