Centered tutorial text for consistency

This commit is contained in:
Arne van Iterson 2020-04-17 10:51:33 +02:00
parent c7a629517c
commit fb323809bc
2 changed files with 11 additions and 11 deletions

View File

@ -24,7 +24,7 @@ class GameScreen extends Container {
// Initialise first level 1-1.js at startPosition 0 // Initialise first level 1-1.js at startPosition 0
var player = new Player(keys, window); var player = new Player(keys, window);
var level = new Level(require(__dirname + "/../levels/2-2.js"), keys, player, this); var level = new Level(require(__dirname + "/../levels/1-1.js"), keys, player, this);
player.pos.x = level.startPos[0].x / 1; player.pos.x = level.startPos[0].x / 1;
player.pos.y = level.startPos[0].y / 1; player.pos.y = level.startPos[0].y / 1;
player.level = level; player.level = level;

View File

@ -25,7 +25,7 @@ class Tutorial extends Container {
this.add(new Rect(this.game.w, this.game.h, { fill: "#333333" })); this.add(new Rect(this.game.w, this.game.h, { fill: "#333333" }));
const title = new Text("Tutorial", {fill: "#ffffff", font: "36px Minecraft"}); const title = new Text("Tutorial", {fill: "#ffffff", font: "36px Minecraft"});
title.pos = { x: 12, y: 44 }; title.pos = { x: 247, y: 44 };
this.add(title); this.add(title);
this.images = [ this.images = [
@ -41,24 +41,24 @@ class Tutorial extends Container {
} }
// Controls direction // Controls direction
this.images[0].pos = { x: 24, y: 60 }; this.images[0].pos = { x: 296, y: 60 };
this.instructions[0].pos = { x: 12, y: 108 }; this.instructions[0].pos = { x: 130, y: 108 };
// Controls sprint // Controls sprint
this.images[1].pos = { x: 24, y: 116 }; this.images[1].pos = { x: 309, y: 116 };
this.instructions[1].pos = { x: 12, y: 148 }; this.instructions[1].pos = { x: 95, y: 148 };
// Controls action // Controls action
this.images[2].pos = { x: 24, y: 156 }; this.images[2].pos = { x: 288, y: 156 };
this.instructions[2].pos = { x: 12, y: 188 }; this.instructions[2].pos = { x: 140, y: 188 };
// Interact // Interact
this.images[3].pos = { x: 24, y: 196 }; this.images[3].pos = { x: 288, y: 196 };
this.instructions[3].pos = { x: 12, y: 254 }; this.instructions[3].pos = { x: 12, y: 254 };
this.instructions[4].pos = { x: 12, y: 274 }; this.instructions[4].pos = { x: 17, y: 274 };
// Back to menu // Back to menu
this.instructions[5].pos = { x: 12, y: 308 }; this.instructions[5].pos = { x: 215, y: 308 };
for (let index = 0; index < this.instructions.length; index++) { for (let index = 0; index < this.instructions.length; index++) {
if (this.images[index]) { if (this.images[index]) {