"witches do not lie"
This commit is contained in:
parent
53f8d61de0
commit
754c863e60
@ -1,9 +1,29 @@
|
|||||||
import * as PIXI from "pixi.js";
|
import * as PIXI from "pixi.js";
|
||||||
|
import { Tower } from "./Tower.ts";
|
||||||
|
|
||||||
|
export enum CellType {
|
||||||
|
Path,
|
||||||
|
NoBuild,
|
||||||
|
Build,
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Cell {
|
||||||
|
public x: number;
|
||||||
|
public y: number;
|
||||||
|
public type: CellType;
|
||||||
|
public tower: Tower;
|
||||||
|
constructor(x, y, type) {
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class Grid {
|
export class Grid {
|
||||||
public rows: number;
|
public rows: number;
|
||||||
public columns: number;
|
public columns: number;
|
||||||
public gridObject: PIXI.Container;
|
public gridObject: PIXI.Container;
|
||||||
|
public cells: Array<Cell>;
|
||||||
constructor(x, y, width, height, rows, columns) {
|
constructor(x, y, width, height, rows, columns) {
|
||||||
this.rows = rows;
|
this.rows = rows;
|
||||||
this.columns = columns;
|
this.columns = columns;
|
||||||
@ -13,6 +33,9 @@ export class Grid {
|
|||||||
x: x,
|
x: x,
|
||||||
y: y,
|
y: y,
|
||||||
});
|
});
|
||||||
|
for (let index = 0; index < rows * columns; index++) {
|
||||||
|
// const cell = new Cell();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getPixelScalingFactor() {
|
getPixelScalingFactor() {
|
||||||
@ -24,6 +47,7 @@ export class Grid {
|
|||||||
gridUnitsToPixels(amount: number): number {
|
gridUnitsToPixels(amount: number): number {
|
||||||
return amount * this.getPixelScalingFactor();
|
return amount * this.getPixelScalingFactor();
|
||||||
}
|
}
|
||||||
|
|
||||||
pixelsToGridUnits(pixels: number): number {
|
pixelsToGridUnits(pixels: number): number {
|
||||||
return pixels / this.getPixelScalingFactor();
|
return pixels / this.getPixelScalingFactor();
|
||||||
}
|
}
|
||||||
|
1
src/classes/Tower.ts
Normal file
1
src/classes/Tower.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export class Tower {}
|
Loading…
x
Reference in New Issue
Block a user