From 0696b94962a0571fad54844f137dca025df4563b Mon Sep 17 00:00:00 2001 From: niliara-edu Date: Fri, 27 Dec 2024 18:30:10 +0100 Subject: game finished, only assets left --- src/entities/hello_kitty/bullet.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/entities/hello_kitty/bullet.js') 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() } } -- cgit v1.2.3