BlueGit

blue-star speeltuin

Files

speeltuin / src / minigame / frog / floorTile.js

floorTile.js

tile explosion
timfa wsadhelios · pushed by timfa · 4 years ago
d12b84a6 History
floorTile.js 697 B Download Raw
1class 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}