summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/assets.js5
-rw-r--r--src/engine/screen.js14
-rw-r--r--src/entities/bigdump.js3
3 files changed, 1 insertions, 21 deletions
diff --git a/src/assets.js b/src/assets.js
index 6becf4e..2828fc3 100644
--- a/src/assets.js
+++ b/src/assets.js
@@ -1,6 +1,5 @@
export const BOSHY = {
- NORMAL: "./assets/sprites/boshy1.png",
- DAMAGED:"./assets/sprites/boshy2.png",
+ NORMAL: "./assets/sprites/boshy.png",
BULLET: "./assets/sprites/boshy_bullet.png",
BLOOD: "./assets/sprites/blood.png",
@@ -17,8 +16,6 @@ export const BOSHY = {
}
export const BACKGROUND = {
- DEFAULT: "./assets/sprites/black_background.png",
- DARK_SUN: "./assets/sprites/black_sun_background.png",
KITTY: "./assets/sprites/hello_kitty_bg.png",
}
diff --git a/src/engine/screen.js b/src/engine/screen.js
index b1da92d..0cc4a8f 100644
--- a/src/engine/screen.js
+++ b/src/engine/screen.js
@@ -1,5 +1,4 @@
import { Vector } from "./vector.js"
-import { BACKGROUND } from "../assets.js"
export class Screen {
viewport = new Vector(650, 500)
@@ -13,7 +12,6 @@ export class Screen {
createHTMLElements() {
this.div
- this.background
this.spawn
/* create main div */
@@ -22,14 +20,6 @@ export class Screen {
this.div.style.backgroundColor = "black"
this.div.style.zIndex = -11
- /* create background image */
- this.background = document.createElement("img")
- this.background.className = "background"
- this.background.src = `${BACKGROUND.DEFAULT}`
- this.background.style.visibility = "hidden"
- this.background.style.zIndex = -10
- this.div.appendChild(this.background)
-
/* create relative div to append children */
this.spawn = document.createElement("div")
this.div.appendChild(this.spawn)
@@ -84,10 +74,6 @@ export class Screen {
span.style.rotate = `${rotation}deg`
}
- setBackground(img) { this.background.src = img }
- showBackground() { this.background.visibility = "visible" }
- hideBackground() { this.background.visibility = "hidden" }
-
isOffLimits(position, size) {
return (
position.x + size.x / 2 < 0 ||
diff --git a/src/entities/bigdump.js b/src/entities/bigdump.js
index d7a20ba..545aab5 100644
--- a/src/entities/bigdump.js
+++ b/src/entities/bigdump.js
@@ -30,8 +30,5 @@ export class BigDump extends Entity {
this.updateAsHazard()
this.checkBounds()
- if (Engine.screen.isOffLimits(this.position, this.size)) {
- this.remove()
- }
}
}