Compare commits

..

No commits in common. "0788e071b218e807b6c998fa35f8a4c074c4f8e3" and "3860999a736cb350e2e20593a7687de4a2953c56" have entirely different histories.

7 changed files with 14 additions and 29 deletions

View file

@ -1,18 +1,3 @@
# Sokoban # Sokoban
projet Web 3Mic 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__)

View file

Before

Width:  |  Height:  |  Size: 263 KiB

After

Width:  |  Height:  |  Size: 263 KiB

View file

@ -1,4 +1,4 @@
import { Square } from '/modules/enums.mjs'; import { Square } from './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 ], export const level1Blueprint = [[ Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall, Square.Wall ],

View file

@ -1,6 +1,6 @@
import { Square, CanMove, MoveDirection } from '/modules/enums.mjs' import { Square, CanMove, MoveDirection } from './enums.mjs'
import { Position, copyPosition } from '/modules/position.mjs' import { Position, copyPosition } from './position.mjs'
import { ForegroundTile, BackgroundTile } from '/modules/tiles.mjs' import { ForegroundTile, BackgroundTile } from './tiles.mjs'
// define where the player can move // define where the player can move
// generate a level Object from a blueprint // generate a level Object from a blueprint

View file

@ -1,8 +1,8 @@
export const images = { export const images = {
wall: '/res/wall.png', wall: 'wall.png',
floor: '/res/floor.png', floor: 'floor.png',
player: '/res/mario.png', player: 'mario.png',
box: '/res/box.png', box: 'box.png',
destination: '/res/destination.png', destination: 'destination.png',
empty: '/res/empty.png', empty: 'empty.png',
}; };

View file

@ -1,5 +1,5 @@
import { images } from '/modules/ressources.mjs'; import { images } from './ressources.mjs';
import { CanMove, Square } from '/modules/enums.mjs'; import { CanMove, Square } from './enums.mjs';
class Tile { class Tile {
constructor(x, y, width, height) { constructor(x, y, width, height) {

View file

@ -1,5 +1,5 @@
import { generatePlayground } from '/modules/playground.mjs' import { generatePlayground } from './modules/playground.mjs'
import { level1Blueprint } from '/modules/levels.mjs' import { level1Blueprint } from './modules/levels.mjs'
let canvas = document.getElementById('canvas'); let canvas = document.getElementById('canvas');
let ctx = canvas.getContext('2d'); let ctx = canvas.getContext('2d');