updated README.md and created res directory
This commit is contained in:
parent
3860999a73
commit
e93225377f
7 changed files with 29 additions and 14 deletions
15
README.md
15
README.md
|
@ -1,3 +1,18 @@
|
|||
# Sokoban
|
||||
|
||||
projet Web 3Mic
|
||||
|
||||
pour ouvrir le projet, tapez la commande suivante dans un terminal:
|
||||
|
||||
``` sh
|
||||
npx serve
|
||||
```
|
||||
|
||||
si cela ne marche pas, essayez
|
||||
|
||||
``` sh
|
||||
python3 -m http.server
|
||||
```
|
||||
|
||||
Puis allez à l'addresse indiquée par npx (ou http://0.0.0.0:8000 pour __python__)
|
||||
|
||||
|
|
BIN
mario.png
BIN
mario.png
Binary file not shown.
Before Width: | Height: | Size: 263 KiB |
|
@ -1,4 +1,4 @@
|
|||
import { Square } from './enums.mjs';
|
||||
import { Square } from '/modules/enums.mjs';
|
||||
|
||||
// Blueprint for the first level
|
||||
export const level1Blueprint = [[ Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall ],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Square, CanMove, MoveDirection } from './enums.mjs'
|
||||
import { Position, copyPosition } from './position.mjs'
|
||||
import { ForegroundTile, BackgroundTile } from './tiles.mjs'
|
||||
import { Square, CanMove, MoveDirection } from '/modules/enums.mjs'
|
||||
import { Position, copyPosition } from '/modules/position.mjs'
|
||||
import { ForegroundTile, BackgroundTile } from '/modules/tiles.mjs'
|
||||
|
||||
// define where the player can move
|
||||
// generate a level Object from a blueprint
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
export const images = {
|
||||
wall: 'wall.png',
|
||||
floor: 'floor.png',
|
||||
player: 'mario.png',
|
||||
box: 'box.png',
|
||||
destination: 'destination.png',
|
||||
empty: 'empty.png',
|
||||
wall: '/res/wall.png',
|
||||
floor: '/res/floor.png',
|
||||
player: '/res/mario.png',
|
||||
box: '/res/box.png',
|
||||
destination: '/res/destination.png',
|
||||
empty: '/res/empty.png',
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { images } from './ressources.mjs';
|
||||
import { CanMove, Square } from './enums.mjs';
|
||||
import { images } from '/modules/ressources.mjs';
|
||||
import { CanMove, Square } from '/modules/enums.mjs';
|
||||
|
||||
class Tile {
|
||||
constructor(x, y, width, height) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { generatePlayground } from './modules/playground.mjs'
|
||||
import { level1Blueprint } from './modules/levels.mjs'
|
||||
import { generatePlayground } from '/modules/playground.mjs'
|
||||
import { level1Blueprint } from '/modules/levels.mjs'
|
||||
|
||||
let canvas = document.getElementById('canvas');
|
||||
let ctx = canvas.getContext('2d');
|
||||
|
|
Loading…
Reference in a new issue