[Prototype] Work with collision and new level parse
This commit is contained in:
parent
500435798f
commit
e1a909b728
20
public/stages/stage-1.json
Normal file
20
public/stages/stage-1.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "1",
|
||||
"difficulty": 1,
|
||||
"map": [
|
||||
"X X X X X X X X X X X X X ",
|
||||
"X Bf X Bf X Bf X Bf X Bf X Bf X ",
|
||||
"X Bf X Bf X Bf X Bf X Bf X Bf X ",
|
||||
"X Bf X Bf X Bf Tf Bf X Bf X Bf X ",
|
||||
"X Bf X Bf X B3 X B3 X Bf X Bf X ",
|
||||
"X B3 X B3 X Bc X Bc X B3 X B3 X ",
|
||||
"Bc X Bc Bc X B3 X B3 X Bc Bc X Bc ",
|
||||
"T3 X B3 B3 X Bc X Bc X B3 B3 X T3 ",
|
||||
"X Bc X Bc X Bf Bf Bf X Bc X Bc X ",
|
||||
"X Bf X Bf X Bf X Bf X Bf X Bf X ",
|
||||
"X Bf X Bf X B3 X B3 X Bf X Bf X ",
|
||||
"X Bf X Bf X B8 Bc B4 X Bf X Bf X ",
|
||||
"X X X X X Ba E B5 X X X X X "
|
||||
],
|
||||
"bots": ["18*basic", "2*fast"]
|
||||
}
|
||||
20
src/Blocks/block.js
Normal file
20
src/Blocks/block.js
Normal file
@ -0,0 +1,20 @@
|
||||
class Block {
|
||||
constructor(width, height, xBox, yBox, wBox, hBox, tile) {
|
||||
this._width = width;
|
||||
this._height = height;
|
||||
this._xBox = xBox;
|
||||
this._yBox = yBox;
|
||||
this._wBox = wBox;
|
||||
this._hBox = hBox;
|
||||
this._tile = tile;
|
||||
}
|
||||
|
||||
|
||||
draw(ctx, x, y){
|
||||
ctx.drawImage(tile, x, y);
|
||||
}
|
||||
|
||||
resolveAttack(){
|
||||
return;
|
||||
}
|
||||
}
|
||||
7
src/Blocks/brick.js
Normal file
7
src/Blocks/brick.js
Normal file
@ -0,0 +1,7 @@
|
||||
class Brick extends Block {
|
||||
constructor(width, height, xBox, yBox, wBox, hBox, tile) {
|
||||
super(width, height, xBox, yBox, wBox, hBox, tile);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
7
src/Blocks/eagle.js
Normal file
7
src/Blocks/eagle.js
Normal file
@ -0,0 +1,7 @@
|
||||
class Eagle extends Block {
|
||||
constructor(width, height, xBox, yBox, wBox, hBox, tile) {
|
||||
super(width, height, xBox, yBox, wBox, hBox, tile);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
7
src/Blocks/iron.js
Normal file
7
src/Blocks/iron.js
Normal file
@ -0,0 +1,7 @@
|
||||
class Iron extends Block {
|
||||
constructor(width, height, xBox, yBox, wBox, hBox, tile) {
|
||||
super(width, height, xBox, yBox, wBox, hBox, tile);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
7
src/Blocks/river.js
Normal file
7
src/Blocks/river.js
Normal file
@ -0,0 +1,7 @@
|
||||
class River extends Block {
|
||||
constructor(width, height, xBox, yBox, wBox, hBox, tile) {
|
||||
super(width, height, xBox, yBox, wBox, hBox, tile);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user