Compare commits
No commits in common. "870bc240b3b775ba5cb1c2c2bccad4db665d2538" and "380cebd36dc4e3a1f3af185d1a7e3f0adb3e04d1" have entirely different histories.
870bc240b3
...
380cebd36d
6 changed files with 2 additions and 58 deletions
|
|
@ -21,16 +21,9 @@
|
||||||
your experience.
|
your experience.
|
||||||
</p>
|
</p>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
<<<<<<< HEAD
|
|
||||||
<nav>
|
|
||||||
<ol id="level-lists">
|
|
||||||
</ol>
|
|
||||||
</nav>
|
|
||||||
=======
|
|
||||||
<div id="timer">Time</div>
|
<div id="timer">Time</div>
|
||||||
<button id="Pause" onclick="Pause()">Pause</button>
|
<button id="Pause" onclick="Pause()">Pause</button>
|
||||||
<canvas id="canvas" width="800" height="400"></canvas>
|
<canvas id="canvas" width="800" height="400"></canvas>
|
||||||
>>>>>>> 380cebd36dc4e3a1f3af185d1a7e3f0adb3e04d1
|
|
||||||
<div class="to-center">
|
<div class="to-center">
|
||||||
<canvas id="canvas" width="800" height="400"></canvas>
|
<canvas id="canvas" width="800" height="400"></canvas>
|
||||||
<div class="text-bubble">
|
<div class="text-bubble">
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
import { levelsBlueprint } from '/modules/levels.mjs'
|
|
||||||
|
|
||||||
export const fillLevelSelection = () => {
|
|
||||||
let levelList = document.getElementById('level-list');
|
|
||||||
for (let i = 0; i < levelsBlueprint.size; ++i) {
|
|
||||||
let listElement = document.createElement("li");
|
|
||||||
let selectionButton = document.createElement("button");
|
|
||||||
selectionButton.setAttribute("array-index", index);
|
|
||||||
// selectionButton.addEventListener
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,18 +1,12 @@
|
||||||
import { Square } from '/modules/enums.mjs';
|
import { Square } from '/modules/enums.mjs';
|
||||||
|
|
||||||
// Blueprint for the first level
|
// Blueprint for the first level
|
||||||
//
|
export const level1Blueprint = [[ Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall ],
|
||||||
const level1Blueprint = [[ Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall ],
|
|
||||||
[ Square.Wall, Square.Destination, Square.Box, Square.Floor, Square.Player, Square.Wall ],
|
[ Square.Wall, Square.Destination, Square.Box, Square.Floor, Square.Player, Square.Wall ],
|
||||||
[ Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall ]];
|
[ Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall ]];
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
const level2Blueprint = [
|
|
||||||
=======
|
|
||||||
|
|
||||||
// Blueprint for the second level
|
// Blueprint for the second level
|
||||||
export const level2Blueprint = [
|
export const level2Blueprint = [
|
||||||
>>>>>>> 380cebd36dc4e3a1f3af185d1a7e3f0adb3e04d1
|
|
||||||
[Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Floor, Square.Floor ],
|
[Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Floor, Square.Floor ],
|
||||||
[Square.Wall, Square.Destination, Square.Destination, Square.Floor, Square.Floor, Square.Wall, Square.Floor, Square.Floor, Square.Floor, Square.Floor, Square.Floor, Square.Wall, Square.Wall, Square.Wall],
|
[Square.Wall, Square.Destination, Square.Destination, Square.Floor, Square.Floor, Square.Wall, Square.Floor, Square.Floor, Square.Floor, Square.Floor, Square.Floor, Square.Wall, Square.Wall, Square.Wall],
|
||||||
[Square.Wall, Square.Destination, Square.Destination, Square.Floor, Square.Floor, Square.Wall, Square.Floor, Square.Box, Square.Floor, Square.Floor, Square.Box, Square.Floor, Square.Floor, Square.Wall],
|
[Square.Wall, Square.Destination, Square.Destination, Square.Floor, Square.Floor, Square.Wall, Square.Floor, Square.Box, Square.Floor, Square.Floor, Square.Box, Square.Floor, Square.Floor, Square.Wall],
|
||||||
|
|
@ -24,8 +18,3 @@ export const level2Blueprint = [
|
||||||
[Square.Floor, Square.Floor, Square.Wall, Square.Floor, Square.Floor, Square.Floor, Square.Floor, Square.Wall, Square.Floor, Square.Floor, Square.Floor, Square.Floor, Square.Floor, Square.Wall ],
|
[Square.Floor, Square.Floor, Square.Wall, Square.Floor, Square.Floor, Square.Floor, Square.Floor, Square.Wall, Square.Floor, Square.Floor, Square.Floor, Square.Floor, Square.Floor, Square.Wall ],
|
||||||
[Square.Floor, Square.Floor, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall ],
|
[Square.Floor, Square.Floor, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall ],
|
||||||
];
|
];
|
||||||
|
|
||||||
export const levelsBlueprint = [
|
|
||||||
level1Blueprint,
|
|
||||||
level2Blueprint,
|
|
||||||
]
|
|
||||||
|
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
# Implementation
|
|
||||||
|
|
||||||
```js
|
|
||||||
|
|
||||||
enum BackgroundTile {Wall, Floor, Destination};
|
|
||||||
enum ForegroundTile {Player, Box, Empty};
|
|
||||||
|
|
||||||
let playground = {
|
|
||||||
background<Layer, BackgroundTile>: {
|
|
||||||
tiles<BackgroundTile>: [[]]
|
|
||||||
},
|
|
||||||
foreground<Layer, ForegroundTile>: {
|
|
||||||
tiles<ForegroundTile>: [[]]
|
|
||||||
},
|
|
||||||
move(sourcePos, destPos) {
|
|
||||||
if (this.move(destPos, ))
|
|
||||||
}
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
@ -1,17 +1,11 @@
|
||||||
import { generatePlayground } from '/modules/playground.mjs'
|
import { generatePlayground } from '/modules/playground.mjs'
|
||||||
import {levelsBlueprint } from '/modules/levels.mjs'
|
import { level1Blueprint, level2Blueprint } from '/modules/levels.mjs'
|
||||||
import { MoveDirection } from '/modules/enums.mjs'
|
import { MoveDirection } from '/modules/enums.mjs'
|
||||||
import { fillLevelsSelection } from '/modules/fillLevelsSelection.mjs'
|
|
||||||
|
|
||||||
fillLevelSelection();
|
|
||||||
let canvas = document.getElementById('canvas');
|
let canvas = document.getElementById('canvas');
|
||||||
let ctx = canvas.getContext('2d');
|
let ctx = canvas.getContext('2d');
|
||||||
window.ctx = ctx
|
window.ctx = ctx
|
||||||
<<<<<<< HEAD
|
|
||||||
let playground = generatePlayground(levelsBlueprint[0], canvas.width, canvas.height);
|
|
||||||
=======
|
|
||||||
let playground = generatePlayground(level2Blueprint, canvas.width, canvas.height);
|
let playground = generatePlayground(level2Blueprint, canvas.width, canvas.height);
|
||||||
>>>>>>> 380cebd36dc4e3a1f3af185d1a7e3f0adb3e04d1
|
|
||||||
window.addEventListener("keydown", (event) => {
|
window.addEventListener("keydown", (event) => {
|
||||||
if (!event.defaultPrevented) {
|
if (!event.defaultPrevented) {
|
||||||
switch (event.key) {
|
switch (event.key) {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
body {
|
body {
|
||||||
background-color: var(--main-background-color);
|
background-color: var(--main-background-color);
|
||||||
display: flex;
|
display: flex;
|
||||||
color: --main-invert-color;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialog {
|
.dialog {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue