diff --git a/assets/css/style.css b/assets/css/style.css
index fa1762a..442a6cc 100644
--- a/assets/css/style.css
+++ b/assets/css/style.css
@@ -103,7 +103,7 @@ canvas {
padding: 20px;
}
-#contact {
+#contact, #maomao {
background: #a3acbe;
position: relative;
height: inherit;
diff --git a/assets/img/thumbnails/maomao.png b/assets/img/thumbnails/maomao.png
new file mode 100644
index 0000000..e12603f
Binary files /dev/null and b/assets/img/thumbnails/maomao.png differ
diff --git a/assets/js/app.js b/assets/js/app.js
index 65573ad..72ae904 100644
--- a/assets/js/app.js
+++ b/assets/js/app.js
@@ -18,6 +18,7 @@ canvas.height = canvas.width
var audio = null
var contact = new Contact()
+var maomao = new Maomao()
var terminal = new Terminal()
var games = new Games()
var music = new Music()
@@ -166,7 +167,6 @@ function gameLoop() {
} else {
this.getKeystroke()
}
-
}
spriteMap.onload = function() {
diff --git a/assets/js/constants.js b/assets/js/constants.js
index c485fef..b08c070 100644
--- a/assets/js/constants.js
+++ b/assets/js/constants.js
@@ -21,9 +21,15 @@ var boundaryMap = {
"07": [0, 6],
//maomao
"65": [6, 4]
-
}
+var maomaoInteractionZones = [
+ [6, 4],
+ [7, 5],
+ [5, 5],
+ [6, 6]
+]
+
var computerInteractionZones = [
[2, 4],
[3, 4]
diff --git a/assets/js/keystroke.js b/assets/js/keystroke.js
index c691a25..187ad39 100644
--- a/assets/js/keystroke.js
+++ b/assets/js/keystroke.js
@@ -48,6 +48,10 @@ function onEnter() {
}
}
+ if (maomaoInteractionZones.some(a => playerPosition.every((v, i) => v === a[i]))) {
+ maomao.show();
+ }
+
if (player.direction === 'down' || player.direction === 'up') {
if (resumeInteractionZones.some(a => playerPosition.every((v, i) => v === a[i]))) {
indicator.hide('resume');
diff --git a/assets/js/maomao.js b/assets/js/maomao.js
new file mode 100644
index 0000000..7c9badd
--- /dev/null
+++ b/assets/js/maomao.js
@@ -0,0 +1,5 @@
+class Maomao extends Window {
+ constructor() {
+ super('maomao')
+ }
+}
diff --git a/assets/js/pathfinder.js b/assets/js/pathfinder.js
index 83451cc..ca13db6 100644
--- a/assets/js/pathfinder.js
+++ b/assets/js/pathfinder.js
@@ -215,6 +215,12 @@ async function pathfind(destX, destY) {
music.show()
}
+ if (destX === 6 && destY === 6) {
+ player.direction = 'up'
+ maomao.show()
+ }
+
+ dialog.hide()
}
function changeDir(destX, destY) {
diff --git a/index.html b/index.html
index 12fc185..91e6693 100644
--- a/index.html
+++ b/index.html
@@ -13,6 +13,7 @@
+
@@ -62,81 +63,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-