| 1 | class FloorTile extends GameObject{ |
| 2 | |
| 3 | constructor(x,y,sprite,layer) |
| 4 | { |
| 5 | super(x,y,sprite,layer); |
| 6 | this.collider.enabled = true; |
| 7 | } |
| 8 | |
| 9 | update(deltaTime) |
| 10 | { |
| 11 | super.update(deltaTime); |
| 12 | |
| 13 | if(GameInput.mousePressed(GameInput.MouseButtons.Left)) |
| 14 | { |
| 15 | if(this.collider.isInBounds(new vector(GameInput.mousePosition.x - this.scene.real_position.x, GameInput.mousePosition.y - this.scene.real_position.y))) { |
| 16 | this.scene.addObject(new FloorTileDestroyer(this.transform.position.x, this.transform.position.y, this.scene.game.images.tile_floor_explosion,0, .05, true)); |
| 17 | this.destroy(); |
| 18 | } |
| 19 | } |
| 20 | } |
| 21 | } |