summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorniliara-edu <nil.jimeno@estudiant.fjaverianas.com>2024-12-23 18:32:29 +0100
committerniliara-edu <nil.jimeno@estudiant.fjaverianas.com>2024-12-23 18:32:29 +0100
commita840990bdcabf45fb0d377478ba0ab27222434ae (patch)
tree030a6c3a6befce284733f5643d3972e3a1504bb2
initial commit
-rw-r--r--.gitignore1
-rw-r--r--.ignore1
-rw-r--r--assets/ase/boshy.asebin0 -> 841 bytes
-rw-r--r--assets/music/Ace Combat Megalith.oggbin0 -> 3047708 bytes
-rw-r--r--assets/music/loludied.oggbin0 -> 629247 bytes
-rw-r--r--assets/music/terranigma-theunderworld.oggbin0 -> 493580 bytes
-rw-r--r--assets/sounds/AHHHHHHHHHHHHHHHHHHHHHHHHHHHH.oggbin0 -> 20751 bytes
-rw-r--r--assets/sounds/Awww.oggbin0 -> 11267 bytes
-rw-r--r--assets/sounds/BLAAHLouder.oggbin0 -> 28662 bytes
-rw-r--r--assets/sounds/ItsBOSHYtime.oggbin0 -> 34405 bytes
-rw-r--r--assets/sounds/Noho (2).oggbin0 -> 9284 bytes
-rw-r--r--assets/sounds/SF33RD_0014.wavbin0 -> 54338 bytes
-rw-r--r--assets/sounds/SF33RD_0054.wavbin0 -> 75058 bytes
-rw-r--r--assets/sounds/Small_Explosion.oggbin0 -> 5591 bytes
-rw-r--r--assets/sounds/SoFuckingClose.oggbin0 -> 15495 bytes
-rw-r--r--assets/sounds/Solgryn_OMNOMNOM.oggbin0 -> 12389 bytes
-rw-r--r--assets/sounds/Solgryn_roar.oggbin0 -> 44412 bytes
-rw-r--r--assets/sounds/Solgryn_shoot (2).oggbin0 -> 5174 bytes
-rw-r--r--assets/sounds/alien bomb explosion 2.oggbin0 -> 20239 bytes
-rw-r--r--assets/sounds/alien explosion.oggbin0 -> 24327 bytes
-rw-r--r--assets/sounds/alienbomb explosion.oggbin0 -> 24565 bytes
-rw-r--r--assets/sounds/hyperbeam.oggbin0 -> 18400 bytes
-rw-r--r--assets/sounds/nooooooooooooooooooooooooooooooooo (2).oggbin0 -> 38339 bytes
-rw-r--r--assets/sounds/shoot.oggbin0 -> 12424 bytes
-rw-r--r--assets/sounds/slag.oggbin0 -> 6866 bytes
-rw-r--r--assets/sounds/solgryn_laser.oggbin0 -> 31572 bytes
-rw-r--r--assets/sounds/solgryn_shielf_hurt.oggbin0 -> 4532 bytes
-rw-r--r--assets/sounds/splash.oggbin0 -> 7017 bytes
-rw-r--r--assets/sounds/teleport (2).oggbin0 -> 7853 bytes
-rw-r--r--assets/sounds/teleport (3).oggbin0 -> 14903 bytes
-rw-r--r--assets/sprites/bigexplosion1.pngbin0 -> 24405 bytes
-rw-r--r--assets/sprites/bigexplosion10.pngbin0 -> 64286 bytes
-rw-r--r--assets/sprites/bigexplosion11.pngbin0 -> 65197 bytes
-rw-r--r--assets/sprites/bigexplosion12.pngbin0 -> 66401 bytes
-rw-r--r--assets/sprites/bigexplosion13.pngbin0 -> 67009 bytes
-rw-r--r--assets/sprites/bigexplosion14.pngbin0 -> 63085 bytes
-rw-r--r--assets/sprites/bigexplosion15.pngbin0 -> 55984 bytes
-rw-r--r--assets/sprites/bigexplosion16.pngbin0 -> 50544 bytes
-rw-r--r--assets/sprites/bigexplosion17.pngbin0 -> 27150 bytes
-rw-r--r--assets/sprites/bigexplosion18.pngbin0 -> 8547 bytes
-rw-r--r--assets/sprites/bigexplosion19.pngbin0 -> 1706 bytes
-rw-r--r--assets/sprites/bigexplosion2.pngbin0 -> 33743 bytes
-rw-r--r--assets/sprites/bigexplosion3.pngbin0 -> 43339 bytes
-rw-r--r--assets/sprites/bigexplosion4.pngbin0 -> 50024 bytes
-rw-r--r--assets/sprites/bigexplosion5.pngbin0 -> 54689 bytes
-rw-r--r--assets/sprites/bigexplosion6.pngbin0 -> 57512 bytes
-rw-r--r--assets/sprites/bigexplosion7.pngbin0 -> 59234 bytes
-rw-r--r--assets/sprites/bigexplosion8.pngbin0 -> 60422 bytes
-rw-r--r--assets/sprites/bigexplosion9.pngbin0 -> 61462 bytes
-rw-r--r--assets/sprites/black_background.pngbin0 -> 87884 bytes
-rw-r--r--assets/sprites/black_sun_background.pngbin0 -> 206606 bytes
-rw-r--r--assets/sprites/boshy1.pngbin0 -> 630 bytes
-rw-r--r--assets/sprites/boshy2.pngbin0 -> 658 bytes
-rw-r--r--assets/sprites/boshy_bullet.pngbin0 -> 93 bytes
-rw-r--r--assets/sprites/explosion1.pngbin0 -> 1679 bytes
-rw-r--r--assets/sprites/explosion2.pngbin0 -> 1401 bytes
-rw-r--r--assets/sprites/explosion3.pngbin0 -> 744 bytes
-rw-r--r--assets/sprites/nomnomnom1.pngbin0 -> 74882 bytes
-rw-r--r--assets/sprites/nomnomnom2.pngbin0 -> 91296 bytes
-rw-r--r--assets/sprites/nomnomnom3.pngbin0 -> 95511 bytes
-rw-r--r--assets/sprites/oatmeal1.pngbin0 -> 1202 bytes
-rw-r--r--assets/sprites/oatmeal2.pngbin0 -> 2190 bytes
-rw-r--r--assets/sprites/oatmeal3.pngbin0 -> 1861 bytes
-rw-r--r--assets/sprites/openanimation1.pngbin0 -> 12482 bytes
-rw-r--r--assets/sprites/openanimation10.pngbin0 -> 12141 bytes
-rw-r--r--assets/sprites/openanimation11.pngbin0 -> 12146 bytes
-rw-r--r--assets/sprites/openanimation12.pngbin0 -> 12057 bytes
-rw-r--r--assets/sprites/openanimation2.pngbin0 -> 12482 bytes
-rw-r--r--assets/sprites/openanimation3.pngbin0 -> 12411 bytes
-rw-r--r--assets/sprites/openanimation4.pngbin0 -> 12411 bytes
-rw-r--r--assets/sprites/openanimation5.pngbin0 -> 12420 bytes
-rw-r--r--assets/sprites/openanimation6.pngbin0 -> 12319 bytes
-rw-r--r--assets/sprites/openanimation7.pngbin0 -> 12322 bytes
-rw-r--r--assets/sprites/openanimation8.pngbin0 -> 12220 bytes
-rw-r--r--assets/sprites/openanimation9.pngbin0 -> 12226 bytes
-rw-r--r--assets/sprites/portal1.pngbin0 -> 31210 bytes
-rw-r--r--assets/sprites/portal10.pngbin0 -> 31279 bytes
-rw-r--r--assets/sprites/portal11.pngbin0 -> 30283 bytes
-rw-r--r--assets/sprites/portal12.pngbin0 -> 30871 bytes
-rw-r--r--assets/sprites/portal13.pngbin0 -> 30976 bytes
-rw-r--r--assets/sprites/portal14.pngbin0 -> 31080 bytes
-rw-r--r--assets/sprites/portal15.pngbin0 -> 30900 bytes
-rw-r--r--assets/sprites/portal2.pngbin0 -> 30895 bytes
-rw-r--r--assets/sprites/portal3.pngbin0 -> 30623 bytes
-rw-r--r--assets/sprites/portal4.pngbin0 -> 31040 bytes
-rw-r--r--assets/sprites/portal5.pngbin0 -> 31202 bytes
-rw-r--r--assets/sprites/portal6.pngbin0 -> 30913 bytes
-rw-r--r--assets/sprites/portal7.pngbin0 -> 31082 bytes
-rw-r--r--assets/sprites/portal8.pngbin0 -> 31050 bytes
-rw-r--r--assets/sprites/portal9.pngbin0 -> 31021 bytes
-rw-r--r--assets/sprites/shitbullet.pngbin0 -> 675 bytes
-rw-r--r--assets/sprites/skylaser1.pngbin0 -> 2870 bytes
-rw-r--r--assets/sprites/skylaser2.pngbin0 -> 5462 bytes
-rw-r--r--assets/sprites/skylaser3.pngbin0 -> 4969 bytes
-rw-r--r--assets/sprites/skylaser4.pngbin0 -> 3297 bytes
-rw-r--r--assets/sprites/skylaser5.pngbin0 -> 4862 bytes
-rw-r--r--assets/sprites/skylaser6.pngbin0 -> 4507 bytes
-rw-r--r--assets/sprites/solgryn.pngbin0 -> 154372 bytes
-rw-r--r--assets/sprites/solgryn_fight.pngbin0 -> 125709 bytes
-rw-r--r--assets/sprites/solgryn_open1.pngbin0 -> 122623 bytes
-rw-r--r--assets/sprites/solgryn_open2.pngbin0 -> 119663 bytes
-rw-r--r--assets/sprites/solgryn_open3.pngbin0 -> 116000 bytes
-rw-r--r--assets/sprites/solgryn_sun.pngbin0 -> 237636 bytes
-rwxr-xr-xcountlines.sh10
-rw-r--r--index.html14
-rw-r--r--index.js32
-rw-r--r--scss/index.scss35
-rw-r--r--src/assets.js22
-rw-r--r--src/engine.js34
-rw-r--r--src/engine/clock.js26
-rw-r--r--src/engine/keyboard.js23
-rw-r--r--src/engine/screen.js87
-rw-r--r--src/engine/vector.js47
-rw-r--r--src/entities/boshy.js65
-rw-r--r--src/entities/boshybullet.js30
-rw-r--r--src/entities/entity.js23
-rw-r--r--src/main.js38
-rw-r--r--src/scenes.js30
-rw-r--r--src/scenes/game.js13
-rw-r--r--src/scenes/prequel.js13
-rw-r--r--style.css30
121 files changed, 574 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..09c2dff
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+BOSHY\ FILES/*
diff --git a/.ignore b/.ignore
new file mode 100644
index 0000000..09c2dff
--- /dev/null
+++ b/.ignore
@@ -0,0 +1 @@
+BOSHY\ FILES/*
diff --git a/assets/ase/boshy.ase b/assets/ase/boshy.ase
new file mode 100644
index 0000000..c751512
--- /dev/null
+++ b/assets/ase/boshy.ase
Binary files differ
diff --git a/assets/music/Ace Combat Megalith.ogg b/assets/music/Ace Combat Megalith.ogg
new file mode 100644
index 0000000..e7302a5
--- /dev/null
+++ b/assets/music/Ace Combat Megalith.ogg
Binary files differ
diff --git a/assets/music/loludied.ogg b/assets/music/loludied.ogg
new file mode 100644
index 0000000..e6b82ec
--- /dev/null
+++ b/assets/music/loludied.ogg
Binary files differ
diff --git a/assets/music/terranigma-theunderworld.ogg b/assets/music/terranigma-theunderworld.ogg
new file mode 100644
index 0000000..92504ca
--- /dev/null
+++ b/assets/music/terranigma-theunderworld.ogg
Binary files differ
diff --git a/assets/sounds/AHHHHHHHHHHHHHHHHHHHHHHHHHHHH.ogg b/assets/sounds/AHHHHHHHHHHHHHHHHHHHHHHHHHHHH.ogg
new file mode 100644
index 0000000..a6628f3
--- /dev/null
+++ b/assets/sounds/AHHHHHHHHHHHHHHHHHHHHHHHHHHHH.ogg
Binary files differ
diff --git a/assets/sounds/Awww.ogg b/assets/sounds/Awww.ogg
new file mode 100644
index 0000000..72ae355
--- /dev/null
+++ b/assets/sounds/Awww.ogg
Binary files differ
diff --git a/assets/sounds/BLAAHLouder.ogg b/assets/sounds/BLAAHLouder.ogg
new file mode 100644
index 0000000..6169d4f
--- /dev/null
+++ b/assets/sounds/BLAAHLouder.ogg
Binary files differ
diff --git a/assets/sounds/ItsBOSHYtime.ogg b/assets/sounds/ItsBOSHYtime.ogg
new file mode 100644
index 0000000..af80104
--- /dev/null
+++ b/assets/sounds/ItsBOSHYtime.ogg
Binary files differ
diff --git a/assets/sounds/Noho (2).ogg b/assets/sounds/Noho (2).ogg
new file mode 100644
index 0000000..e949793
--- /dev/null
+++ b/assets/sounds/Noho (2).ogg
Binary files differ
diff --git a/assets/sounds/SF33RD_0014.wav b/assets/sounds/SF33RD_0014.wav
new file mode 100644
index 0000000..f917a0d
--- /dev/null
+++ b/assets/sounds/SF33RD_0014.wav
Binary files differ
diff --git a/assets/sounds/SF33RD_0054.wav b/assets/sounds/SF33RD_0054.wav
new file mode 100644
index 0000000..ab1926a
--- /dev/null
+++ b/assets/sounds/SF33RD_0054.wav
Binary files differ
diff --git a/assets/sounds/Small_Explosion.ogg b/assets/sounds/Small_Explosion.ogg
new file mode 100644
index 0000000..ae3d702
--- /dev/null
+++ b/assets/sounds/Small_Explosion.ogg
Binary files differ
diff --git a/assets/sounds/SoFuckingClose.ogg b/assets/sounds/SoFuckingClose.ogg
new file mode 100644
index 0000000..e53ee6e
--- /dev/null
+++ b/assets/sounds/SoFuckingClose.ogg
Binary files differ
diff --git a/assets/sounds/Solgryn_OMNOMNOM.ogg b/assets/sounds/Solgryn_OMNOMNOM.ogg
new file mode 100644
index 0000000..80584e5
--- /dev/null
+++ b/assets/sounds/Solgryn_OMNOMNOM.ogg
Binary files differ
diff --git a/assets/sounds/Solgryn_roar.ogg b/assets/sounds/Solgryn_roar.ogg
new file mode 100644
index 0000000..bd0631f
--- /dev/null
+++ b/assets/sounds/Solgryn_roar.ogg
Binary files differ
diff --git a/assets/sounds/Solgryn_shoot (2).ogg b/assets/sounds/Solgryn_shoot (2).ogg
new file mode 100644
index 0000000..0d530a8
--- /dev/null
+++ b/assets/sounds/Solgryn_shoot (2).ogg
Binary files differ
diff --git a/assets/sounds/alien bomb explosion 2.ogg b/assets/sounds/alien bomb explosion 2.ogg
new file mode 100644
index 0000000..4a10eda
--- /dev/null
+++ b/assets/sounds/alien bomb explosion 2.ogg
Binary files differ
diff --git a/assets/sounds/alien explosion.ogg b/assets/sounds/alien explosion.ogg
new file mode 100644
index 0000000..d4c0006
--- /dev/null
+++ b/assets/sounds/alien explosion.ogg
Binary files differ
diff --git a/assets/sounds/alienbomb explosion.ogg b/assets/sounds/alienbomb explosion.ogg
new file mode 100644
index 0000000..02ef2b1
--- /dev/null
+++ b/assets/sounds/alienbomb explosion.ogg
Binary files differ
diff --git a/assets/sounds/hyperbeam.ogg b/assets/sounds/hyperbeam.ogg
new file mode 100644
index 0000000..791933b
--- /dev/null
+++ b/assets/sounds/hyperbeam.ogg
Binary files differ
diff --git a/assets/sounds/nooooooooooooooooooooooooooooooooo (2).ogg b/assets/sounds/nooooooooooooooooooooooooooooooooo (2).ogg
new file mode 100644
index 0000000..e19df63
--- /dev/null
+++ b/assets/sounds/nooooooooooooooooooooooooooooooooo (2).ogg
Binary files differ
diff --git a/assets/sounds/shoot.ogg b/assets/sounds/shoot.ogg
new file mode 100644
index 0000000..e52845d
--- /dev/null
+++ b/assets/sounds/shoot.ogg
Binary files differ
diff --git a/assets/sounds/slag.ogg b/assets/sounds/slag.ogg
new file mode 100644
index 0000000..f1ce2db
--- /dev/null
+++ b/assets/sounds/slag.ogg
Binary files differ
diff --git a/assets/sounds/solgryn_laser.ogg b/assets/sounds/solgryn_laser.ogg
new file mode 100644
index 0000000..1bc6825
--- /dev/null
+++ b/assets/sounds/solgryn_laser.ogg
Binary files differ
diff --git a/assets/sounds/solgryn_shielf_hurt.ogg b/assets/sounds/solgryn_shielf_hurt.ogg
new file mode 100644
index 0000000..baf0f4c
--- /dev/null
+++ b/assets/sounds/solgryn_shielf_hurt.ogg
Binary files differ
diff --git a/assets/sounds/splash.ogg b/assets/sounds/splash.ogg
new file mode 100644
index 0000000..d27a941
--- /dev/null
+++ b/assets/sounds/splash.ogg
Binary files differ
diff --git a/assets/sounds/teleport (2).ogg b/assets/sounds/teleport (2).ogg
new file mode 100644
index 0000000..1655d65
--- /dev/null
+++ b/assets/sounds/teleport (2).ogg
Binary files differ
diff --git a/assets/sounds/teleport (3).ogg b/assets/sounds/teleport (3).ogg
new file mode 100644
index 0000000..c1b69b1
--- /dev/null
+++ b/assets/sounds/teleport (3).ogg
Binary files differ
diff --git a/assets/sprites/bigexplosion1.png b/assets/sprites/bigexplosion1.png
new file mode 100644
index 0000000..947d00a
--- /dev/null
+++ b/assets/sprites/bigexplosion1.png
Binary files differ
diff --git a/assets/sprites/bigexplosion10.png b/assets/sprites/bigexplosion10.png
new file mode 100644
index 0000000..ff2322d
--- /dev/null
+++ b/assets/sprites/bigexplosion10.png
Binary files differ
diff --git a/assets/sprites/bigexplosion11.png b/assets/sprites/bigexplosion11.png
new file mode 100644
index 0000000..dc7abe4
--- /dev/null
+++ b/assets/sprites/bigexplosion11.png
Binary files differ
diff --git a/assets/sprites/bigexplosion12.png b/assets/sprites/bigexplosion12.png
new file mode 100644
index 0000000..1b0bf12
--- /dev/null
+++ b/assets/sprites/bigexplosion12.png
Binary files differ
diff --git a/assets/sprites/bigexplosion13.png b/assets/sprites/bigexplosion13.png
new file mode 100644
index 0000000..3925601
--- /dev/null
+++ b/assets/sprites/bigexplosion13.png
Binary files differ
diff --git a/assets/sprites/bigexplosion14.png b/assets/sprites/bigexplosion14.png
new file mode 100644
index 0000000..96ded1c
--- /dev/null
+++ b/assets/sprites/bigexplosion14.png
Binary files differ
diff --git a/assets/sprites/bigexplosion15.png b/assets/sprites/bigexplosion15.png
new file mode 100644
index 0000000..f1780c3
--- /dev/null
+++ b/assets/sprites/bigexplosion15.png
Binary files differ
diff --git a/assets/sprites/bigexplosion16.png b/assets/sprites/bigexplosion16.png
new file mode 100644
index 0000000..7160306
--- /dev/null
+++ b/assets/sprites/bigexplosion16.png
Binary files differ
diff --git a/assets/sprites/bigexplosion17.png b/assets/sprites/bigexplosion17.png
new file mode 100644
index 0000000..6442f68
--- /dev/null
+++ b/assets/sprites/bigexplosion17.png
Binary files differ
diff --git a/assets/sprites/bigexplosion18.png b/assets/sprites/bigexplosion18.png
new file mode 100644
index 0000000..337e3e3
--- /dev/null
+++ b/assets/sprites/bigexplosion18.png
Binary files differ
diff --git a/assets/sprites/bigexplosion19.png b/assets/sprites/bigexplosion19.png
new file mode 100644
index 0000000..c852418
--- /dev/null
+++ b/assets/sprites/bigexplosion19.png
Binary files differ
diff --git a/assets/sprites/bigexplosion2.png b/assets/sprites/bigexplosion2.png
new file mode 100644
index 0000000..182bc65
--- /dev/null
+++ b/assets/sprites/bigexplosion2.png
Binary files differ
diff --git a/assets/sprites/bigexplosion3.png b/assets/sprites/bigexplosion3.png
new file mode 100644
index 0000000..97d1cb0
--- /dev/null
+++ b/assets/sprites/bigexplosion3.png
Binary files differ
diff --git a/assets/sprites/bigexplosion4.png b/assets/sprites/bigexplosion4.png
new file mode 100644
index 0000000..0018213
--- /dev/null
+++ b/assets/sprites/bigexplosion4.png
Binary files differ
diff --git a/assets/sprites/bigexplosion5.png b/assets/sprites/bigexplosion5.png
new file mode 100644
index 0000000..ead38f3
--- /dev/null
+++ b/assets/sprites/bigexplosion5.png
Binary files differ
diff --git a/assets/sprites/bigexplosion6.png b/assets/sprites/bigexplosion6.png
new file mode 100644
index 0000000..41bf524
--- /dev/null
+++ b/assets/sprites/bigexplosion6.png
Binary files differ
diff --git a/assets/sprites/bigexplosion7.png b/assets/sprites/bigexplosion7.png
new file mode 100644
index 0000000..1302e55
--- /dev/null
+++ b/assets/sprites/bigexplosion7.png
Binary files differ
diff --git a/assets/sprites/bigexplosion8.png b/assets/sprites/bigexplosion8.png
new file mode 100644
index 0000000..f0f07c7
--- /dev/null
+++ b/assets/sprites/bigexplosion8.png
Binary files differ
diff --git a/assets/sprites/bigexplosion9.png b/assets/sprites/bigexplosion9.png
new file mode 100644
index 0000000..9c6cb34
--- /dev/null
+++ b/assets/sprites/bigexplosion9.png
Binary files differ
diff --git a/assets/sprites/black_background.png b/assets/sprites/black_background.png
new file mode 100644
index 0000000..7926ec7
--- /dev/null
+++ b/assets/sprites/black_background.png
Binary files differ
diff --git a/assets/sprites/black_sun_background.png b/assets/sprites/black_sun_background.png
new file mode 100644
index 0000000..62fb81c
--- /dev/null
+++ b/assets/sprites/black_sun_background.png
Binary files differ
diff --git a/assets/sprites/boshy1.png b/assets/sprites/boshy1.png
new file mode 100644
index 0000000..dd1a996
--- /dev/null
+++ b/assets/sprites/boshy1.png
Binary files differ
diff --git a/assets/sprites/boshy2.png b/assets/sprites/boshy2.png
new file mode 100644
index 0000000..cdc24c0
--- /dev/null
+++ b/assets/sprites/boshy2.png
Binary files differ
diff --git a/assets/sprites/boshy_bullet.png b/assets/sprites/boshy_bullet.png
new file mode 100644
index 0000000..95b89b3
--- /dev/null
+++ b/assets/sprites/boshy_bullet.png
Binary files differ
diff --git a/assets/sprites/explosion1.png b/assets/sprites/explosion1.png
new file mode 100644
index 0000000..4164985
--- /dev/null
+++ b/assets/sprites/explosion1.png
Binary files differ
diff --git a/assets/sprites/explosion2.png b/assets/sprites/explosion2.png
new file mode 100644
index 0000000..7d1e6b1
--- /dev/null
+++ b/assets/sprites/explosion2.png
Binary files differ
diff --git a/assets/sprites/explosion3.png b/assets/sprites/explosion3.png
new file mode 100644
index 0000000..9552877
--- /dev/null
+++ b/assets/sprites/explosion3.png
Binary files differ
diff --git a/assets/sprites/nomnomnom1.png b/assets/sprites/nomnomnom1.png
new file mode 100644
index 0000000..50781a1
--- /dev/null
+++ b/assets/sprites/nomnomnom1.png
Binary files differ
diff --git a/assets/sprites/nomnomnom2.png b/assets/sprites/nomnomnom2.png
new file mode 100644
index 0000000..2d5f5b7
--- /dev/null
+++ b/assets/sprites/nomnomnom2.png
Binary files differ
diff --git a/assets/sprites/nomnomnom3.png b/assets/sprites/nomnomnom3.png
new file mode 100644
index 0000000..a526060
--- /dev/null
+++ b/assets/sprites/nomnomnom3.png
Binary files differ
diff --git a/assets/sprites/oatmeal1.png b/assets/sprites/oatmeal1.png
new file mode 100644
index 0000000..0a088a2
--- /dev/null
+++ b/assets/sprites/oatmeal1.png
Binary files differ
diff --git a/assets/sprites/oatmeal2.png b/assets/sprites/oatmeal2.png
new file mode 100644
index 0000000..9c1f340
--- /dev/null
+++ b/assets/sprites/oatmeal2.png
Binary files differ
diff --git a/assets/sprites/oatmeal3.png b/assets/sprites/oatmeal3.png
new file mode 100644
index 0000000..c633671
--- /dev/null
+++ b/assets/sprites/oatmeal3.png
Binary files differ
diff --git a/assets/sprites/openanimation1.png b/assets/sprites/openanimation1.png
new file mode 100644
index 0000000..d9a9d07
--- /dev/null
+++ b/assets/sprites/openanimation1.png
Binary files differ
diff --git a/assets/sprites/openanimation10.png b/assets/sprites/openanimation10.png
new file mode 100644
index 0000000..4623096
--- /dev/null
+++ b/assets/sprites/openanimation10.png
Binary files differ
diff --git a/assets/sprites/openanimation11.png b/assets/sprites/openanimation11.png
new file mode 100644
index 0000000..f83602c
--- /dev/null
+++ b/assets/sprites/openanimation11.png
Binary files differ
diff --git a/assets/sprites/openanimation12.png b/assets/sprites/openanimation12.png
new file mode 100644
index 0000000..f474274
--- /dev/null
+++ b/assets/sprites/openanimation12.png
Binary files differ
diff --git a/assets/sprites/openanimation2.png b/assets/sprites/openanimation2.png
new file mode 100644
index 0000000..ec233db
--- /dev/null
+++ b/assets/sprites/openanimation2.png
Binary files differ
diff --git a/assets/sprites/openanimation3.png b/assets/sprites/openanimation3.png
new file mode 100644
index 0000000..75afbdc
--- /dev/null
+++ b/assets/sprites/openanimation3.png
Binary files differ
diff --git a/assets/sprites/openanimation4.png b/assets/sprites/openanimation4.png
new file mode 100644
index 0000000..a811db2
--- /dev/null
+++ b/assets/sprites/openanimation4.png
Binary files differ
diff --git a/assets/sprites/openanimation5.png b/assets/sprites/openanimation5.png
new file mode 100644
index 0000000..c901040
--- /dev/null
+++ b/assets/sprites/openanimation5.png
Binary files differ
diff --git a/assets/sprites/openanimation6.png b/assets/sprites/openanimation6.png
new file mode 100644
index 0000000..442a798
--- /dev/null
+++ b/assets/sprites/openanimation6.png
Binary files differ
diff --git a/assets/sprites/openanimation7.png b/assets/sprites/openanimation7.png
new file mode 100644
index 0000000..dccaba0
--- /dev/null
+++ b/assets/sprites/openanimation7.png
Binary files differ
diff --git a/assets/sprites/openanimation8.png b/assets/sprites/openanimation8.png
new file mode 100644
index 0000000..b7bf1bc
--- /dev/null
+++ b/assets/sprites/openanimation8.png
Binary files differ
diff --git a/assets/sprites/openanimation9.png b/assets/sprites/openanimation9.png
new file mode 100644
index 0000000..a415644
--- /dev/null
+++ b/assets/sprites/openanimation9.png
Binary files differ
diff --git a/assets/sprites/portal1.png b/assets/sprites/portal1.png
new file mode 100644
index 0000000..9456860
--- /dev/null
+++ b/assets/sprites/portal1.png
Binary files differ
diff --git a/assets/sprites/portal10.png b/assets/sprites/portal10.png
new file mode 100644
index 0000000..993d73f
--- /dev/null
+++ b/assets/sprites/portal10.png
Binary files differ
diff --git a/assets/sprites/portal11.png b/assets/sprites/portal11.png
new file mode 100644
index 0000000..d6eab7e
--- /dev/null
+++ b/assets/sprites/portal11.png
Binary files differ
diff --git a/assets/sprites/portal12.png b/assets/sprites/portal12.png
new file mode 100644
index 0000000..f72177d
--- /dev/null
+++ b/assets/sprites/portal12.png
Binary files differ
diff --git a/assets/sprites/portal13.png b/assets/sprites/portal13.png
new file mode 100644
index 0000000..019ac21
--- /dev/null
+++ b/assets/sprites/portal13.png
Binary files differ
diff --git a/assets/sprites/portal14.png b/assets/sprites/portal14.png
new file mode 100644
index 0000000..349725e
--- /dev/null
+++ b/assets/sprites/portal14.png
Binary files differ
diff --git a/assets/sprites/portal15.png b/assets/sprites/portal15.png
new file mode 100644
index 0000000..bedc9c3
--- /dev/null
+++ b/assets/sprites/portal15.png
Binary files differ
diff --git a/assets/sprites/portal2.png b/assets/sprites/portal2.png
new file mode 100644
index 0000000..2767264
--- /dev/null
+++ b/assets/sprites/portal2.png
Binary files differ
diff --git a/assets/sprites/portal3.png b/assets/sprites/portal3.png
new file mode 100644
index 0000000..3004d0a
--- /dev/null
+++ b/assets/sprites/portal3.png
Binary files differ
diff --git a/assets/sprites/portal4.png b/assets/sprites/portal4.png
new file mode 100644
index 0000000..49a03d1
--- /dev/null
+++ b/assets/sprites/portal4.png
Binary files differ
diff --git a/assets/sprites/portal5.png b/assets/sprites/portal5.png
new file mode 100644
index 0000000..5d8b082
--- /dev/null
+++ b/assets/sprites/portal5.png
Binary files differ
diff --git a/assets/sprites/portal6.png b/assets/sprites/portal6.png
new file mode 100644
index 0000000..2fda26f
--- /dev/null
+++ b/assets/sprites/portal6.png
Binary files differ
diff --git a/assets/sprites/portal7.png b/assets/sprites/portal7.png
new file mode 100644
index 0000000..33ead33
--- /dev/null
+++ b/assets/sprites/portal7.png
Binary files differ
diff --git a/assets/sprites/portal8.png b/assets/sprites/portal8.png
new file mode 100644
index 0000000..c13e185
--- /dev/null
+++ b/assets/sprites/portal8.png
Binary files differ
diff --git a/assets/sprites/portal9.png b/assets/sprites/portal9.png
new file mode 100644
index 0000000..ca463cf
--- /dev/null
+++ b/assets/sprites/portal9.png
Binary files differ
diff --git a/assets/sprites/shitbullet.png b/assets/sprites/shitbullet.png
new file mode 100644
index 0000000..d53a4cf
--- /dev/null
+++ b/assets/sprites/shitbullet.png
Binary files differ
diff --git a/assets/sprites/skylaser1.png b/assets/sprites/skylaser1.png
new file mode 100644
index 0000000..762cd21
--- /dev/null
+++ b/assets/sprites/skylaser1.png
Binary files differ
diff --git a/assets/sprites/skylaser2.png b/assets/sprites/skylaser2.png
new file mode 100644
index 0000000..65421e8
--- /dev/null
+++ b/assets/sprites/skylaser2.png
Binary files differ
diff --git a/assets/sprites/skylaser3.png b/assets/sprites/skylaser3.png
new file mode 100644
index 0000000..eb55807
--- /dev/null
+++ b/assets/sprites/skylaser3.png
Binary files differ
diff --git a/assets/sprites/skylaser4.png b/assets/sprites/skylaser4.png
new file mode 100644
index 0000000..f02bdb6
--- /dev/null
+++ b/assets/sprites/skylaser4.png
Binary files differ
diff --git a/assets/sprites/skylaser5.png b/assets/sprites/skylaser5.png
new file mode 100644
index 0000000..aec41ff
--- /dev/null
+++ b/assets/sprites/skylaser5.png
Binary files differ
diff --git a/assets/sprites/skylaser6.png b/assets/sprites/skylaser6.png
new file mode 100644
index 0000000..3b87e39
--- /dev/null
+++ b/assets/sprites/skylaser6.png
Binary files differ
diff --git a/assets/sprites/solgryn.png b/assets/sprites/solgryn.png
new file mode 100644
index 0000000..0071230
--- /dev/null
+++ b/assets/sprites/solgryn.png
Binary files differ
diff --git a/assets/sprites/solgryn_fight.png b/assets/sprites/solgryn_fight.png
new file mode 100644
index 0000000..b169e07
--- /dev/null
+++ b/assets/sprites/solgryn_fight.png
Binary files differ
diff --git a/assets/sprites/solgryn_open1.png b/assets/sprites/solgryn_open1.png
new file mode 100644
index 0000000..f01d25a
--- /dev/null
+++ b/assets/sprites/solgryn_open1.png
Binary files differ
diff --git a/assets/sprites/solgryn_open2.png b/assets/sprites/solgryn_open2.png
new file mode 100644
index 0000000..c77a14f
--- /dev/null
+++ b/assets/sprites/solgryn_open2.png
Binary files differ
diff --git a/assets/sprites/solgryn_open3.png b/assets/sprites/solgryn_open3.png
new file mode 100644
index 0000000..ec27484
--- /dev/null
+++ b/assets/sprites/solgryn_open3.png
Binary files differ
diff --git a/assets/sprites/solgryn_sun.png b/assets/sprites/solgryn_sun.png
new file mode 100644
index 0000000..6fa73ac
--- /dev/null
+++ b/assets/sprites/solgryn_sun.png
Binary files differ
diff --git a/countlines.sh b/countlines.sh
new file mode 100755
index 0000000..62858f9
--- /dev/null
+++ b/countlines.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/bash
+echo "
+js lines of code: "
+find . -name '*.js' | xargs wc -l
+
+echo "
+scss lines of code: "
+find . -name '*.scss' | xargs wc -l
+
+echo ""
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..0597f29
--- /dev/null
+++ b/index.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="UTF-8">
+<title></title>
+<link rel="stylesheet" href="style.css">
+<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
+</head>
+
+<body>
+</body>
+
+<script type="module" src="index.js"></script>
+</html>
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..e43c3f2
--- /dev/null
+++ b/index.js
@@ -0,0 +1,32 @@
+import { Engine } from "./src/engine.js"
+Engine.startEngine()
+
+// import { start, update, draw } from "./src/main.js";
+// const fps = 60
+//
+//
+// /* cap the game's fps */
+// let msPrev = window.performance.now()
+// const msPerFrame = 1000 / fps
+// let frames = 0
+// function gameloop() {
+// window.requestAnimationFrame(gameloop)
+//
+// const msNow = window.performance.now()
+// const msPassed = msNow - msPrev
+//
+// if (msPassed < msPerFrame) return
+//
+// const excessTime = msPassed % msPerFrame
+// msPrev = msNow - excessTime
+//
+// frames++
+//
+// update()
+// draw()
+// }
+//
+// /* call functions to start the game */
+// /* the game logic can be found in src */
+// start()
+// gameloop()
diff --git a/scss/index.scss b/scss/index.scss
new file mode 100644
index 0000000..177f5fd
--- /dev/null
+++ b/scss/index.scss
@@ -0,0 +1,35 @@
+body {
+ margin: 0;
+ background-color: grey;
+ width: 100%;
+ height: 100%;
+}
+
+img {
+ position: absolute;
+ top: 0;
+ left: 0;
+}
+
+.background {
+ width: 100%;
+ height: 100%;
+}
+
+#spawn {
+ position: relative;
+ top: 0;
+ left: 0;
+ width: 0;
+ height: 0;
+}
+
+#screen {
+ display: block;
+ overflow: hidden;
+ background-size: cover;
+ position: absolute;
+ top: 0;
+ left: 0;
+}
+
diff --git a/src/assets.js b/src/assets.js
new file mode 100644
index 0000000..4a51716
--- /dev/null
+++ b/src/assets.js
@@ -0,0 +1,22 @@
+export const BOSHY = {
+ NORMAL: "./assets/sprites/boshy1.png",
+ DAMAGED:"./assets/sprites/boshy2.png",
+ BULLET: "./assets/sprites/boshy_bullet.png",
+
+ SOUNDS: {
+ SHOOT: "./assets/sounds/shoot.ogg",
+ INTRO: "./assets/sounds/ItsBOSHYtime.ogg",
+ }
+}
+
+export const BACKGROUND = {
+ DEFAULT: "./assets/sprites/black_background.png",
+ DARK_SUN: "./assets/sprites/black_sun_background.png",
+}
+
+export const MUSIC = {
+ SOLGRYN: './assets/music/Ace Combat Megalith.ogg',
+ DEATH: './assets/music/loludied.ogg',
+ PREQUEL: './assets/music/terranigma-theunderworld.ogg',
+
+}
diff --git a/src/engine.js b/src/engine.js
new file mode 100644
index 0000000..a7bb8a5
--- /dev/null
+++ b/src/engine.js
@@ -0,0 +1,34 @@
+import { start, update, draw } from "./main.js"
+import { Screen } from "./engine/screen.js"
+import { keys, setUpKeyboard } from "./engine/keyboard.js"
+import { startClock } from "./engine/clock.js"
+
+export class Engine {
+ static frame = 0
+ static audio
+ static screen = new Screen()
+ static keys = keys
+ static bgm
+
+ static startEngine() {
+ setUpKeyboard()
+ start()
+
+ startClock()
+ }
+
+ static updateEngine() {
+ update()
+ draw()
+ }
+
+ static playSound(file) {
+ let audio = new Audio(file)
+ audio.play()
+ }
+
+ static playMusic(file) {
+ this.bgm = new Audio(file)
+ this.bgm.play()
+ }
+}
diff --git a/src/engine/clock.js b/src/engine/clock.js
new file mode 100644
index 0000000..e817863
--- /dev/null
+++ b/src/engine/clock.js
@@ -0,0 +1,26 @@
+import { Engine } from "../engine.js"
+
+export { Engine } from "../engine.js"
+const fps = 60
+
+/* cap the game's fps */
+let msPrev = window.performance.now()
+const msPerFrame = 1000 / fps
+function tick() {
+ window.requestAnimationFrame(tick)
+
+ const msNow = window.performance.now()
+ const msPassed = msNow - msPrev
+
+ if (msPassed < msPerFrame) return
+
+ const excessTime = msPassed % msPerFrame
+ msPrev = msNow - excessTime
+
+ Engine.frame++
+ Engine.updateEngine()
+}
+
+export function startClock() {
+ tick()
+}
diff --git a/src/engine/keyboard.js b/src/engine/keyboard.js
new file mode 100644
index 0000000..d634519
--- /dev/null
+++ b/src/engine/keyboard.js
@@ -0,0 +1,23 @@
+export function setUpKeyboard() {
+ document.addEventListener("keyup", k => trigger(k))
+ document.addEventListener("keydown", k => trigger(k))
+}
+
+export const keys = {
+ right: false,
+ left: false,
+ up: false,
+ down: false,
+ shoot: false,
+}
+
+function trigger(event) {
+ let on = event.type == "keydown"
+ switch (event.key) {
+ case "ArrowRight": keys.right = on; break;
+ case "ArrowLeft": keys.left = on; break;
+ case "ArrowUp": keys.up = on; break;
+ case "ArrowDown": keys.down = on; break;
+ case "z": case "Z": keys.shoot = on; break;
+ }
+}
diff --git a/src/engine/screen.js b/src/engine/screen.js
new file mode 100644
index 0000000..2d32b62
--- /dev/null
+++ b/src/engine/screen.js
@@ -0,0 +1,87 @@
+import { Vector } from "./vector.js"
+import { BACKGROUND } from "../assets.js"
+
+export class Screen {
+ viewport = new Vector(650, 500)
+
+ ///////////////////// START //////////////////////
+ constructor() {
+ this.createHTMLElements()
+ this.setUpTriggers()
+ this.resize()
+ }
+
+ createHTMLElements() {
+ this.div
+ this.background
+ this.spawn
+
+ /* create main div */
+ this.div = document.createElement("div")
+ this.div.id = "screen"
+ this.div.style.backgroundColor = "black"
+
+ /* create background image */
+ this.background = document.createElement("img")
+ this.background.className = "background"
+ this.background.src = `${BACKGROUND.DEFAULT}`
+ this.background.style.visibility = "hidden"
+ this.div.appendChild(this.background)
+
+ /* create relative div to append children */
+ this.spawn = document.createElement("div")
+ this.div.appendChild(this.spawn)
+ document.body.appendChild(this.div)
+ }
+
+ setUpTriggers() {
+ addEventListener("resize", () => { this.resize() });
+ }
+
+
+ ///////////////////// RESIZE //////////////////////
+ real_position = new Vector(0, 0)
+ real_size = new Vector(0, 0)
+ scale = new Vector(0, 0)
+
+ resize() {
+ let w = new Vector(window.innerWidth, window.innerHeight)
+
+ /* get max size keeping aspect ratio */
+ if (w.y / this.viewport.y > w.x / this.viewport.x) {
+ this.real_size.x = w.x
+ this.real_size.y = Math.floor(w.x / this.viewport.x * this.viewport.y)
+ } else {
+ this.real_size.y = w.y
+ this.real_size.x = Math.floor(w.y / this.viewport.y * this.viewport.x)
+ }
+ this.div.style.width = `${this.real_size.x}px`
+ this.div.style.height = `${this.real_size.y}px`
+
+ /* get centered position */
+ this.real_position.x = w.x / 2 - this.real_size.x / 2
+ this.real_position.y = w.y / 2 - this.real_size.y / 2
+ this.real_position.floor()
+
+ this.div.style.left = `${this.real_position.x}px`
+ this.div.style.top = `${this.real_position.y}px`
+
+ /* set scale */
+ this.scale = this.real_size.x / this.viewport.x
+ }
+
+
+ ///////////////////// COMMANDS //////////////////////
+ append(element) { this.spawn.appendChild(element) }
+
+ draw(span, position, size, /* rotation = 0 */) {
+ span.style.width = `${size.x * this.scale}px`
+ span.style.height = `${size.y * this.scale}px`
+ span.style.top = `${(position.y - size.x / 2) * this.scale}px`
+ span.style.left = `${(position.x - size.y / 2) * this.scale}px`
+ }
+
+ setBackground(img) { this.background.src = img }
+ showBackground() { this.background.visibility = "visible" }
+ hideBackground() { this.background.visibility = "hidden" }
+}
diff --git a/src/engine/vector.js b/src/engine/vector.js
new file mode 100644
index 0000000..452e47b
--- /dev/null
+++ b/src/engine/vector.js
@@ -0,0 +1,47 @@
+export class Vector {
+ constructor(x=0, y=0) {
+ this.x = x
+ this.y = y
+ }
+
+ add(newVector) {
+ this.x += newVector.x
+ this.y += newVector.y
+ return this
+ }
+
+ normalize() {
+ if (this.x != 0 && 0 != this.y) {
+ let hyp = Math.abs(this.x)
+ let cSquared = Math.pow(hyp, 2) / 2
+ let c = Math.sqrt(cSquared, 2)
+
+ this.x = this.x / Math.abs(this.x) * c
+ this.y = this.y / Math.abs(this.x) * c
+ }
+ return this
+ }
+
+ multiply(multiplier) {
+ this.x *= multiplier
+ this.y *= multiplier
+ return this
+ }
+
+ clone() {
+ return new Vector(this.x, this.y)
+ }
+
+ static division(vector_a, vector_b) {
+ return new Vector(
+ vector_a.x / vector_b.x,
+ vector_a.y / vector_b.y
+ )
+ }
+
+ floor() {
+ this.x = Math.floor(this.x)
+ this.y = Math.floor(this.y)
+ return this
+ }
+}
diff --git a/src/entities/boshy.js b/src/entities/boshy.js
new file mode 100644
index 0000000..ea6068d
--- /dev/null
+++ b/src/entities/boshy.js
@@ -0,0 +1,65 @@
+import { BOSHY } from "../assets.js"
+import { Vector } from "../engine/vector.js"
+import { Engine } from "../engine.js"
+import { BoshyBullet } from "./boshybullet.js"
+import { Entity } from "./entity.js"
+
+export class Boshy extends Entity {
+ reloadTime = 6
+ lastShot = 0
+ speed = 5
+
+ constructor() {
+ super({
+ size: new Vector(30, 30),
+ position: new Vector(325, 400),
+ sprite: BOSHY.NORMAL,
+ })
+
+ Engine.playSound(BOSHY.SOUNDS.INTRO)
+ }
+
+ update() {
+ let keys = Engine.keys
+ let viewport = Engine.screen.viewport
+
+ /* get movement direction */
+ let move = new Vector()
+ let speed = this.speed
+ if (keys.right) move.x += 1
+ if (keys.left) move.x -= 1
+ if (keys.up) move.y -= 1
+ if (keys.down) move.y += 1
+ if (keys.shoot) this.shoot()
+
+ /* apply movement */
+ move.normalize()
+ move.multiply(speed)
+ this.position.add(move)
+
+ /* check limits */
+ if (this.position.x < 0) this.position.x = 0
+ if (this.position.y < 0) this.position.y = 0
+ if (this.position.x > viewport.x) this.position.x = viewport.x
+ if (this.position.y > viewport.y) this.position.y = viewport.y
+ }
+
+ shoot() {
+ /* check if it can shoot */
+ if (Engine.frame < this.lastShot + this.reloadTime) {
+ return
+ }
+
+ this.lastShot = Engine.frame /*(reset reload)*/
+
+ let bullet_a_position = this.position.clone()
+ let bullet_b_position = this.position.clone()
+
+ bullet_a_position.x = bullet_a_position.x + 5
+ bullet_b_position.x = bullet_b_position.x - 5
+
+ new BoshyBullet(bullet_a_position)
+ new BoshyBullet(bullet_b_position)
+ Engine.playSound(BOSHY.SOUNDS.SHOOT)
+ }
+}
diff --git a/src/entities/boshybullet.js b/src/entities/boshybullet.js
new file mode 100644
index 0000000..ed91ede
--- /dev/null
+++ b/src/entities/boshybullet.js
@@ -0,0 +1,30 @@
+import { BOSHY } from "../assets.js"
+import { Vector } from "../engine/vector.js"
+import { bullets } from "../main.js"
+import { Entity } from "./entity.js"
+
+export class BoshyBullet extends Entity {
+ speed = 20
+
+ constructor(position = new Vector(0,0)) {
+ super({
+ size: new Vector(5, 5),
+ position: position.floor(),
+ sprite: BOSHY.BULLET,
+ })
+
+ bullets.list.push(this)
+ }
+
+ update() {
+ this.position.y -= this.speed
+ if (this.position.y < 0) {
+ this.span.remove()
+ bullets.remove(this)
+ }
+ }
+
+ remove() {
+ this.span.remove()
+ }
+}
diff --git a/src/entities/entity.js b/src/entities/entity.js
new file mode 100644
index 0000000..ac14d4b
--- /dev/null
+++ b/src/entities/entity.js
@@ -0,0 +1,23 @@
+import { Vector } from "../engine/vector.js"
+import { Engine } from "../engine.js"
+
+export class Entity {
+ constructor({
+ size,
+ hitbox = size,
+ sprite,
+ position = new Vector(0,0),
+ }) {
+ this.size = size
+ this.hitbox = hitbox
+ this.position = position
+
+ this.span = document.createElement("img")
+ this.span.src = sprite
+ Engine.screen.append(this.span)
+ }
+
+ draw() {
+ Engine.screen.draw(this.span, this.position, this.size)
+ }
+}
diff --git a/src/main.js b/src/main.js
new file mode 100644
index 0000000..6822351
--- /dev/null
+++ b/src/main.js
@@ -0,0 +1,38 @@
+///////////////////// IMPORTS //////////////////////
+import { Boshy } from "./entities/boshy.js"
+import { SCENE, SCENES } from "./scenes.js"
+
+
+///////////////////// GLOBALS //////////////////////
+export let boshy
+export const bullets = {
+ list: [],
+ remove: instance => { bullets.list = bullets.list.filter(b => b != instance) },
+ clear: _ => { bullets.list.forEach(b => b.remove()) }
+}
+
+///////////////////// GAME LOGIC //////////////////////
+export function start() {
+ console.log("game start")
+ changeScene(SCENES.PREQUEL)
+}
+
+export function update() {
+ boshy.update()
+ bullets.list.forEach((bullet) => bullet.update())
+ SCENE.update()
+}
+
+export function draw() {
+ boshy.draw()
+ bullets.list.forEach((bullet) => bullet.draw())
+ SCENE.draw()
+}
+
+
+///////////////////// SCENE METHODS //////////////////////
+export function changeScene(scene) {
+ SCENE.load(scene)
+ bullets.clear()
+ boshy = new Boshy()
+}
diff --git a/src/scenes.js b/src/scenes.js
new file mode 100644
index 0000000..09ea493
--- /dev/null
+++ b/src/scenes.js
@@ -0,0 +1,30 @@
+import * as PREQUEL from "./scenes/prequel.js"
+import * as GAME from "./scenes/game.js"
+
+export const SCENES = {
+ PREQUEL: "prequel",
+ GAME: "game",
+}
+
+export const SCENE = {
+ load: loadScene,
+ update: null,
+ draw: null,
+}
+
+let currentScene
+
+function loadScene(scene) {
+ currentScene = scene
+ if (currentScene == SCENES.PREQUEL) {
+ PREQUEL.start()
+ SCENE.update = PREQUEL.update
+ SCENE.draw = PREQUEL.draw
+ }
+
+ if (currentScene == SCENES.GAME) {
+ GAME.start()
+ SCENE.update = GAME.update
+ SCENE.draw = GAME.draw
+ }
+}
diff --git a/src/scenes/game.js b/src/scenes/game.js
new file mode 100644
index 0000000..1640aa5
--- /dev/null
+++ b/src/scenes/game.js
@@ -0,0 +1,13 @@
+import { Engine } from "../engine.js"
+import { MUSIC } from "../assets.js"
+
+export function start() {
+ Engine.playMusic(MUSIC.SOLGRYN)
+}
+
+
+export function update() {
+}
+
+export function draw() {
+}
diff --git a/src/scenes/prequel.js b/src/scenes/prequel.js
new file mode 100644
index 0000000..f24ef99
--- /dev/null
+++ b/src/scenes/prequel.js
@@ -0,0 +1,13 @@
+import { Engine } from "../engine.js"
+import { MUSIC } from "../assets.js"
+
+export function start() {
+ Engine.playMusic(MUSIC.PREQUEL)
+}
+
+
+export function update() {
+}
+
+export function draw() {
+}
diff --git a/style.css b/style.css
new file mode 100644
index 0000000..9a64319
--- /dev/null
+++ b/style.css
@@ -0,0 +1,30 @@
+body {
+ margin: 0;
+ background-color: grey;
+ width: 100%;
+ height: 100%; }
+
+img {
+ position: absolute;
+ top: 0;
+ left: 0; }
+
+.background {
+ position: inline;
+ width: 100%;
+ height: 100%; }
+
+#spawn {
+ position: relative;
+ top: 0;
+ left: 0;
+ width: 0;
+ height: 0; }
+
+#screen {
+ display: block;
+ overflow: hidden;
+ background-size: cover;
+ position: absolute;
+ top: 0;
+ left: 0; }