Build level further
[wgj58.git] / wgj58.js
index 8885d24f3092fd3fbd9562f532c968cddae8070c..49ebc06791d9c18e20abf986c5f81ec8308efa1c 100644 (file)
--- a/wgj58.js
+++ b/wgj58.js
@@ -235,7 +235,6 @@ class NPC_Clara extends GameNPC {
                                        { actor: this, text: "If I had no card, would I still exist?" },
                                        { actor: logic.player, text: "..." },
                                        { actor: logic.player, text: "You sound very philosophical today." } ] ));
-                               logic.closeDoor("cutedoor");
                                break;
                        case 2:
                        case 3:
@@ -278,6 +277,13 @@ class NPC_Clara extends GameNPC {
        }
 }
 
+class NPC_Carlos extends GameNPC {
+       actionTalk() {
+               super.actionTalk();
+               logic.endTalk();
+       }
+}
+
 
 class GameInterface extends Phaser.Group {
        constructor(game, parent) {
@@ -470,6 +476,10 @@ class GameLogic {
                                newChar = new NPC_Clara(object.x, object.y, 'clara', "Clara", "Clara Tnavelerri", 200);
                                this.clara = newChar;
                                break;
+                       case 'carlos':
+                               newChar = new NPC_Carlos(object.x, object.y, 'carlos', "Carlos", "Carlos Elbacalper", 150);
+                               this.carlos = newChar;
+                               break;
                        default:
                                console.error("Unknown character:", object);
                }
@@ -558,6 +568,7 @@ class GamePlay extends Phaser.State {
 
                game.load.image('player', 'john.png');
                game.load.image('clara', 'clara.png');
+               game.load.image('carlos', 'carlos.png');
                game.load.image('saiki', 'saiki.png');
                game.load.image('tileset', 'tileset.png');
                game.load.image('objects', 'objects.png');