blob: 545aab5660b15a61be41b1e3de9e9b2750934df4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
import { ANTICHEESE } from "../assets.js"
import { Vector } from "../engine/vector.js"
import { Engine } from "../engine.js"
import { Entity } from "./entity.js"
import { boshy } from "../main.js"
export class BigDump extends Entity {
constructor(bottom = false) {
let position = bottom ?
new Vector(0, boshy.position.y) :
new Vector(boshy.position.x, 0)
super({
size: new Vector(200, 10),
position: position,
sprite: ANTICHEESE,
degrees: bottom ? 270 : 0,
})
this.bottom = bottom
}
speed = 10
maxSize = 200
update() {
if (this.size.y < this.maxSize) this.size.y += this.speed * 0.75
if (this.bottom) this.position.x += this.speed
else this.position.y += this.speed
this.updateAsHazard()
this.checkBounds()
}
}
|