summaryrefslogtreecommitdiff
path: root/src/entities/hello_kitty/bullet.js
diff options
context:
space:
mode:
authorniliara-edu <nil.jimeno@estudiant.fjaverianas.com>2024-12-27 18:30:10 +0100
committerniliara-edu <nil.jimeno@estudiant.fjaverianas.com>2024-12-27 18:30:10 +0100
commit0696b94962a0571fad54844f137dca025df4563b (patch)
tree8aeff72e8fc46a7dab2b2f556febd962e3f67e4b /src/entities/hello_kitty/bullet.js
parent474a7253b6b67e2ed33936f6b633587d5d304b66 (diff)
game finished, only assets left
Diffstat (limited to 'src/entities/hello_kitty/bullet.js')
-rw-r--r--src/entities/hello_kitty/bullet.js12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/entities/hello_kitty/bullet.js b/src/entities/hello_kitty/bullet.js
index 1caeb7c..80ad2dd 100644
--- a/src/entities/hello_kitty/bullet.js
+++ b/src/entities/hello_kitty/bullet.js
@@ -1,8 +1,6 @@
import { HELLO_KITTY } from "../../assets.js"
import { Vector } from "../../engine/vector.js"
-import { Engine } from "../../engine.js"
import { Entity } from "../entity.js"
-import { boshy } from "../../main.js"
import { BulletParticle } from "./bullet_particles.js"
export class Bullet extends Entity {
@@ -23,7 +21,7 @@ export class Bullet extends Entity {
this.spinning = spinning
this.velocity = Vector.fromDeg(degrees)
this.velocity.multiply(speed)
- this.velocity.floor()
+ // this.velocity.floor()
this.gravity = gravity
@@ -48,11 +46,7 @@ export class Bullet extends Entity {
if (this.spinning) this.rotation += this.spinSpeed
- if (Engine.collision.collidingWithBoshy(this.position, this.hitbox)) {
- boshy.die()
- }
- if (Engine.screen.isOffLimits(this.position, this.size)) {
- this.remove()
- }
+ this.updateAsHazard()
+ this.checkBounds()
}
}