diff --git a/README.md b/README.md deleted file mode 100644 index fa26d2c..0000000 --- a/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# Leap-and-Run -[Play!](https://philipburesh.github.io/Leap-and-Run/)
-FULL VERSION (1.0)
---------------------------------------------------------------------
- - You must complete the level before the door closes.
---------------------------------------------------------------------
- - TIMER Added
- - Now you can use ORB multiple times
- - Better Jumping ("w" press) detection
- - Better Crouching ("s" press) detection
- - Remade some maps
- - Ladder Animation Fixed
- - SFX Fixed
- - Stucking in a Wall Fixed
- - Player Movement Fixed
- - Boss 1 hit bug fixed
- --------------------------------------------------------------------
-![player_an](https://github.com/PhilipBuresh/Leap-and-Run/assets/114904886/c5094b69-b54d-4cf5-a6b2-c2112b94bd09) -![output-onlinegiftools](https://github.com/PhilipBuresh/Leap-and-Run/assets/114904886/3f542c81-fdb6-4717-821a-9dbf8fa37242) -![output-onlinegiftools (1)](https://github.com/PhilipBuresh/Leap-and-Run/assets/114904886/c9052834-06c6-471e-b6b7-6424205927d9) diff --git a/index.html b/index.html deleted file mode 100644 index cf755be..0000000 --- a/index.html +++ /dev/null @@ -1,280 +0,0 @@ - - - - - - - - - - - Leap&Run - - - - - - - - - - - - - - - -
-
-
-

Recommended

-

Have +60hz monitor

-

Have a strong CPU

-
- name -
-
Play!
-
Tutorial
-
Credits
-
-
-
-
Resume [esc]
-
Retry
-
Back to Lobby
-
Back to Menu
-
-
-
-
-

Level 1

-

Abyss of destiny - By SHK

-
-
-

Level 2

-

Dovregubben's Hall - By cYsmix

-
-
-

Level 3

-

Monstrous Turtles - By Zircon

-
-
-

Level 4

-

Bossfight - By Lchavasse

-
-
-

Level 5

-

Nuclear Flash (Mega Man 2) - By Zircon

-
-
-

Level 6

-

How To Adventure - By Dunderpatrullen

-
-
-

Level 7

-

Manic - By cYsmix

-
-
-

Level 8

-

Monstrous Turtles - By Zircon

-
-
-

Level 9

-

Moonlight Sonata - By cYsmix

-
-
-

Level 10

-

Classic Pursuit - By cYsmix

-
-
-

Level 11

-

Arcadia - By Dunderpatrullen

-
-
-

Level 12

-

Pixie Crust - By Dunderpatrullen

-
-
-

Level 13

-

Lavender Town Haunting - By Solkrieg

-
-
-

Level 14

-

Peer Gynt - By cYsmix

-
-
-

Level 15 (BOSS FIGHT)

-

Moonlight Sonata 3rd Movement - By meganeko

-
-
-

Trophy Room (Ending)

-

Dream Flower - By KLYDIX

-
-
-

Lobby Music

-

Dirt Devil - By Zircon

-
-
-

Jump on the Ghost

-

Arcade game retro 8 bit jump - By FascinatedSound

-
-
-

Boss Slash (Attack)

-

Slash sword - By Joshua Chivers

-
-
-

Level Completed

-

Video game happy flourish - By Gamemaster Audio

-
-
-

Death Sound

-

Video game points lost - By Glitchedtones

-
-
-

Enter the level

-

Door opened in bedroom - By Glitchedtones

-
-
-

Jump

-

Swing Whoosh - By Jofae

-
-
-

Key Pickup

-

Retro game coin pickup - by Jam FX

-
-
-

I Will Kill You (Boss)

-

I Will Kill You - By Eccentric Sounds

-
-
-

Ladder

-

Ladder - By Pixabay (Sped Up)

-
-
-

Landing

-

Feet landing jump - By Epic Stock Media

-
-
-

Laugh

-

Evil laughter male - By Epic Stock Media

-
-
-

Punch Miss

-

Throwing item swing - By Epic Stock Media

-
-
-

Orb Jump

-

Arcade game jump - By Epic Stock Media

-
-
-

Teleport

-

Magic achievement - By Epic Stock Media

-
-
-

Punch (Hit Boss)

-

Punch body hit & blood spatter - By Joshua Chivers

-
-
-

Rioter Attack (male)

-

Attacking grunt male - By SmartSound FX

-
-
-

Ruby Attack (female)

-

Fierce Female Combat: Attack Grunts and Fight - By Femelodia

-
-
-

Walking on Stone

-

Running on bricks - By Glitchedtones

-
-
-

Walking on Wood

-

Footsteps running in stiletto heels - By Glitchedtones

-
-
-

Paper in tutorial

-

Free paper textured background - By rawpixel.com on Freepik

-
-
-

Fade IN/OUT Circle Transition

-

Green Screen Circle Animation Full HD - By dangraf art

-
-
-
-
-
-
-

Rioter

- man -
-
-

Ruby

- woman -
-
-
Choose your Character!
-
- paper -
-
-
- -

Music

-
-

50%

- arrow - arrow -
-
-
- -

SFX

-
-

50%

- arrow - arrow -
-

Resume [esc]

-
-
-
- heart - heart - heart -
-
-
-
BOSS
-
-
-
-
- rising - wall - -

Time: 0s

- black - - - -
-
-
-
-
-
- note -
-
- black -
- - - - - \ No newline at end of file diff --git a/res/css/style.css b/res/css/style.css deleted file mode 100644 index 94e9d1c..0000000 --- a/res/css/style.css +++ /dev/null @@ -1,648 +0,0 @@ -body { - background-color: black; - overflow: hidden; - height: 100vh; - width: auto; - background-image: url("../img/wall_dark.png"); -} -*{ - user-select: none; - box-sizing: border-box; -} -p{ - font-family: 'VT323', monospace; -} -#container{ - height: 100vh; - width: auto; - margin: 0; - padding: 0; -} -#fullBlack{ - position:absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - height: 110vh; - width: 200%; - z-index: 10; - z-index: 3; - transition: opacity 0.8s; - opacity: 0; - display: none; -} -#game{ - display:none; - height: 100vh; - width: auto; - position: relative; -} -#timer{ - display: block; - border:3px solid rgb(29, 1, 1); - color:white; - border-radius: 0 0 0.5em 0.5em; - padding: 2px 5px; - font-size: 50px; - background-color: rgb(45, 3, 3); - display:block; - position: absolute; - top: -5%; - left: 50%; - transform: translate(-50%, -50%); - margin: 0 auto; - z-index: 100; - transition: 0.6s; - box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 4px, rgba(0, 0, 0, 0.3) 0px 7px 13px -3px, rgba(0, 0, 0, 0.2) 0px -3px 0px inset; -} -#recommend{ - position: absolute; - bottom: -25px; - left: 10px; - letter-spacing: 2px; - font-family: 'VT323', monospace; - color:rgb(175, 175, 175); - transition: 0.2s; -} -#recommend:hover{ - color: white; -} -#recommend h2{ - font-size: 40px; -} -#recommend h4{ - font-size: 25px; - margin-top: -1em; -} -#credits_list{ - background-color: rgb(15, 15, 15); - background-image: url("../img/wall_verydark.png"); - margin-top:1em; - color:white; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - height: 90%; - width: 90%; - border:5px solid rgb(0, 0, 0); - font-family: 'VT323', monospace; - box-shadow: 1px -1px 40px 7px rgb(0, 0, 0); - overflow-y: auto; - display:none; -} -#credits_list::-webkit-scrollbar{ - width: 8px; -} -#credits_list::-webkit-scrollbar-thumb{ - background-color: #c7c7c7; - border-radius: 4px; -} -#credits_list::-webkit-scrollbar-track{ - background-color: #252525; -} -#credits_list h2{ - margin:0 0 2em 0; - text-align: center; - font-size: 40px; - letter-spacing: 2px; - background-color: rgb(20, 20, 20); - padding: 10px 10px; -} -#credits_back{ - background-color: white; -} -#song_box{ - display: flex; - flex-direction: row; - flex-wrap: wrap; - justify-content: center; - width: 100%; -} -#song_box div{ - padding: 5px; - width: 30%; - height: fit-content; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - border:2px solid rgb(37, 37, 37); - border-radius: 0.4em; - margin:15px 5px; - transition: 0.2s; -} -#song_box div:hover{ - background-color: rgb(2, 2, 2); - border:2px solid rgb(77, 77, 77); - border-radius: 0.2em; -} -#song_box h3{ - font-size: 30px; - letter-spacing: 1px; -} -#song_box p{ - margin-top:-10px; - font-size: 20px; -} -#hps{ - display: none; - width: 30%; - position: absolute; - top: 9%; - left: 50%; - transform: translate(-50%, -50%); - height: 100px; -} -#myHp{ - display: none; - margin-top:0.5em; -} -#myHp img{ - margin-left:0.2em; - margin-right:0.2em; - width: 60px; -} -#hp_bar{ - height: 25px; - display:flex; - justify-content: left; - align-items: left; - border:3px solid white; - position:relative; -} -#name{ - position:absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - color:white; - font-style: bold; - font-family: 'VT323', monospace; - letter-spacing: 3px; - font-size: 25px; -} -#hp{ - width: 100%; - height: 100%; - background-color: red; - transition: width 0.1s ease-out; -} -#escape_button { - display:flex; - flex-direction: row; - justify-content: center; - align-items: center; - position: absolute; - top: 20px; - right: 20px; - height: 60px; - width: 60px; - border: 3px solid white; - border-radius: 0.5em; - z-index: 11; - cursor: pointer; -} -#escape_button div{ - width: 15px; - height: 40px; - background-color: white; - margin: 5px; - border-radius: 0.2em; -} -#escape_button:hover{ - border: 3px solid gray; -} -#note_button { - display:flex; - flex-direction: row; - justify-content: center; - align-items: center; - position: absolute; - top: 100px; - right: 20px; - height: 60px; - width: 60px; - border: 3px solid white; - border-radius: 0.5em; - z-index: 11; - cursor: pointer; -} -#note_button img{ - width: 50px; - margin-right:4px; - filter: invert(1); -} -#note_button:hover{ - border: 3px solid gray; -} -#rising{ - width: 100%; - height: auto; - position: absolute; - bottom: -150%; - left: 50%; - transform: translate(-50%, -50%); - z-index: 2; - opacity: 1; - pointer-events: none; - overflow: hidden; - display:none; -} -#paper{ - display: none; - position: absolute; - top: 50%; - left: 50%; - transform: translate(150%, -50%); - width: 50%; - height: auto; - border: 5px solid black; - box-shadow: 1px -1px 40px 7px rgb(0, 0, 0); - animation-duration: 1000ms; - animation-play-state: paused; - animation-fill-mode: forwards; - animation-name: rightToMid; -} -@keyframes rightToMid { - 1% {transform: translate(150%, -50%);} - 100% {transform: translate(-50%, -50%)} -} -@keyframes midToLeft { - 0% {transform: translate(-50%, -50%);} - 100% {transform: translate(-250%, -50%)} -} -#startMenuBtns{ - height: 100vh; - position: absolute; - top: 50%; - left: 50%; - left: 50%; - transform: translate(-50%, -50%); - display: flex; - justify-content: center; - flex-direction: column; -} -#startMenuBtns div{ - border-radius: 0.2em; - border:2px solid white; - color:white; - font-family: 'VT323', monospace; - padding:1em; - padding-top:0.5em; - padding-bottom:0.5em; - cursor: pointer; - text-align: center; -} -#playButton{ - font-size:30px; - animation-duration: 1000ms; - animation-play-state: paused; - animation-name: none; - margin:1em; -} -#tutorialButton{ - font-size:20px; - cursor: pointer; -} -#creditsButton{ - margin: 10px 0px; - font-size:20px; - cursor: pointer; -} -#playButton:hover, #tutorialButton:hover, #creditsButton:hover{ - color: black; - background-color: white; -} -#startMenu{ - display: block; -} -@keyframes blink { - 0% {padding: 0;color: transparent;background-color: white;height: 10px;} - 15% {padding: 0;padding-left: 5em;padding-right: 5em;color: transparent;background-color: white;height: 5px;} - 100% {padding: 0;padding-left: 0.1em;padding-right: 0.1em;;color: transparent;background-color: rgb(126, 125, 125);border:rgb(126, 125, 125);height: 3px;} -} -#characters { - border: 3px solid rgb(0, 0, 0); - background-color: black; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, 150%); - flex-direction: column; - justify-content: center; - align-items: center; - text-align: center; - background-image:url("../img/wall.png"); - box-shadow: 1px -1px 40px 7px rgb(0, 0, 0); - display:none; - animation-duration: 1000ms; - animation-play-state: paused; - animation-fill-mode: forwards; - animation-name: bottomToMid; -} -@keyframes bottomToMid { - 1% {transform: translate(-50%, 150%);} - 100% {transform: translate(-50%, -50%)} -} -@keyframes midToBottom { - 0% {transform: translate(-50%, -50%);} - 100% {transform: translate(-50%, 150%)} -} - -#characters #images { - display: flex; - justify-content: center; - align-items: center; -} - -#characters img:hover { - filter:contrast(0.9); -} - -#characters img { - width: 100%; - height: auto; - transition: 0.3s; - cursor: pointer; - margin-left:-5em; - margin-right:-5em; -} - -#characters p { - color: white; - background-color: rgba(0, 0, 0, 0.5); - font-size:40px; - margin: 0.5em; -} - -#choose { - color: white; - font-size:60px; - margin-bottom:0.5em; - font-family: 'VT323', monospace; -} - -#canvas_container { - width: 70%; - padding-bottom: 39.2%; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - overflow: hidden; - border:5px solid black; - box-shadow: 1px -1px 40px 7px rgb(0, 0, 0); -} -#canvas { - width: 100%; - height: auto; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - z-index: 1; -} -#background { - width: 100%; - height: auto; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - z-index: -1; -} -#esc{ - font-family: ' VT323', monospace; - width: 200px; - height: 200px; - position: absolute; - border:3px solid white; - border-radius: 0.3em; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - z-index: 10; - justify-content: center; - align-items: center; - flex-direction: column; - background-color:rgba(0, 0, 0, 0.8); - display:none; -} -#esc div, #music_editor_back{ - background-color:black; - text-align: center; - font-size: 17px; - width: 130px; - color:white; - margin:0.5em; - border: 2px solid white; - padding:0.3em; - border-radius: 0.3em; - cursor:pointer; - -} -#button_menu{ - display:none; -} -#esc div:hover, #music_editor_back:hover{ - color: black; - background-color: white; -} -#music_editor{ - font-family: ' VT323', monospace; - display: none; - justify-content: center; - align-items:center; - flex-direction: column; - width: 400px; - height: 260px; - position: absolute; - border:3px solid white; - border-radius: 0.3em; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - z-index: 10; - background-color:rgba(0, 0, 0, 0.8); -} -#whichAudio{ - color:white; - font-size: 20px; - padding: 0; - margin: 0; -} -#music_value, #sfx_value{ - color:white; - font-size: 30px; - margin:0.5em; -} -#music_volume div, #sfx_volume div{ - display: flex; - flex-direction: column; - text-align: center; -} -#note_logo, #sfx_logo{ - filter: invert(1); - width: 80px; - pointer-events: none; -} -#not_invert_arrow1, #invert_arrow1, #not_invert_arrow2, #invert_arrow2{ - width: 30px; - border:2px solid white; - border-radius: 0.4em; - padding:4px; - margin:0.5em; - cursor:pointer; -} -#not_invert_arrow1:hover, #invert_arrow1:hover, #not_invert_arrow2:hover, #invert_arrow2:hover{ - border: 2px solid gray; -} -#invert_arrow1, #invert_arrow2{ - transform: rotate(180deg); -} -#music_volume, #sfx_volume{ - display: flex; - align-items:center; -} -#black { - background-color: black; - width: 150%; - height: auto; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - z-index: 3; - transition: opacity 0.3s; - opacity: 0; - pointer-events: none; -} -#transition1, #transition2 { - width: 300%; - top: 50%; - left: 50%; - position: absolute; - transform: translate(-50%, -50%); - z-index: 5; - opacity: 0; - pointer-events: none; -} -#scene { - width: 100%; - top: 50%; - left: 50%; - position: absolute; - transform: translate(-50%, -50%); - z-index: 5; - pointer-events: none; - display:none; -} -#text{ - max-width: fit-content; - top: 15%; - left: 50%; - position: absolute; - transform: translate(-50%, -50%); - transition: 0.5s; -} -#music{ - left: 0; - top: 0; - height: 0; -} - -@media (max-width: 800px) { - #canvas_container{ - width: 90%; - padding-bottom: 49%; - } - #choose{ - font-size: 20px; - } - #characters img{ - width: 50%; - } - #characters p{ - font-size: 30px; - } - #text{ - top:10%; - width: 50%; - height: auto; - } -} -@media (max-height: 650px) { - #canvas_container{ - width: 60%; - padding-bottom: 33%; - } - #text{ - top:10%; - width: 50%; - height: auto; - } - #hp_bar{ - height: 15px; - border:2px solid white; - } - #name{ - font-size: 15px; - } - #choose{ - font-size: 20px; - } - #characters img{ - width: 30%; - } - #characters p{ - font-size: 20px; - } -} -@media (max-height: 900px) { - #myHp img{ - margin-top:-0.3em; - width: 35px; - } - #song_box p{ - font-size: 14px; - } - #song_box h3{ - font-size: 20px; - } - #recommend{ - bottom:0; - } - #recommend h2{ - font-size:20px; - margin-bottom:1em; - } - #recommend h4{ - font-size:16px - } -} -@media (max-width: 1000px) { - #song_box p{ - font-size: 14px; - } - #song_box h3{ - font-size: 20px; - } - #sfx_in_box{ - margin-top:100em; - } - #recommend{ - bottom:0; - } - #recommend h2{ - font-size:20px; - margin-bottom:1em; - } - #recommend h4{ - font-size:16px - } - #song_box div{ - width: 100%; - } -} - diff --git a/res/gif/paper.gif b/res/gif/paper.gif deleted file mode 100644 index 8d7ed89..0000000 Binary files a/res/gif/paper.gif and /dev/null differ diff --git a/res/gif/rising.gif b/res/gif/rising.gif deleted file mode 100644 index a5687c4..0000000 Binary files a/res/gif/rising.gif and /dev/null differ diff --git a/res/gif/transition1.gif b/res/gif/transition1.gif deleted file mode 100644 index ac82afd..0000000 Binary files a/res/gif/transition1.gif and /dev/null differ diff --git a/res/gif/transition2.gif b/res/gif/transition2.gif deleted file mode 100644 index 11849fc..0000000 Binary files a/res/gif/transition2.gif and /dev/null differ diff --git a/res/gif/youwin.gif b/res/gif/youwin.gif deleted file mode 100644 index 3d81f97..0000000 Binary files a/res/gif/youwin.gif and /dev/null differ diff --git a/res/img/arrow.png b/res/img/arrow.png deleted file mode 100644 index 3b11beb..0000000 Binary files a/res/img/arrow.png and /dev/null differ diff --git a/res/img/barrel.png b/res/img/barrel.png deleted file mode 100644 index 84943f0..0000000 Binary files a/res/img/barrel.png and /dev/null differ diff --git a/res/img/black.png b/res/img/black.png deleted file mode 100644 index 6d29aa9..0000000 Binary files a/res/img/black.png and /dev/null differ diff --git a/res/img/block.png b/res/img/block.png deleted file mode 100644 index 4fea133..0000000 Binary files a/res/img/block.png and /dev/null differ diff --git a/res/img/block_dark.png b/res/img/block_dark.png deleted file mode 100644 index 0fae98b..0000000 Binary files a/res/img/block_dark.png and /dev/null differ diff --git a/res/img/bookshelf.png b/res/img/bookshelf.png deleted file mode 100644 index 71a7022..0000000 Binary files a/res/img/bookshelf.png and /dev/null differ diff --git a/res/img/bookshelf_back.png b/res/img/bookshelf_back.png deleted file mode 100644 index 9049fbf..0000000 Binary files a/res/img/bookshelf_back.png and /dev/null differ diff --git a/res/img/boss_s.png b/res/img/boss_s.png deleted file mode 100644 index 3901279..0000000 Binary files a/res/img/boss_s.png and /dev/null differ diff --git a/res/img/chain.png b/res/img/chain.png deleted file mode 100644 index 4307b54..0000000 Binary files a/res/img/chain.png and /dev/null differ diff --git a/res/img/chain_back.png b/res/img/chain_back.png deleted file mode 100644 index 1d49427..0000000 Binary files a/res/img/chain_back.png and /dev/null differ diff --git a/res/img/chain_doors.png b/res/img/chain_doors.png deleted file mode 100644 index bf41b08..0000000 Binary files a/res/img/chain_doors.png and /dev/null differ diff --git a/res/img/cracked.png b/res/img/cracked.png deleted file mode 100644 index 51dfc07..0000000 Binary files a/res/img/cracked.png and /dev/null differ diff --git a/res/img/darkness1.png b/res/img/darkness1.png deleted file mode 100644 index 06851e8..0000000 Binary files a/res/img/darkness1.png and /dev/null differ diff --git a/res/img/door.png b/res/img/door.png deleted file mode 100644 index cff794e..0000000 Binary files a/res/img/door.png and /dev/null differ diff --git a/res/img/doors.png b/res/img/doors.png deleted file mode 100644 index 3b9d379..0000000 Binary files a/res/img/doors.png and /dev/null differ diff --git a/res/img/ghost.png b/res/img/ghost.png deleted file mode 100644 index 1deaab4..0000000 Binary files a/res/img/ghost.png and /dev/null differ diff --git a/res/img/heart_rioter.png b/res/img/heart_rioter.png deleted file mode 100644 index e71c986..0000000 Binary files a/res/img/heart_rioter.png and /dev/null differ diff --git a/res/img/heart_ruby.png b/res/img/heart_ruby.png deleted file mode 100644 index b0db34c..0000000 Binary files a/res/img/heart_ruby.png and /dev/null differ diff --git a/res/img/icon.gif b/res/img/icon.gif deleted file mode 100644 index 6c746f6..0000000 Binary files a/res/img/icon.gif and /dev/null differ diff --git a/res/img/iron.png b/res/img/iron.png deleted file mode 100644 index 2c7a49f..0000000 Binary files a/res/img/iron.png and /dev/null differ diff --git a/res/img/iron_key.png b/res/img/iron_key.png deleted file mode 100644 index e0681d7..0000000 Binary files a/res/img/iron_key.png and /dev/null differ diff --git a/res/img/key.png b/res/img/key.png deleted file mode 100644 index 6615daa..0000000 Binary files a/res/img/key.png and /dev/null differ diff --git a/res/img/ladder.png b/res/img/ladder.png deleted file mode 100644 index 263cfe6..0000000 Binary files a/res/img/ladder.png and /dev/null differ diff --git a/res/img/lantern.png b/res/img/lantern.png deleted file mode 100644 index 41599c1..0000000 Binary files a/res/img/lantern.png and /dev/null differ diff --git a/res/img/lava.png b/res/img/lava.png deleted file mode 100644 index f737684..0000000 Binary files a/res/img/lava.png and /dev/null differ diff --git a/res/img/man.png b/res/img/man.png deleted file mode 100644 index 927a76a..0000000 Binary files a/res/img/man.png and /dev/null differ diff --git a/res/img/name.png b/res/img/name.png deleted file mode 100644 index d0aaa9c..0000000 Binary files a/res/img/name.png and /dev/null differ diff --git a/res/img/note.png b/res/img/note.png deleted file mode 100644 index d6127c9..0000000 Binary files a/res/img/note.png and /dev/null differ diff --git a/res/img/orb.png b/res/img/orb.png deleted file mode 100644 index 65bae96..0000000 Binary files a/res/img/orb.png and /dev/null differ diff --git a/res/img/portal1.png b/res/img/portal1.png deleted file mode 100644 index c700476..0000000 Binary files a/res/img/portal1.png and /dev/null differ diff --git a/res/img/portal2.png b/res/img/portal2.png deleted file mode 100644 index efcf225..0000000 Binary files a/res/img/portal2.png and /dev/null differ diff --git a/res/img/rioter.png b/res/img/rioter.png deleted file mode 100644 index c52dda8..0000000 Binary files a/res/img/rioter.png and /dev/null differ diff --git a/res/img/ruby.png b/res/img/ruby.png deleted file mode 100644 index 3ab2404..0000000 Binary files a/res/img/ruby.png and /dev/null differ diff --git a/res/img/sfx.png b/res/img/sfx.png deleted file mode 100644 index 6acbaef..0000000 Binary files a/res/img/sfx.png and /dev/null differ diff --git a/res/img/spike.png b/res/img/spike.png deleted file mode 100644 index e635bf6..0000000 Binary files a/res/img/spike.png and /dev/null differ diff --git a/res/img/spike_flip.png b/res/img/spike_flip.png deleted file mode 100644 index 5900f3b..0000000 Binary files a/res/img/spike_flip.png and /dev/null differ diff --git a/res/img/spike_move.png b/res/img/spike_move.png deleted file mode 100644 index fd06d9d..0000000 Binary files a/res/img/spike_move.png and /dev/null differ diff --git a/res/img/torch.png b/res/img/torch.png deleted file mode 100644 index 1a54768..0000000 Binary files a/res/img/torch.png and /dev/null differ diff --git a/res/img/trophy.png b/res/img/trophy.png deleted file mode 100644 index 08cd56d..0000000 Binary files a/res/img/trophy.png and /dev/null differ diff --git a/res/img/wall.png b/res/img/wall.png deleted file mode 100644 index b7bec0d..0000000 Binary files a/res/img/wall.png and /dev/null differ diff --git a/res/img/wall_dark.png b/res/img/wall_dark.png deleted file mode 100644 index 5cdc8ef..0000000 Binary files a/res/img/wall_dark.png and /dev/null differ diff --git a/res/img/wall_verydark.png b/res/img/wall_verydark.png deleted file mode 100644 index 917867a..0000000 Binary files a/res/img/wall_verydark.png and /dev/null differ diff --git a/res/img/woman.png b/res/img/woman.png deleted file mode 100644 index 803866a..0000000 Binary files a/res/img/woman.png and /dev/null differ diff --git a/res/img/woods.png b/res/img/woods.png deleted file mode 100644 index 281f1c6..0000000 Binary files a/res/img/woods.png and /dev/null differ diff --git a/res/js/draw.js b/res/js/draw.js deleted file mode 100644 index dc3ce14..0000000 --- a/res/js/draw.js +++ /dev/null @@ -1,682 +0,0 @@ -//--------------DRAW----------------- - -const platformImage = new Image(); -platformImage.src = "./res/img/block.png"; - -const darknessImage = new Image(); -darknessImage.src = "./res/img/darkness1.png"; - -const spikeMoveImage = new Image(); -spikeMoveImage.src = "./res/img/spike_move.png"; - -const lavaImage = new Image(); -lavaImage.src = "./res/img/lava.png"; - -const orbImage = new Image(); -orbImage.src = "./res/img/orb.png"; - -const crackedImage = new Image(); -crackedImage.src = "./res/img/cracked.png"; - -const woodsImage = new Image(); -woodsImage.src = "./res/img/woods.png"; - -const chainImage = new Image(); -chainImage.src = "./res/img/chain.png"; - -const bookImage = new Image(); -bookImage.src = "./res/img/bookshelf.png"; - -const doorImage = new Image(); -doorImage.src = "./res/img/door.png"; - -const chainDoorImage = new Image(); -chainDoorImage.src = "./res/img/chain_doors.png"; - -const portal1Image = new Image(); -portal1Image.src = "./res/img/portal1.png"; - -const portal2Image = new Image(); -portal2Image.src = "./res/img/portal2.png"; - -const blockBackImage = new Image(); -blockBackImage.src = "./res/img/block_dark.png"; - -const lanternImage = new Image(); -lanternImage.src = "./res/img/lantern.png"; - -const chainBackImage = new Image(); -chainBackImage.src = "./res/img/chain_back.png"; - -const torchImage = new Image(); -torchImage.src = "./res/img/torch.png" - -const bookshelfBackImage = new Image(); -bookshelfBackImage.src = "./res/img/bookshelf_back.png" - -const barrelImage = new Image(); -barrelImage.src = "./res/img/barrel.png" - -const ladderImage = new Image(); -ladderImage.src = "./res/img/ladder.png" - -const doorsImage = new Image(); -doorsImage.src = "./res/img/doors.png" - -const bossImage = new Image(); -bossImage.src = "./res/img/boss_s.png" - -const keyImage = new Image(); -keyImage.src = "./res/img/key.png" - -const ironImage = new Image(); -ironImage.src = "./res/img/iron.png" - -const ironKeyImage = new Image(); -ironKeyImage.src = "./res/img/iron_key.png" - -const trophyImage = new Image(); -trophyImage.src = "./res/img/trophy.png" - -const frameWidth = 30; -const frameHeight = 40; - -let sWidth = 30; -let sHeight = 40; -let sX = 30; -let sY = 40; - -let cordsPortalX1 = 0; -let cordsPortalY1 = 0; -let cordsPortalX2 = 0; -let cordsPortalY2 = 0 - -//----------------------------------- Blocks - -// 1 = Stone Brick -// 2 = Spike on bottom -// 3 = Lava -// 4 = Spike on top -// 5 = Orb -// 6 = Cracked Stone Brick -// 7 = Wood -// 8 = Chain -// 9 = Bookshelf -// 10 = Spike on bottom (Moving) -// 11 = Portal 1 -// 12 = Portal 2 -// 13 = Stone Brick (Background) -// 14 = Lantern -// 15 = Chain (Background) -// 16 = Torch -// 17 = Bookshelf (Background) -// 18 = Barrel -// 19 = Rotated Wood -// 20 = Spike on left (Moving) -// 21 = Spike on top (Moving) -// 22 = Spike on right (Moving) -// 23 = Spike on left -// 24 = Spike on Right -// 25 = Doors (Start) -// 26 = Ladder -// 27 = Wood (Background) -// 28 = Rotated Wood (Background) -// 30 = Doors (Finish) -// 31 = Key -// 32 = Iron Block -// 33 = Iron Block with Key hole -// 34 = Doors - Boss (Finish) -// 35 = Trophy -// 50 - 64 = Doors in the Lobby (Level 1 - 15) - -//-----------------------------Drawing Platform - -const drawPlatform = () => { - xBlock = 0; - yBlock = 0; - for (let index = 0; index < platformLevel1.length; index++) { - if(platformLevel1[index] == 1){ - c.drawImage(platformImage, xBlock,yBlock,32,32) - }else if(platformLevel1[index] == 2){ - c.drawImage(spikeMoveImage, 4 * 32, 0 * 32, 32, 32, xBlock, yBlock, 32, 32); - }else if(platformLevel1[index] == 3){ - c.drawImage(lavaImage, frameLava * 32, 0 * 32, 32, 32, xBlock, yBlock, 32, 32); - }else if(platformLevel1[index] == 4){ - c.drawImage(spikeMoveImage, 4 * 32, 2 * 32, 32, 32, xBlock, yBlock, 32, 32); - }else if(platformLevel1[index] == 5){ - c.drawImage(orbImage, frameOrb * 32, 0 * 32, 32, 32, xBlock, yBlock, 32, 32); - }else if(platformLevel1[index] == 6){ - c.drawImage(crackedImage, xBlock, yBlock, 32, 32) - }else if(platformLevel1[index] == 7){ - c.drawImage(woodsImage, 0 * 32, 0, 32, 32, xBlock, yBlock, 32, 32) - }else if(platformLevel1[index] == 8){ - c.drawImage(chainImage, xBlock, yBlock, 32, 32) - }else if(platformLevel1[index] == 9){ - c.drawImage(bookImage, xBlock, yBlock, 32, 32) - }else if(platformLevel1[index] == 10){ - c.drawImage(spikeMoveImage, frameSpike * 32, 0 * 32, 32, 32, xBlock, yBlock, 32, 32); - }else if(platformLevel1[index] == 20){ - c.drawImage(spikeMoveImage, frameSpike * 32, 1 * 32, 32, 32, xBlock, yBlock, 32, 32); - }else if(platformLevel1[index] == 21){ - c.drawImage(spikeMoveImage, frameSpike * 32, 2 * 32, 32, 32, xBlock, yBlock, 32, 32); - }else if(platformLevel1[index] == 22){ - c.drawImage(spikeMoveImage, frameSpike * 32, 3 * 32, 32, 32, xBlock, yBlock, 32, 32); - }else if(platformLevel1[index] == 23){ - c.drawImage(spikeMoveImage, 4 * 32, 1 * 32, 32, 32, xBlock, yBlock, 32, 32); - }else if(platformLevel1[index] == 24){ - c.drawImage(spikeMoveImage, 4 * 32, 3 * 32, 32, 32, xBlock, yBlock, 32, 32); - }else if(platformLevel1[index] == 32){ - c.drawImage(ironImage, 0 * 32, 0 * 32, 32, 32, xBlock, yBlock, 32, 32); - }else if(platformLevel1[index] == 33){ - c.drawImage(ironKeyImage, 0 * 32, 0 * 32, 32, 32, xBlock, yBlock, 32, 32); - }else if(platformLevel1[index] == 18){ - c.drawImage(barrelImage, xBlock, yBlock, 32, 32) - }else if(platformLevel1[index] == 19){ - c.drawImage(woodsImage, 1 * 32, 0, 32, 32, xBlock, yBlock, 32, 32) - } - if((index + 1) % 32 == 0){ - xBlock = 0; - yBlock += 32; - }else{ - xBlock += 32; - } - } -} - -//-----------------------------Drawing Blocks in background - -let frameDoorFinal = 3; - -const drawBackBlocks = () => { - xBlock = 0; - yBlock = 0; - for (let index = 0; index < platformLevel1.length; index++) { - if(platformLevel1[index] == 13){ - c.drawImage(blockBackImage, xBlock, yBlock, 32, 32) - }else if(platformLevel1[index] == 11){ - cordsPortalX1 = xBlock - 32; - cordsPortalY1 = yBlock + 22; - c.drawImage(portal1Image, framePortal * 32, 0 * 32, 32, 64, xBlock, yBlock, 32, 64); - }else if(platformLevel1[index] == 12){ - cordsPortalX2 = xBlock + 32; - cordsPortalY2 = yBlock + 22; - c.drawImage(portal2Image, framePortal * 32, 0 * 32, 32, 64, xBlock, yBlock, 32, 64); - }else if(platformLevel1[index] == 14){ - c.drawImage(lanternImage, frameLantern * 32, 0 * 32, 32, 32, xBlock, yBlock, 32, 32); - }else if(platformLevel1[index] == 15){ - c.drawImage(chainBackImage, xBlock, yBlock, 32, 32) - }else if(platformLevel1[index] == 16){ - c.drawImage(torchImage, frameTorch * 32, 0 * 32, 32, 32, xBlock, yBlock, 32, 32); - }else if(platformLevel1[index] == 17){ - c.drawImage(bookshelfBackImage, xBlock, yBlock, 32, 32) - }else if(platformLevel1[index] == 25){ - c.drawImage(doorImage, xBlock, yBlock, 64, 64); - }else if(platformLevel1[index] == 26){ - c.drawImage(ladderImage, xBlock, yBlock, 32, 32); - }else if(platformLevel1[index] == 27){ - c.drawImage(woodsImage, 2 * 32, 0, 32, 32, xBlock, yBlock, 32, 32) - }else if(platformLevel1[index] == 28){ - c.drawImage(woodsImage, 3 * 32, 0, 32, 32, xBlock, yBlock, 32, 32) - }else if(platformLevel1[index] == 30){ - c.drawImage(chainDoorImage, frameDoor * 64, 0 * 32, 64, 64, xBlock, yBlock, 64, 64); - }else if(platformLevel1[index] == 31){ - c.drawImage(keyImage, 0 * 64, 0 * 32, 64, 64, xBlock, yBlock, 64, 64); - }else if(platformLevel1[index] == 34){ - c.drawImage(chainDoorImage, frameDoorFinal * 64, 0 * 32, 64, 64, xBlock, yBlock, 64, 64); - }else if(platformLevel1[index] == 35){ - c.drawImage(trophyImage, xBlock, yBlock, 32, 32); - } - //---DOORS IN MENU - else if(platformLevel1[index] == 50){ - c.drawImage(doorsImage, 0 * 64, finished[0] * 64, 64, 64, xBlock, yBlock, 64, 64); - }else if(platformLevel1[index] == 51){ - c.drawImage(doorsImage, 1 * 64, finished[1] * 64, 64, 64, xBlock, yBlock, 64, 64); - }else if(platformLevel1[index] == 52){ - c.drawImage(doorsImage, 2 * 64, finished[2] * 64, 64, 64, xBlock, yBlock, 64, 64); - }else if(platformLevel1[index] == 53){ - c.drawImage(doorsImage, 3 * 64, finished[3] * 64, 64, 64, xBlock, yBlock, 64, 64); - }else if(platformLevel1[index] == 54){ - c.drawImage(doorsImage, 4 * 64, finished[4] * 64, 64, 64, xBlock, yBlock, 64, 64); - }else if(platformLevel1[index] == 55){ - c.drawImage(doorsImage, 5 * 64, finished[5] * 64, 64, 64, xBlock, yBlock, 64, 64); - }else if(platformLevel1[index] == 56){ - c.drawImage(doorsImage, 6 * 64, finished[6] * 64, 64, 64, xBlock, yBlock, 64, 64); - }else if(platformLevel1[index] == 57){ - c.drawImage(doorsImage, 7 * 64, finished[7] * 64, 64, 64, xBlock, yBlock, 64, 64); - }else if(platformLevel1[index] == 58){ - c.drawImage(doorsImage, 8 * 64, finished[8] * 64, 64, 64, xBlock, yBlock, 64, 64); - }else if(platformLevel1[index] == 59){ - c.drawImage(doorsImage, 9 * 64, finished[9] * 64, 64, 64, xBlock, yBlock, 64, 64); - }else if(platformLevel1[index] == 60){ - c.drawImage(doorsImage, 10 * 64, finished[10] * 64, 64, 64, xBlock, yBlock, 64, 64); - }else if(platformLevel1[index] == 61){ - c.drawImage(doorsImage, 11 * 64, finished[11] * 64, 64, 64, xBlock, yBlock, 64, 64); - }else if(platformLevel1[index] == 62){ - c.drawImage(doorsImage, 12 * 64, finished[12] * 64, 64, 64, xBlock, yBlock, 64, 64); - }else if(platformLevel1[index] == 63){ - c.drawImage(doorsImage, 13 * 64, finished[13] * 64, 64, 64, xBlock, yBlock, 64, 64); - }else if(platformLevel1[index] == 64){ - c.drawImage(doorsImage, 14 * 64, finished[14] * 64, 64, 64, xBlock, yBlock, 64, 64); - } - if((index + 1) % 32 == 0){ - xBlock = 0; - yBlock += 32; - }else{ - xBlock += 32; - } - } -} - -//----------------------------------------Drawing Darkness - -let darkness = false; - -const dark = () => { - if(darkness){ - c.drawImage(darknessImage, x - 1487, y - 990, 3000, 2000); - } -} - -//----------------------------------------Drawing Ghost - -let ghostImage = new Image(); -ghostImage.src = "./res/img/ghost.png"; - -let canDieOnSpike = false; - -let ghostVelocity = 2 - -let ghostFrame1 = 0; -let ghostFrame2 = 2; - -const drawGhost = () => { - ghostImage.src = "./res/img/ghost.png"; - if(ghostVelocity == 2){ - c.drawImage(ghostImage, ghostFrame1 * 30, 0 * 40, 30, 40, xGhost, yGhost, 30, 40); - }else{ - c.drawImage(ghostImage, ghostFrame2 * 30, 0 * 40, 30, 40, xGhost, yGhost, 30, 40); - } - for (let i = 0; i < platformLevel1.length; i++) { - if (platformLevel1[i] == 1 || platformLevel1[i] == 2 || platformLevel1[i] == 6 || platformLevel1[i] == 7 || platformLevel1[i] == 9 || platformLevel1[i] == 18 || platformLevel1[i] == 19) { - let platformX = (i % 32) * 32; - let platformY = Math.floor(i / 32) * 32; - if ( - yGhost + height >= platformY && - yGhost <= platformY + 32 && - xGhost + width + ghostVelocity >= platformX && - xGhost <= platformX + 32 - ) { - ghostVelocity = -2; - }else if (platformLevel1[i] == 1 || platformLevel1[i] == 2 || platformLevel1[i] == 6 || platformLevel1[i] == 7 || platformLevel1[i] == 9 || platformLevel1[i] == 18|| platformLevel1[i] == 19) { - let platformX = (i % 32) * 32; - let platformY = Math.floor(i / 32) * 32; - if ( - yGhost + height >= platformY && - yGhost <= platformY + 32 && - xGhost + ghostVelocity <= platformX + 32 && - xGhost >= platformX - ) { - ghostVelocity = 2; - } - } - } - } - cancelAnimationFrame(drawingId); - drawing(); -} - -//----------------------------------------Drawing BOSS - -const drawBoss = () => { - bossImage.src = "./res/img/boss_s.png"; - if(!bossAttacking){ - c.drawImage(bossImage, currentFrameBoss * 130, 0 * 130, 130, 130, bossX, bossY, 80, 80) - }else{ - c.drawImage(bossImage, currentFrameBoss * 130, 1 * 130, 130, 130, bossX, bossY, 80, 80) - } -} - -//----------------------------------------SPRITE SHEET ANIMATIONS - -let nowPlayer, nowLava, nowSpike, nowPortal, nowTorch, nowLantern, nowOrb, now24, now6, now8, now4, nowGhost, nowGhostS, nowDoor, nowBoss; -let deltaPlayer, deltaLava, deltaSpike, deltaPortal, deltaTorch, deltaLantern, deltaOrb, delta24, delta6, delta8, delta4, deltaGhost, deltaGhostS, deltaDoor, deltaBoss; -let thenPlayer = Date.now(); -let thenLava = Date.now(); -let thenSpike = Date.now(); -let thenPortal = Date.now(); -let thenTorch = Date.now(); -let thenLantern = Date.now(); -let thenOrb = Date.now(); -let then24 = Date.now(); -let then6 = Date.now(); -let then8 = Date.now(); -let then4 = Date.now(); -let thenGhost = Date.now(); -let thenGhostS = Date.now(); -let thenDoor = Date.now(); -let thenBoss = Date.now(); - -let drawingId; - -let currentFrame = 0; -let currentFrameStand = 0; -let currentFrameRun = 0; -let currentFramePunch = 0; -let currentFrameCrouch = 0; -let currentFrameBoss = 0; - -let frameLava = 0; -let frameSpike = 0; -let framePortal = 0; -let frameTorch = 0; -let frameLantern = 0; -let frameOrb = 0; -let frameDoor = 0; - -let nowRise; -let thenRise = Date.now(); -let deltaRise; - -let risingPercent = -148; -let risingPercentOriginal = -148; -let lavaY = 576; -let risingLavaActivated = false; -let lavaIncreaseValue = 3.6; -let risingIncreaseValue = 0.6; - -const drawing = () => { - drawingId = requestAnimationFrame(drawing); - //Player - nowPlayer = Date.now(); - deltaPlayer = nowPlayer - thenPlayer; - if (deltaPlayer > 1) { - thenPlayer = nowPlayer - (deltaPlayer % 1); - drawPlayer(); - } - //Lava - nowLava = Date.now(); - deltaLava = nowLava - thenLava; - if (deltaLava > 150) { - thenLava = nowLava - (deltaLava % 150); - frameLava++ - if(frameLava == 3){ - frameLava = 0; - } - } - //Spike - nowSpike = Date.now(); - deltaSpike = nowSpike - thenSpike; - if (deltaSpike > 175) { - thenSpike = nowSpike - (deltaSpike % 175); - frameSpike++; - if(frameSpike == 0 || frameSpike >= 10){ - canDieOnSpike = false; - }else{ - canDieOnSpike = true; - } - if(frameSpike == 17){ - frameSpike = 0; - } - } - //Portals - nowPortal = Date.now(); - deltaPortal = nowPortal - thenPortal; - if (deltaPortal > 200) { - thenPortal = nowPortal - (deltaPortal % 200); - framePortal++; - if(framePortal == 2){ - framePortal = 0; - } - } - //Torch - nowTorch = Date.now(); - deltaTorch = nowTorch - thenTorch; - if (deltaTorch > 200) { - thenTorch = nowTorch - (deltaTorch % 200); - frameTorch++; - if(frameTorch == 5){ - frameTorch = 0; - } - } - //Lantern - nowLantern = Date.now(); - deltaLantern = nowLantern - thenLantern; - if (deltaLantern > 200) { - thenLantern = nowLantern - (deltaLantern % 200); - frameLantern++; - if(frameLantern == 4){ - frameLantern = 0; - } - } - //Orb - nowOrb = Date.now(); - deltaOrb = nowOrb - thenOrb; - if (deltaOrb > 200) { - thenOrb = nowOrb - (deltaOrb % 200); - frameOrb++; - if(frameOrb == 2){ - frameOrb = 0; - } - } - //Chain Door - if(doorTimeout){ - nowDoor = Date.now(); - deltaDoor = nowDoor - thenDoor; - if (deltaDoor > 100) { - thenDoor = nowDoor - (deltaDoor % 100); - if(frameDoor != 3){ - frameDoor++; - }else{ - if(playingBossFight){ - hearts = 0; - } - dead(); - } - } - } - //Rising Lava - if(risingLavaActivated){ - nowRise = Date.now(); - deltaRise = nowRise - thenRise; - if (deltaRise > 200) { - thenRise = nowRise - (deltaRise % 200); - if(playingBossFight){ - risingPercent += risingIncreaseValue;; - }else{ - risingPercent += 0.3; - } - rising.style.bottom = risingPercent + "%" - if(playingBossFight){ - lavaY -= lavaIncreaseValue; - }else{ - lavaY -= 1.8; - } - if (y + height >= lavaY) { - if(playingBossFight){ - resistence = false; - } - dead(); - } - } - } - //----Sprite sheet Player - //Animate24 (Stand) - now24 = Date.now(); - delta24 = now24 - then24; - if (delta24 > 100) { - then24 = now24 - (delta24 % 100); - currentFrameStand++ - if(currentFrameStand % 24 == 0){ - currentFrameStand = 0; - } - } - //Animate6 (Punch) - now6 = Date.now(); - delta6 = now6 - then6; - if (delta6 > 100) { - then6 = now6 - (delta6 % 100); - if(punched){ - currentFramePunch++; - if(currentFramePunch % 6 == 0){ - currentFramePunch = 0; - punchCooldown = false; - punched = false; - } - } - } - //Animate8 (Run) - now8 = Date.now(); - delta8 = now8 - then8; - if (delta8 > 80) { - then8 = now8 - (delta8 % 80); - currentFrameRun++ - if(currentFrameRun % 8 == 0){ - currentFrameRun = 0; - } - sfxWalkFunction(); - } - //Animate4 (Crouch & Climb) - now4 = Date.now(); - delta4 = now4 - then4; - if (delta4 > 100) { - then4 = now4 - (delta4 % 100); - if(ladderCol == true && velocityGoingDown <= 0.1 && velocityGoingUp <= 0.1 && velocityRight <= 0.1 && velocityLeft <= 0.1){ - currentFrameCrouch = 0 - }else{ - currentFrameCrouch++; - if(currentFrameCrouch % 4 == 0){ - currentFrameCrouch = 0; - } - } - } - //---Ghost - //Ghost Velocity - nowGhost = Date.now(); - deltaGhost = nowGhost - thenGhost; - if (deltaGhost > 25) { - thenGhost = nowGhost - (deltaGhost % 25); - xGhost += ghostVelocity; - } - //--------------------Ghost Sprite sheet - nowGhostS = Date.now(); - deltaGhostS = nowGhostS - thenGhostS; - if (deltaGhostS > 200) { - thenGhostS = nowGhostS - (deltaGhostS % 200); - if (ghostVelocity == 2) { - ghostFrame1++; - if(ghostFrame1 == 2){ - ghostFrame1 = 0; - } - }else{ - ghostFrame2++; - if(ghostFrame2 == 4){ - ghostFrame2 = 2; - } - } - } - //--------------------BOSS Sprite sheet - nowBoss = Date.now(); - deltaBoss = nowBoss - thenBoss; - if (deltaBoss > 250) { - thenBoss = nowBoss - (deltaBoss % 100); - currentFrameBoss++ - if(currentFrameBoss == 6){ - sfx.src = "./res/sfx/boss_slash.mp3" - sfx.play(); - } - if(currentFrameBoss % 4 == 0 && !bossAttacking){ - currentFrameBoss = 0; - }else if(currentFrameBoss % 13 == 0 && bossAttacking){ - bossAttacking = false; - bossVelocity = 1; - currentFrameBoss = 0; - } - } -} -//----------------------------------------Drawing Player - -let playerImage = new Image(); -playerImage.src = "./res/img/rioter.png"; - -let drawPlayer = () => { - playerImage.src = player; - c.clearRect(0, 0, canvas.width, canvas.height); - if(velocity == 0 && velocityJump == 0 && !isMovingRight && !isMovingLeft && turnedRight && !punched && !crouched && !ladderCol){ //Right Stand - drawBackBlocks(); - c.drawImage(playerImage, currentFrameStand * sX, 0 * sY, sWidth, sHeight, x, y, frameWidth, frameHeight) - cancelAnimationFrame(drawingId); - drawing(); - }else if(velocity == 0 && velocityJump == 0 && !isMovingRight && !isMovingLeft && turnedLeft && !punched && !crouched && !ladderCol){ //Left Stand - drawBackBlocks(); - c.drawImage(playerImage, currentFrameStand * sX, 1 * sY, sWidth, sHeight, x, y, frameWidth, frameHeight); - cancelAnimationFrame(drawingId); - drawing(); - }else if(velocity > 0 && turnedRight && !punched && !crouched && !ladderCol){ //Right Fall - drawBackBlocks(); - c.drawImage(playerImage, 0 * sX, 0 * sY, sWidth, sHeight, x, y, frameWidth, frameHeight); - cancelAnimationFrame(drawingId); - }else if(velocity > 0 && turnedLeft && !punched && !crouched && !ladderCol){ //Left Fall - drawBackBlocks(); - c.drawImage(playerImage, 0 * sX, 1 * sY, sWidth, sHeight, x, y, frameWidth, frameHeight); - cancelAnimationFrame(drawingId); - }else if(velocityJump > 0 && turnedRight && !punched && !crouched && !ladderCol){ //Right Jump - drawBackBlocks(); - c.drawImage(playerImage, 0 * sX, 4 * sY, sWidth, sHeight, x, y, frameWidth, frameHeight); - cancelAnimationFrame(drawingId); - }else if(velocityJump > 0 && turnedLeft && !punched && !crouched && !ladderCol){ //Left Jump - drawBackBlocks(); - c.drawImage(playerImage, 0 * sX, 5 * sY, sWidth, sHeight, x, y, frameWidth, frameHeight); - cancelAnimationFrame(drawingId); - }else if(velocity == 0 && velocityJump == 0 && isMovingRight && !punched && !crouched && !ladderCol){ //Right Run - drawBackBlocks(); - c.drawImage(playerImage, currentFrameRun * sX, 2 * sY, sWidth, sHeight, x, y, frameWidth, frameHeight); - cancelAnimationFrame(drawingId); - drawing(); - }else if(velocity == 0 && velocityJump == 0 && isMovingLeft && !punched && !crouched && !ladderCol){ //Left Run - drawBackBlocks(); - c.drawImage(playerImage, currentFrameRun * sX, 3 * sY, sWidth, sHeight, x, y, frameWidth, frameHeight); - cancelAnimationFrame(drawingId); - drawing(); - }else if(punched && turnedRight && !ladderCol){ //Right Punch - drawBackBlocks(); - c.drawImage(playerImage, currentFramePunch * sX, 8 * sY, sWidth, sHeight, x, y, frameWidth, frameHeight); - cancelAnimationFrame(drawingId); - drawing(); - }else if(punched && turnedLeft && !ladderCol){ //Left Punch - drawBackBlocks(); - c.drawImage(playerImage, currentFramePunch * sX, 9 * sY, sWidth, sHeight, x, y, frameWidth, frameHeight); - cancelAnimationFrame(drawingId); - drawing(); - }else if((!isMovingRight && !isMovingLeft && crouched && turnedRight && !punched) || (isMovingRight && isMovingLeft && crouched && turnedRight && !punched)){ //Crouched Right - drawBackBlocks(); - c.drawImage(playerImage, 0 * sX, 6 * sY, sWidth, sHeight, x, y - height, frameWidth, frameHeight); - cancelAnimationFrame(drawingId); - }else if((!isMovingRight && !isMovingLeft && crouched && turnedLeft && !punched) || (isMovingRight && isMovingLeft && crouched && turnedLeft && !punched)){ //Crouched Left - drawBackBlocks(); - c.drawImage(playerImage, 0 * sX, 7 * sY, sWidth, sHeight, x, y - height, frameWidth, frameHeight); - cancelAnimationFrame(drawingId); - }else if(isMovingRight && !isMovingLeft && crouched && !punched){ //Crouched Right Moving - drawBackBlocks(); - c.drawImage(playerImage, currentFrameCrouch * sX, 6 * sY, sWidth, sHeight, x, y - height, frameWidth, frameHeight); - cancelAnimationFrame(drawingId); - drawing(); - }else if(crouched && isMovingLeft && !isMovingRight && !punched){ //Crouched Left Moving - drawBackBlocks(); - c.drawImage(playerImage, currentFrameCrouch * sX, 7 * sY, sWidth, sHeight, x, y - height, frameWidth, frameHeight); - cancelAnimationFrame(drawingId); - drawing(); - }else if (ladderCol && !crouched){ //Climbing - drawBackBlocks(); - c.drawImage(playerImage, currentFrameCrouch * sX, 10 * sY, sWidth, sHeight, x, y, frameWidth, frameHeight); - cancelAnimationFrame(drawingId); - drawing(); - } - drawGhost(); - drawPlatform(); - objectsCollision(); - orbCollision(); - ladderCollision(); - doorsCollision(); - drawBoss(); - dark(); -}; \ No newline at end of file diff --git a/res/js/maps.js b/res/js/maps.js deleted file mode 100644 index 3a1b524..0000000 --- a/res/js/maps.js +++ /dev/null @@ -1,401 +0,0 @@ -//--------------MAPS----------------- - -// 1 = Stone Brick -// 2 = Spike on bottom -// 3 = Lava -// 4 = Spike on top -// 5 = Orb -// 6 = Cracked Stone Brick -// 7 = Wood -// 8 = Chain -// 9 = Bookshelf -// 10 = Spike on bottom (Moving) -// 11 = Portal 1 -// 12 = Portal 2 -// 13 = Stone Brick (Background) -// 14 = Lantern -// 15 = Chain (Background) -// 16 = Torch -// 17 = Bookshelf (Background) -// 18 = Barrel -// 19 = Rotated Wood -// 20 = Spike on left (Moving) -// 21 = Spike on top (Moving) -// 22 = Spike on right (Moving) -// 23 = Spike on left -// 24 = Spike on Right -// 25 = Doors (Start) -// 26 = Ladder -// 27 = Wood (Background) -// 28 = Rotated Wood (Background) -// 30 = Doors (Finish) -// 31 = Key -// 32 = Iron Block -// 33 = Iron Block with Key hole -// 34 = Doors - Boss (Finish) -// 35 = Trophy -// 50 - 64 = Doors in the Lobby (Level 1 - 15) - -//---------------------------------------------------------- Lobby -let platformLevel1 = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 15, 0, 0, 0, 0, 1, 0, 0, 15, 0, 0, 0, 8, 62, 0, 8, 0,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, 0, 0, 51, 0, 0, 0, 1, 0, 16, 0, 0, 0, 26, 19, 7, 7, 7, 7, 7, 0, 8, 54, 0, 8, 0, - 14, 0, 0, 0, 0, 0, 16, 0, 14, 0, 0, 14, 0, 1, 0, 0, 0, 7, 7, 26, 19, 0, 0, 0, 0, 17, 0, 8, 0, 0, 8, 26, - 9, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 0, 1, 13, 5, 0, 19, 0, 26, 19, 0, 0, 16, 0, 17, 17, 7, 7, 7, 7, 26, - 9, 17, 0, 50, 0, 0, 7, 0, 28, 0, 0, 28, 0, 1, 13, 13, 0, 19, 17, 26, 28, 0, 53, 0, 0, 9, 9, 17, 0, 12, 0, 26, - 9, 17, 17, 0, 0, 18, 19, 0, 28, 0, 0, 28, 0, 13, 13, 13, 14, 19, 9, 26, 28, 14, 0, 0, 18, 9, 9, 9, 17, 0, 0, 26, - 7, 7, 7, 7, 7, 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 1, 1, 1, 1, 1] - -//1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -//0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -let originalPlatform1 = [...platformLevel1]; -let lobby = [...platformLevel1]; - -let map = new Array (16) - -//---------------------------------------------------------- Level 1 - -map[0] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 19, 0, 8, 0, 0, 0, 8, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,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, 8, 19, 19, 8, 0, 0, 0, 0, 26, 19, 27, 27, 27, 27, - 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 8, 7, 7, 8, 0, 0, 0, 0, 26, 7, 7, 7, 7, 7, - 9, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 17, 17, 10, 17, 0, 14, 0, 8, 0, 0, 8, 0, 14, 0, 0, 26, 0, 0, 0, 0, 0, - 9, 25, 0, 0, 17, 17, 17, 0, 0, 14, 7, 7, 7, 7, 7, 7, 1, 7, 7, 7, 7, 7, 7, 1, 0, 0, 0, 0, 0, 0, 14, 18, - 9, 0, 0, 0, 17, 9, 17, 17, 0, 18, 19, 28, 28, 28, 28, 19, 1, 0, 0, 0, 0, 0, 0, 1, 18, 0, 0, 0, 0, 0, 18, 18, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1] - -//---------------------------------------------------------- Level 2 - -map[1] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 8, 0, 0, 0, 0, 0, 8, 0, 8, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 30, 0, 1, - 0, 0, 0, 0, 14, 0, 0, 0, 8, 0, 8, 0, 16, 0, 0, 0, 8, 0, 8, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 1, - 0, 0, 0, 0, 1, 1, 1, 0, 8, 0, 8, 0, 0, 26, 26, 0, 8, 0, 8, 0, 26, 26, 0, 14, 0, 32, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 1, 1, 0, 0, 0, 7, 7, 7, 0, 0, 0, 0, 0, 8, 0, 8, 0, 0, 0, 0, 1, 1, 1, 1, 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, 0, 26, 8, 0, 8, 0, 0, 0, 0, - 13, 13, 1, 9, 9, 17, 0, 0, 0, 0, 8, 0, 8, 0, 0, 8, 0, 8, 0, 1, 1, 1, 1, 1, 26, 7, 7, 7, 0, 0, 0, 0, - 13, 13, 1, 9, 9, 17, 17, 0, 0, 0, 7, 7, 7, 0, 0, 8, 0, 8, 0, 4, 0, 0, 0, 1, 26, 0, 0, 0, 0, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 4, 0, 0, 0, 0, 7, 7, 7, 0, 0, 0, 0, 0, 1, 26, 0, 0, 0, 0, 1, 1, 1, - 25, 0, 0, 0, 0, 4, 19, 19, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 17, 0, 1, 1, 1, 0, 0, 26, 1, 13, 13, - 0, 0, 0, 0, 0, 0, 19, 19, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 17, 9, 0, 0, 0, 1, 1, 1, 26, 1, 13, 13, - 1, 1, 1, 0, 0, 0, 28, 28, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 17, 9, 9, 17, 0, 0, 0, 0, 0, 26, 1, 13, 13, - 13, 13, 1, 0, 0, 0, 28, 28, 0, 0, 0, 1, 1, 1, 1, 13, 1, 0, 17, 9, 9, 9, 9, 17, 0, 0, 0, 0, 26, 1, 13, 13, - 13, 13, 1, 0, 7, 7, 7, 7, 7, 7, 0, 1, 13, 13, 13, 13, 1, 7, 7, 7, 7, 7, 7, 7, 0, 0, 18, 0, 26, 1, 13, 13, - 13, 13, 1, 2, 19, 28, 28, 28, 28, 19, 2, 1, 13, 13, 13, 13, 1, 28, 28, 28, 28, 28, 28, 19, 0, 18, 18, 0, 26, 1, 13, 13, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] - -//---------------------------------------------------------- Level 4 - -map[3] =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 17, 0, 14, 8, 0, 18, 7, 7, 7, 7, 26, 0, 31, 0, - 7, 7, 7, 7, 7, 7, 1, 0, 8, 0, 0, 8, 0, 1, 1, 1, 7, 7, 7, 7, 7, 7, 7, 1, 1, 0, 0, 0, 26, 18, 14, 0, - 0, 0, 0, 0, 0, 0, 8, 0, 8, 0, 0, 8, 0, 4, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 18, 18, 0, - 14, 0, 0, 16, 0, 0, 8, 0, 8, 0, 0, 8, 0, 0, 0, 8, 0, 16, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 18, 18, 18, - 9, 0, 0, 0, 0, 0, 7, 7, 7, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 0, 7, 7, 7, 7, 0, 14, 0, 0, 1, 1, 1, 1, - 9, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 0, 1, 9, 17, 17, 19, 19, 0, 0, 1, 1, 1, 1, 13, 13, 1, - 9, 0, 0, 0, 18, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 9, 9, 17, 19, 19, 0, 18, 1, 13, 13, 13, 13, 13, 1, - 7, 7, 7, 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 13, 13, 13, 13, 1] - -//---------------------------------------------------------- Level 5 - -map[4] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 1, 0, 0, 8, 0, 0, 19, 8, 8, 0, 8, 0, 0, 8, 0, 8, 0, 8, 0, 0, 8, - 8, 0, 0, 0, 26, 0, 0, 0, 0, 8, 0, 4, 0, 16, 8, 0, 0, 19, 8, 8, 0, 8, 0, 0, 8, 0, 8, 0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, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 0, 2, 1, 1, 2, 0, 0, 1, 13, 13, - 13, 13, 1, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 3, 1, 13, 13] - -//---------------------------------------------------------- Level 7 - -map[6] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 23, 0, 0, 0, 0, 0, 0, 1, 13, 1, 0, 0, 8, 0, 0, 0, 0, 8, 1, 13, 1, 27, 27, 27, 27, 1, 13, 1, 0, 0, 19, - 1, 23, 0, 0, 0, 14, 0, 0, 1, 1, 1, 0, 0, 8, 0, 0, 0, 0, 8, 1, 1, 1, 7, 7, 7, 7, 1, 1, 1, 0, 0, 19, - 1, 23, 0, 0, 1, 1, 1, 0, 19, 0, 4, 0, 0, 8, 0, 26, 26, 0, 8, 0, 0, 0, 21, 21, 21, 21, 0, 0, 0, 0, 0, 19, - 1, 0, 5, 0, 1, 13, 1, 0, 19, 0, 0, 0, 0, 8, 0, 0, 0, 0, 8, 0, 0, 0, 10, 10, 10, 10, 0, 0, 0, 0, 0, 19, - 0, 0, 0, 0, 1, 13, 1, 0, 0, 14, 0, 0, 0, 8, 0, 16, 0, 0, 7, 7, 1, 1, 7, 7, 7, 7, 1, 1, 0, 0, 17, 19, - 0, 16, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 7, 23, 0, 0, 2, 0, 0, 0, 1, 17, 0, 0, 0, 0, 32, 0, 0, 17, 19, - 0, 0, 7, 7, 7, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 9, 17, 30, 0, 0, 33, 0, 17, 9, 19, - 0, 26, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 1, 0, 31, 0, 1, 9, 9, 0, 0, 14, 32, 17, 9, 9, 19, - 18, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 19, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 26, 0, 0, 0, 15, 0, 0, 0, 0, 8, 8, 0, - 19, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 14, 0, 0, 0, 14, 0, 7, 7, 7, 26, 0, 0, 0, 15, 0, 0, 0, 0, 8, 8, 0, - 7, 7, 7, 7, 0, 0, 1, 0, 2, 2, 0, 1, 0, 0, 0, 7, 7, 19, 28, 19, 26, 0, 0, 0, 14, 0, 0, 0, 0, 7, 7, 0, - 0, 0, 0, 15, 0, 0, 4, 0, 7, 7, 0, 13, 0, 0, 0, 0, 0, 19, 28, 19, 0, 0, 0, 5, 0, 0, 0, 16, 0, 4, 4, 0, - 0, 12, 0, 15, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 14, 25, 0, 19, 28, 19, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, - 0, 0, 0, 14, 0, 0, 0, 14, 0, 0, 0, 13, 0, 0, 18, 0, 0, 19, 28, 19, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 5, 0, 18, 0, 1, 1, 1, 3, 3, 1, 7, 7, 19, 28, 19, 20, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, - 3, 3, 3, 3, 3, 3, 3, 1, 3, 1, 13, 1, 1, 1, 1, 28, 28, 19, 28, 19, 3, 3, 3, 3, 3, 3, 1, 13, 13, 1, 3, 3] - -//---------------------------------------------------------- Level 8 - -map[7] = [13, 13, 13, 13, 13, 13, 1, 1, 1, 1, 1, 1, 1, 13, 13, 13, 1, 1, 1, 1, 1, 1, 13, 13, 13, 13, 13, 13,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, 26, 0, 18, 18, 1, 1, 1, 1, 1, 1, 26, 1, 0, 0, 1, 1, 1, 1, - 26, 0, 0, 0, 0, 0, 4, 1, 1, 1, 1, 1, 26, 26, 26, 1, 1, 1, 1, 0, 0, 0, 0, 0, 26, 1, 0, 0, 0, 6, 0, 1, - 26, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 1, 0, 0, 0, 6, 0, 1, - 1, 1, 1, 0, 17, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, - 25, 0, 0, 0, 17, 17, 0, 1, 0, 0, 0, 1, 0, 18, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 24, 1, 30, 0, 0, 1, - 0, 0, 0, 17, 9, 9, 17, 0, 0, 0, 0, 1, 7, 7, 7, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 24, 1, 0, 0, 0, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] - -//---------------------------------------------------------- Level 9 - -map[8] = [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 1, 1, 1, 1, 1, 1, 1, 13, 13, 13, 13, 13, - 8, 0, 8, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 1, 0, 8, 0, 1, 1, 1, 0, 0, 0, 0, 4, 1, 13, 13, 13, 13, 13, - 8, 31, 8, 0, 0, 0, 17, 0, 0, 19, 0, 0, 0, 0, 1, 0, 8, 0, 1, 4, 4, 0, 0, 0, 0, 0, 1, 13, 13, 13, 13, 13, - 7, 7, 7, 0, 0, 17, 17, 0, 0, 32, 0, 16, 0, 0, 6, 0, 8, 0, 0, 0, 0, 0, 16, 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 0, 14, 1, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 16, 0, 0, 1, 5, - 19, 28, 19, 0, 14, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 14, 0, 0, 0, 0, 13, 13, 13, 1, 0, 0, 2, 0, 0, 0, - 19, 28, 19, 0, 1, 1, 2, 0, 10, 10, 1, 1, 1, 2, 0, 0, 10, 1, 10, 0, 0, 13, 13, 13, 13, 13, 0, 0, 1, 0, 0, 0, - 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1] - -//---------------------------------------------------------- Level 10 - -map[9] = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 1, 13, 13, 13, 1, 1, 1, 1, 1, 1, 1, 1, 13, 13, 13, 13, 13, - 1, 17, 0, 16, 0, 0, 17, 0, 0, 16, 0, 17, 9, 17, 0, 1, 13, 13, 13, 1, 17, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, - 1, 9, 0, 0, 0, 17, 9, 17, 0, 0, 0, 17, 9, 17, 0, 1, 13, 13, 13, 1, 9, 17, 30, 0, 0, 0, 0, 0, 0, 0, 0, 1, - 1, 9, 17, 0, 0, 17, 9, 9, 17, 0, 17, 9, 9, 17, 0, 1, 13, 13, 13, 1, 9, 9, 0, 0, 0, 0, 0, 14, 0, 26, 0, 1, - 1, 9, 9, 17, 0, 9, 9, 9, 17, 17, 9, 9, 9, 9, 17, 1, 1, 1,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, 0, 1, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 1, 0, 1, 13, 13, 13] - -//---------------------------------------------------------- Level 11 - -map[10] = [1, 1, 1, 1, 1, 1, 1, 1, 7, 7, 7, 7, 7, 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 8, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - 0, 12, 0, 0, 7, 0, 0, 1, 18, 14, 30, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 26, 0, 1, - 0, 0, 0, 0, 4, 0, 17, 1, 18, 18, 0, 0, 14, 0, 0, 1, 0, 0, 26, 26, 26, 8, 1, 1, 1, 1, 0, 1, 1, 26, 0, 1, - 16, 0, 0, 0, 0, 0, 9, 1, 1, 1, 1, 1, 1, 1, 5, 1, 0, 0, 0, 0, 0, 8, 1, 0, 8, 0, 0, 0, 0, 26, 0, 1, - 0, 0, 0, 5, 0, 17, 9, 1, 13, 13, 13, 13, 13, 1, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 8, 0, 0, 0, 0, 26, 0, 1, - 0, 0, 0, 0, 2, 9, 9, 1, 13, 13, 13, 13, 13, 1, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 8, 0, 2, 16, 0, 26, 0, 1, - 26, 14, 0, 2, 9, 9, 9, 1, 13, 13, 13, 13, 13, 1, 1, 1, 1, 0, 16, 0, 0, 8, 0, 0, 8, 0, 1, 0, 0, 26, 0, 1, - 26, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 0, 0, 0, 0, 0, 0, 8, 0, 22, 7, 20, 0, 0, 0, 26, 0, 1, - 26, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 7, 20, 0, 0, 0, 0, 2, 2, 2, 2, 1, - 0, 0, 0, 14, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 2, 0, 26, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, - 7, 0, 7, 7, 7, 7, 7, 0, 8, 8, 0, 0, 0, 0, 7, 7, 26, 1, 1, 0, 0, 0, 0, 0, 16, 0, 0, 0, 8, 0, 0, 8, - 4, 0, 0, 0, 0, 0, 4, 0, 7, 7, 0, 5, 0, 0, 0, 19, 26, 1, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 8, - 0, 0, 0, 17, 14, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 19, 26, 0, 14, 0, 0, 0, 2, 0, 0, 0, 0, 0, 8, 0, 11, 8, - 25, 0, 17, 9, 19, 0, 0, 0, 1, 0, 0, 0, 0, 5, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 8, 0, 0, 8, - 0, 0, 17, 9, 19, 0, 0, 2, 1, 10, 0, 0, 0, 0, 2, 1, 13, 13, 1, 2, 0, 0, 1, 13, 13, 1, 0, 0, 7, 7, 7, 7, - 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 3, 3, 1, 1, 13, 13, 1, 1, 3, 3, 1, 13, 13, 1, 3, 3, 3, 3, 3, 3] - -//---------------------------------------------------------- Level 12 - -map[11] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 4, 4, 4, 2, 0, 19, 0, 0, 0, 0, 0, 0, 0, 8, 25, 0, 8, 1, 4, 4, 4, 0,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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 26, 1, - 19, 20, 0, 19, 0, 0, 0, 28, 0, 0, 0, 19, 0, 0, 0, 0, 14, 0, 0, 28, 0, 15, 0, 0, 0, 0, 16, 0, 0, 0, 26, 1, - 19, 17, 0, 28, 0, 16, 0, 28, 0, 0, 0, 28, 0, 0, 0, 0, 9, 17, 0, 28, 0, 14, 0, 0, 0, 0, 0, 2, 0, 0, 26, 1, - 19, 9, 17, 28, 0, 0, 0, 19, 18, 14, 0, 28, 0, 0, 14, 17, 17, 17, 17, 19, 0, 0, 0, 0, 0, 5, 0, 1, 0, 0, 26, 1, - 19, 9, 9, 28, 0, 0, 2, 19, 18, 18, 0, 28, 0, 2, 9, 9, 9, 9, 9, 19, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 26, 1, - 7, 7, 7, 7, 7, 7, 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 1, 3, 3, 3, 1] - -//---------------------------------------------------------- Level 13 - -map[12] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 1, 13, 13, 13, 13, - 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 17, 17, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 13, 13, 13, 13, - 18, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 0, 0, 0, 0, 26, 1, 2, 0, 0, 0, 0, 0, 1, 13, 13, 13, 13, - 18, 18, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 19, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 18, 0, 0, 5, 0, 0, 1, - 0, 0, 0, 2, 19, 13, 13, 13, 1, 0, 0, 0, 0, 0, 2, 1, 13, 13, 1, 2, 0, 0, 0, 10, 10, 1, 2, 2, 2, 2, 2, 1, - 7, 7, 7, 7, 19, 13, 13, 13, 1, 1, 1, 1, 1, 1, 1, 1, 13, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] - -//---------------------------------------------------------- Level 14 - -map[13] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 19, 28, 19, 1, 1, 1, 1, 1, 19, 28, 28, 19, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 4, 0, 0, 0, 0, 4, 0, 0, 0, 0, 8, 7, 7, 7, 0, 11, 9, 0, 0, 19, 7, 7, 19, 1, 8, 4, 4, 4, 1, 0, 0, 0, - 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 9, 0, 0, 6, 21, 21, 0, 8, 8, 0, 0, 0, 32, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 7, 7, 7, 7, 7, 7, 7, 0, 0, 6, 10, 10, 0, 8, 8, 16, 0, 0, 33, 0, 30, 0, - 14, 0, 0, 0, 9, 14, 0, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 14, 19, 7, 7, 0, 8, 8, 0, 2, 0, 32, 14, 0, 0, - 18, 0, 0, 17, 9, 9, 0, 1, 1, 8, 18, 12, 0, 16, 0, 10, 0, 0, 9, 19, 0, 0, 0, 8, 8, 0, 1, 1, 1, 1, 1, 1, - 1, 0, 0, 17, 9, 9, 0, 0, 0, 18, 18, 0, 0, 0, 10, 19, 10, 17, 9, 19, 0, 31, 0, 7, 7, 0, 1, 4, 15, 0, 8, 0, - 23, 0, 0, 19, 1, 1, 0, 14, 0, 7, 7, 7, 7, 7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] - -//---------------------------------------------------------- Level 15 (Boss Fight) - -map[14] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 8, 0, 8, 0, 0, 8, 0, 8, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 8, 0, 8, 0, 8, 0, 8, 0, - 0, 8, 0, 8, 0, 0, 8, 0, 8, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 8, 0, 8, 0, 8, 0, 8, 0, - 0, 8, 16, 8, 0, 5, 8, 0, 8, 0, 26, 0, 13, 0, 14, 26, 26, 14, 0, 13, 0, 26, 26, 0, 8, 5, 8, 16, 8, 0, 8, 0, - 0, 8, 0, 8, 0, 0, 8, 0, 8, 0, 0, 0, 1, 1, 1, 26, 26, 1, 1, 1, 0, 26, 26, 0, 8, 0, 8, 0, 8, 0, 8, 0, - 0, 7, 7, 7, 0, 0, 8, 14, 8, 0, 0, 0, 0, 0, 8, 26, 26, 8, 0, 8, 0, 0, 0, 0, 8, 0, 8, 0, 8, 0, 8, 26, - 0, 0, 0, 0, 26, 26, 8, 18, 8, 0, 26, 26, 26, 0, 8, 25, 0, 8, 0, 8, 0, 0, 0, 0, 8, 14, 8, 0, 7, 7, 7, 26, - 0, 0, 0, 0, 26, 26, 7, 7, 7, 16, 0, 0, 0, 0, 8, 0, 0, 8, 0, 8, 0, 0, 0, 0, 7, 7, 7, 0, 0, 0, 0, 26, - 0, 0, 0, 0, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 0, 8, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 26, - 0, 0, 26, 26, 26, 26, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 14, 0, 16, 0, 0, 0, 0, 0, 0, 0, 14, 26, 0, 0, 0, 0, 0, 0, 0, 0, 26, 14, 0, 0, 0, 0, 5, 0, 0, 0, 0, 14, - 18, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 26, 0, 5, 0, 0, 0, 0, 5, 0, 26, 7, 7, 0, 16, 0, 0, 0, 0, 0, 17, 9, - 1, 0, 0, 0, 0, 5, 0, 0, 0, 13, 13, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 13, 13, 0, 0, 0, 0, 0, 14, 17, 9, 9, - 1, 0, 18, 14, 0, 0, 0, 0, 0, 13, 13, 0, 0, 0, 14, 0, 0, 14, 0, 0, 0, 13, 13, 0, 0, 0, 0, 17, 9, 17, 9, 9, - 1, 18, 1, 18, 0, 0, 0, 0, 0, 13, 13, 0, 0, 0, 7, 7, 7, 7, 0, 0, 0, 13, 13, 0, 0, 0, 17, 9, 9, 9, 9, 9, - 1, 1, 1, 1, 1, 1, 6, 6, 6, 1, 1, 6, 6, 6, 19, 27, 27, 19, 6, 6, 6, 1, 1, 6, 6, 6, 1, 7, 7, 7, 7, 7, - 1, 1, 1, 1, 1, 1, 3, 3, 3, 1, 1, 3, 3, 3, 1, 1, 1, 1, 3, 3, 3, 1, 1, 3, 3, 3, 1, 19, 27, 27, 27, 19] - -//---------------------------------------------------------- Level 16 (Trophy Room) - -map[15] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 28, 27, 28, 0, 15, 0, 28, 27, 28, 0, 15, 0, 28, 27, 28, 0, 0, 0, 28, 27, 28, 0, 15, 0, 19, 27, 19, 0, 15, 0, - 0, 0, 28, 27, 28, 0, 15, 0, 28, 27, 28, 0, 15, 0, 28, 27, 9, 17, 0, 0, 28, 27, 28, 0, 15, 0, 19, 27, 19, 0, 15, 0, - 0, 0, 28, 27, 28, 0, 15, 0, 28, 27, 28, 0, 14, 0, 28, 27, 9, 9, 17, 26, 28, 27, 28, 0, 15, 0, 19, 27, 19, 0, 15, 0, - 0, 0, 28, 27, 28, 0, 15, 0, 28, 27, 17, 0, 0, 0, 9, 27, 7, 7, 7, 26, 7, 27, 28, 0, 14, 0, 7, 7, 7, 0, 14, 0, - 0, 0, 28, 27, 28, 0, 15, 0, 28, 27, 9, 17, 26, 9, 9, 27, 28, 0, 0, 26, 19, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 28, 27, 28, 0, 14, 0, 28, 27, 7, 7, 26, 7, 7, 27, 28, 0, 0, 26, 28, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 28, 27, 28, 0, 0, 0, 28, 27, 28, 0, 26, 19, 28, 27, 28, 26, 0, 26, 28, 27, 28, 0, 0, 0, 0, 35, 0, 0, 0, 0, - 0, 0, 28, 27, 9, 0, 0, 0, 28, 27, 28, 0, 26, 0, 28, 27, 7, 26, 7, 7, 7, 27, 28, 0, 0, 0, 14, 32, 14, 0, 0, 0, - 0, 0, 28, 27, 9, 17, 26, 9, 28, 27, 28, 0, 26, 0, 28, 27, 19, 26, 0, 0, 28, 27, 28, 0, 0, 0, 7, 7, 7, 0, 0, 0, - 0, 0, 28, 27, 7, 7, 26, 7, 7, 27, 28, 0, 0, 0, 28, 27, 28, 26, 0, 0, 28, 27, 28, 0, 0, 17, 19, 27, 19, 17, 0, 0, - 0, 0, 28, 27, 28, 19, 26, 0, 28, 27, 28, 0, 16, 0, 28, 27, 28, 0, 0, 17, 17, 27, 28, 18, 17, 9, 9, 9, 9, 9, 17, 17, - 0, 0, 28, 27, 28, 0, 26, 0, 28, 27, 28, 0, 0, 0, 28, 27, 28, 0, 17, 17, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 0, 0, 28, 27, 28, 0, 26, 0, 28, 27, 28, 0, 0, 18, 28, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 0, 0, 28, 27, 28, 0, 0, 0, 28, 27, 28, 17, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 25, 0, 28, 27, 28, 0, 0, 0, 28, 27, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 0, 0, 28, 27, 28, 0, 0, 0, 28, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7] \ No newline at end of file diff --git a/res/js/script.js b/res/js/script.js deleted file mode 100644 index 1dabd5f..0000000 --- a/res/js/script.js +++ /dev/null @@ -1,2411 +0,0 @@ -const canvas = document.getElementById("canvas"); -const canvas_container = document.getElementById("canvas_container"); -const container = document.getElementById("container"); -const c = canvas.getContext("2d"); -const text = document.getElementById("text"); -const characters = document.getElementById("characters"); -const man = document.getElementById("man"); -const woman = document.getElementById("woman"); -const music = document.getElementById("music"); -const timer = document.getElementById("timer"); -const sfx = document.getElementById("sfx"); -const sfx_land = document.getElementById("sfx_land"); -const sfx_miss = document.getElementById("sfx_miss"); -const sfx_climb = document.getElementById("sfx_climb"); -const sfx_dead = document.getElementById("sfx_dead"); -const sfx_player = document.getElementById("sfx_player"); -const sfx_walk = document.getElementById("sfx_walk"); -const sfx_jump = document.getElementById("sfx_jump"); -const sfx_punch = document.getElementById("sfx_punch"); -const sfx_extra_jump = document.getElementById("sfx_extra_jump"); -const sfx_boss_talk = document.getElementById("sfx_boss_talk"); -const sfx_boss_laugh = document.getElementById("sfx_boss_laugh"); -const game = document.getElementById("game"); -const background = document.getElementById("background"); -const black = document.getElementById("black"); -const fullBlack = document.getElementById("fullBlack"); -const paper = document.getElementById("paper"); -const recommend = document.getElementById("recommend"); -const credits_list = document.getElementById("credits_list"); -const transition1 = document.getElementById("transition1"); -const transition2 = document.getElementById("transition2"); -const scene = document.getElementById("scene"); -const rising = document.getElementById("rising"); -const esc = document.getElementById("esc"); -const playButton = document.getElementById("playButton"); -const tutorialButton = document.getElementById("tutorialButton"); -const creditsButton = document.getElementById("creditsButton"); -const hp = document.getElementById("hp"); -const myHp = document.getElementById("myHp"); -const startMenu = document.getElementById("startMenu"); -const button_back = document.getElementById("button_back"); -const button_resume = document.getElementById("button_resume"); -const button_retry = document.getElementById("button_retry"); -const button_menu = document.getElementById("button_menu"); -const escape_button = document.getElementById("escape_button"); -const hps = document.getElementById("hps"); -const heart1 = document.getElementById("heart1"); -const heart2 = document.getElementById("heart2"); -const heart3 = document.getElementById("heart3"); -const invertArrow1 = document.getElementById("invert_arrow1"); -const invertArrow2 = document.getElementById("invert_arrow2"); -const notInvertArrow1 = document.getElementById("not_invert_arrow1"); -const notInvertArrow2 = document.getElementById("not_invert_arrow2"); -const music_value = document.getElementById("music_value"); -const sfx_value = document.getElementById("sfx_value"); -const note_button = document.getElementById("note_button"); -const music_editor = document.getElementById("music_editor"); -const music_editor_back = document.getElementById("music_editor_back"); - -let helpNum = 0; //Help Number for level detection (doors) - -//Setting default volume -let musicVolume = 0.5; -let sfxVolume = 0.5; -let currentMusicValue = 50; -let currentSfxValue = 50; - -//Adjust Music Volume -const setMusicVolume = () => { - music.volume = musicVolume; -} - -//Adjust SFX volume -const setSfxVolume = () => { - sfx.volume = sfxVolume; - sfx_dead.volume = sfxVolume; - sfx_player.volume = sfxVolume; - sfx_walk.volume = sfxVolume; - sfx_climb.volume = sfxVolume; - sfx_miss.volume = sfxVolume; - sfx_jump.volume = sfxVolume; - sfx_punch.volume = sfxVolume; - sfx_extra_jump.volume = sfxVolume; - sfx_boss_talk.volume = sfxVolume; - sfx_boss_laugh.volume = sfxVolume; - sfx_land.volume = sfxVolume; - scene.volume = sfxVolume; -} - -setMusicVolume(); -setSfxVolume(); - -//Turn Music UP by 5% -notInvertArrow1.onclick = () => { - if(currentMusicValue >= 0 && currentMusicValue < 100){ - musicVolume += 0.05 - currentMusicValue += 5; - music_value.innerHTML = currentMusicValue + "%"; - setMusicVolume(musicVolume); - } -} -//Turn SFX UP by 5% -notInvertArrow2.onclick = () => { - if(currentSfxValue >= 0 && currentSfxValue < 100){ - sfxVolume += 0.05 - currentSfxValue += 5; - sfx_value.innerHTML = currentSfxValue + "%"; - setSfxVolume(sfxVolume); - } -} -//Turn Music DOWN by 5% -invertArrow1.onclick = () => { - if(currentMusicValue > 0 && currentMusicValue <= 100){ - musicVolume -= 0.05 - currentMusicValue -= 5; - music_value.innerHTML = currentMusicValue + "%"; - setMusicVolume(musicVolume); - } -} -//Turn SFX DOWN by 5% -invertArrow2.onclick = () => { - if(currentSfxValue > 0 && currentSfxValue <= 100){ - sfxVolume -= 0.05 - currentSfxValue -= 5; - sfx_value.innerHTML = currentSfxValue + "%"; - setSfxVolume(sfxVolume); - } -} - -let musicEditorOpened = false; - -//Note Button -> Will open Music Editor -note_button.onclick = () => { - if(inGame && !escShowed){ - if(musicEditorOpened){ - canvas.style.filter = "blur(0)" - background.style.filter = "blur(0)" - rising.style.filter = "blur(0)" - music_editor.style.display = "none"; - musicEditorOpened = false; - black.style.opacity = "0"; - }else{ - canvas.style.filter = "blur(1px)" - background.style.filter = "blur(1px)" - rising.style.filter = "blur(1px)" - music_editor.style.display = "flex"; - musicEditorOpened = true; - black.style.opacity = "0.6"; - } - } -} - -//Music Editor -> You can here adjust volume of Music or SFX by yourself -music_editor_back.onclick = () => { - if(musicEditorOpened){ - music_editor.style.display = "none"; - musicEditorOpened = false; - black.style.opacity = "0"; - canvas.style.filter = "blur(0)" - background.style.filter = "blur(0)" - rising.style.filter = "blur(0)" - } -} - -let transitionY = 576 -let transitionX = 1024 - -const resizeTimer = () => { - let widthCalculator = window.innerWidth; - let newSize = widthCalculator * 0.02; // Pravidlo pro zmenšení/zvětšení textu můžete upravit podle potřeby - timer.style.fontSize = newSize + "px"; -} - -resizeTimer(); - -let seconds = 0 - -let timerInterval; -let colorInterval; -let secondsInterval; - -const timerFunction = () => { - timer.style.top = "3%"; - seconds = timeNow; - timer.innerHTML = `Time: ${seconds}s` - timerInterval = setInterval(() => { - seconds-- - timer.innerHTML = `Time: ${seconds}s` - if(seconds == 9){ - notEnoughTime(); - }else if(seconds == 0){ - clearInterval(timerInterval) - } - }, 1000); -} - -let colorIntervalNumber = 1; - -const notEnoughTime = () => { - colorIntervalNumber = 1; - colorInterval = setInterval(() => { - colorIntervalNumber++; - if(colorIntervalNumber % 2 == 0){ - timer.style.backgroundColor = "rgb(143, 19, 19)" - timer.style.padding = "2px 10px"; - }else{ - timer.style.backgroundColor = "rgb(45, 3, 3)" - timer.style.padding = "2px 5px"; - } - }, 300); -} - -const restartTimer = () => { - seconds = 0 - timer.style.backgroundColor = "rgb(45, 3, 3)" - clearInterval(colorInterval) - clearInterval(timerInterval) -} - -window.onresize = function() { - resizeTimer() -}; - -//Adjusts the position of the transition on you -const setTransitionCords = () => { - transitionY = (y / 576) * 100 + 3; - transitionX = (x / 1024) * 100 + 2; - transition1.style.top = transitionY + "%"; - transition1.style.left = transitionX + "%"; - transition2.style.top = transitionY + "%"; - transition2.style.left = transitionX + "%"; -} - -let doorsTime = 0; -let doorTimeout = false; -let setTimeoutDoor; - -//Play Button -playButton.onclick = () => { - playButton.style.animationName = "blink" - playButton.style.animationPlayState = "running"; - black.style.opacity = "1"; - tutorialButton.style.opacity = "0%"; - tutorialButton.style.pointerEvents = "none"; - characters.style.display = "block"; - characters.style.animationName = "bottomToMid" - characters.style.animationPlayState = "running"; - playButton.style.pointerEvents = "none"; - tutorialButton.style.pointerEvents = "none"; - creditsButton.style.display = "none"; - text.style.opacity = "0"; - setTimeout(() => { - tutorialBtnSliding = false; - tutorialBtnShowed = true; - }, 1000); -} - -let tutorialBtnShowed = false; -let tutorialBtnSliding = false; - -//Tutorial Button -> Will show you Tutorial Paper -tutorialButton.onclick = () => { - tutorialBtnSliding = true; - paper.style.display = "block"; - paper.style.animationName = "rightToMid" - paper.style.animationPlayState = "running"; - playButton.style.pointerEvents = "none"; - tutorialButton.style.pointerEvents = "none"; - creditsButton.style.pointerEvents = "none"; - setTimeout(() => { - tutorialBtnSliding = false; - tutorialBtnShowed = true; - }, 1000); -} - -//Tutorial Paper will dissapear -paper.onclick = () => { - if(tutorialBtnShowed){ - tutorialBtnSliding = true; - paper.style.display = "block"; - paper.style.animationName = "midToLeft" - paper.style.animationPlayState = "running"; - setTimeout(() => { - tutorialBtnSliding = false; - tutorialBtnShowed = false; - playButton.style.pointerEvents = "auto"; - tutorialButton.style.pointerEvents = "auto"; - creditsButton.style.pointerEvents = "auto"; - }, 1000); - } -} - -//Credit Button -creditsButton.onclick = () => { - credits_list.style.display = "block"; - recommend.style.display = "none"; -} -//Credits List -credits_list.onclick = () => { - credits_list.style.display = "none"; - recommend.style.display = "block"; -} - -//This function will send you to the game -const menuToLobby = () => { - music.src = "./res/music/lobby_music.mp3"; - music.play(); - game.style.display = "block"; - startMenu.style.display = "none"; - inGame = true; - playButton.style.animationName = "none" - playButton.style.animationPlayState = "none"; - setTimeout(() => { - black.style.opacity = "0"; - }, 50) -} - -//Player COORDINATES -let x; -let y; - -//Ghost COORDINATES -let xGhost = 70000; -let yGhost = 310 - -//This will spawn you -let spawnCords = () => { - x = 50; - y = 500; -} -spawnCords(); - -//This will spawn the Ghost -let spawnGhostCords = () => { - xGhost = 10000; - yGhost = 10000; -} - -let player; -let playingAsRioter; -let playingAsRuby; - -man.onclick = () => { //Choosing Character - Rioter - characters.style.display = "none"; - player = "./res/img/rioter.png"; - heart1.src = "./res/img/heart_rioter.png"; - heart2.src = "./res/img/heart_rioter.png"; - heart3.src = "./res/img/heart_rioter.png"; - playingAsRioter = true; - playingAsRuby = false; - movingCharactersAndFullBlack(); -} -woman.onclick = () => { //Choosing Character - Ruby - characters.style.display = "none"; - player = "./res/img/ruby.png"; - heart1.src = "./res/img/heart_ruby.png"; - heart2.src = "./res/img/heart_ruby.png"; - heart3.src = "./res/img/heart_ruby.png"; - playingAsRioter = false; - playingAsRuby = true; - movingCharactersAndFullBlack(); -} - -//If you choose a character -> Transition will be activated and you will be send to the game by function menuToLobby() -const movingCharactersAndFullBlack = () => { - characters.style.display = "block"; - characters.style.animationName = "midToBottom" - characters.style.animationPlayState = "running"; - fullBlack.style.display = "block"; - playButton.style.display = "none"; - note_button.style.zIndex = "3"; - escape_button.style.zIndex = "3"; - setTimeout(() => { - fullBlack.style.opacity = "1"; - }, 10); - setTimeout(() => { - characters.style.display = "none"; - menuToLobby(); - drawing(); - fullBlack.style.opacity = "0"; - setTimeout(() => { - note_button.style.zIndex = "11"; - escape_button.style.zIndex = "11"; - }, 800); - }, 1000); -} - -let height = 40; -let width = 30; - -let gravityId; -let jumpingId; -let animationIdRight; -let animationIdLeft; - -let velocityJump = 0 - -let isJumping = false; -let gravityOn = false; -let isMovingRight = false; -let isMovingLeft = false; - -let turnedRight = true; -let turnedLeft = false; - -let fps = 55; -let interval = 1000/fps; - -let portalCordsX1 = 0; -let portalCordsY1 = 0; -let portalCordsX2 = 0; -let portalCordsY2 = 0; - -//----------------------------------------DOORS COLLISION in Menu - -let lobbyDoorCol = false; //Help for sfx door -let finalDoorUnlocked = true; //Can let you go to the Final Door while is boss dead -let doorCol = false; - -//This Function will show you, if you can enter to the level -const doorsCollision = () => { - lobbyDoorCol = false; - doorCol = false; - for (let i = 0; i < platformLevel1.length; i++) { - if (platformLevel1[i] >= 50 && platformLevel1[i] <= 64 || platformLevel1[i] == 34) { - let platformX = (i % 32) * 32; - let platformY = Math.floor(i / 32) * 32; - if ( - y + height >= platformY && - y + height <= platformY + 64 && - x + width >= platformX + 24 && - x <= platformX + 40 - ) { - if(platformLevel1[i] == 34 && frameDoorFinal == 0){ - helpNum = 15; - }else if(platformLevel1[i] != 34 && inGame){ - helpNum = platformLevel1[i] - 50; - lobbyDoorCol = true; - } - doorCol = true; - c.font = "20px VT323, monospace"; - if(finished[helpNum] == 2 || !finalDoorUnlocked){ - c.fillStyle = "red"; - c.fillText("LOCKED", platformX + 7, platformY); - }else{ - c.fillStyle = "lime"; - c.fillText("Enter [e]", platformX - 3, platformY); - } - break; - } - } - } -} - -//---------------------------------------- BOSS Collision -let bossX = 1000000; -let bossY = 0; - -let canAttack = false; - -//Boss Collision -const bossCollision = () => { - if ( - y + height >= bossY && - y <= bossY + 80 && - x + width >= bossX && - x <= bossX + 80 - ) { - canAttack = true; - if(currentFrameBoss == 6){ - dead(); - } - } else { - canAttack = false; - } -}; - -//---------------------------------------- BOSS Moving X and Y - -let bossVelocity = 1; - -let nowBossMoveY; -let thenBossMoveY = Date.now(); -let deltaBossMoveY; -let bossMoveYId; - -//Boss Moving Y -const bossMoveY = () => { - bossMoveYId = requestAnimationFrame(bossMoveY) - nowBossMoveY = Date.now(); - deltaBossMoveY = nowBossMoveY - thenBossMoveY ; - if (deltaBossMoveY > interval) { - thenBossMoveY = nowBossMoveY - (deltaBossMoveY % interval); - if(y - 30 >= bossY){ - bossY += bossVelocity; - }else{ - bossY -= bossVelocity; - } - } -} - -let nowBossMoveX; -let thenBossMoveX = Date.now(); -let deltaBossMoveX; -let bossMoveXId; - -//Boss Moving X -const bossMoveX = () => { - bossMoveXId = requestAnimationFrame(bossMoveX) - nowBossMoveX = Date.now(); - deltaBossMoveX = nowBossMoveX - thenBossMoveX ; - if (deltaBossMoveX > interval) { - thenBossMoveX = nowBossMoveX - (deltaBossMoveX % interval); - if(x - 25 > bossX){ - bossX += bossVelocity; - }else{ - bossX -= bossVelocity; - } - } -} - -//---------------------------------------Enter to the Level Function - -let entered = false; - -window.addEventListener("keydown", (event) => { - if ((event.key == "e" || event.key == "E") && doorCol && !entered && finished[helpNum] != 2 && finalDoorUnlocked && inGame && canEnter) { - entered = true; - enterFunction(); - } -}) - -//Boss Phases -let breakBottom, bossLava, endBossLava, bossDarkness, endBossDarkness, bossLava2, bossLava3; -let nonStopShake; - -let canEnter = true; - -let timeNow = 0; - -//Enter Function -const enterFunction = () => { - if(lobbyDoorCol){ - sfx.src = "./res/sfx/door.mp3"; - sfx.play(); - } - frameDoor = 0; - music.pause(); - inGame = false; - ghostVelocity = 2; - setTransitionCords(); - fadeInTransition(); - setTimeout(() => { - transition2.currentTime = 0; - transition2.style.opacity = "0"; - transition2.pause(); - }, 100); - setTimeout(() => { - inGame = true; - platformLevel1 = [...map[helpNum]]; - originalPlatform1 = [...platformLevel1]; - if(helpNum == 0){ //Level 1 - spawnCords = () =>{ - x = 40; - y = 515 - } - spawnCords(); - music.src = "./res/music/song0.mp3"; - doorsTime = 30000; - music.play(); - spawnGhostCords = () =>{ - xGhost = 900; - yGhost = 500; - } - spawnGhostCords(); - }else if(helpNum == 1){ //Level 2 - spawnCords = () =>{ - x = 40; - y = 515; - } - spawnCords(); - music.src = "./res/music/song1.mp3"; - doorsTime = 28000; - music.play(); - spawnGhostCords = () =>{ - xGhost = 400; - yGhost = 240; - } - spawnGhostCords(); - }else if(helpNum == 2){ //Level 3 - spawnCords = () =>{ - x = 20; - y = 390; - } - spawnCords(); - darkness = true; - music.src = "./res/music/song2.mp3"; - doorsTime = 37000; - music.play(); - }else if(helpNum == 3){ //Level 4 - spawnCords = () =>{ - x = 40; - y = 515; - } - spawnCords(); - music.src = "./res/music/song3.mp3"; - doorsTime = 31000; - music.play(); - spawnGhostCords = () => { - xGhost = 670; - yGhost = 310; - } - spawnGhostCords(); - }else if(helpNum == 4){ //Level 5 - rising.style.display = "block"; - risingLavaActivated = true; - spawnCords = () =>{ - x = 512; - y = 485; - } - spawnCords(); - music.src = "./res/music/song4.mp3"; - doorsTime = 23000; - music.play(); - }else if(helpNum == 5){ //Level 6 - spawnCords = () =>{ - x = 20; - y = 485; - } - spawnCords(); - music.src = "./res/music/song5.mp3"; - doorsTime = 30000; - music.play(); - spawnGhostCords = () => { - xGhost = 400; - yGhost = 245; - } - spawnGhostCords(); - }else if(helpNum == 6){ //Level 7 - spawnCords = () =>{ - x = 500; - y = 485; - } - spawnCords(); - music.src = "./res/music/song6.mp3"; - doorsTime = 39000; - music.play(); - }else if(helpNum == 7){ //Level 8 - spawnCords = () =>{ - x = 20; - y = 515; - } - spawnCords(); - darkness = true; - music.src = "./res/music/song7.mp3"; - doorsTime = 48000; - music.play(); - }else if(helpNum == 8){ //Level 9 - spawnCords = () =>{ - x = 20; - y = 420; - } - spawnCords(); - music.src = "./res/music/song8.mp3"; - doorsTime = 40000; - music.play(); - }else if(helpNum == 9){ //Level 10 - rising.style.display = "block"; - risingLavaActivated = true; - spawnCords = () =>{ - x = 20; - y = 485; - } - spawnCords(); - music.src = "./res/music/song9.mp3"; - doorsTime = 28000; - music.play(); - }else if(helpNum == 10){ //Level 11 - spawnCords = () =>{ - x = 20; - y = 515; - } - spawnCords(); - music.src = "./res/music/song10.mp3"; - doorsTime = 30000; - music.play(); - spawnGhostCords = () => { - xGhost = 600; - yGhost = 150; - } - spawnGhostCords(); - }else if(helpNum == 11){ //Level 12 - spawnCords = () =>{ - x = 500; - y = 70; - } - spawnCords(); - music.src = "./res/music/song11.mp3"; - doorsTime = 36000; - music.play(); - }else if(helpNum == 12){ //Level 13 - spawnCords = () =>{ - x = 20; - y = 515; - } - spawnCords(); - darkness = true; - music.src = "./res/music/song12.mp3"; - doorsTime = 36000; - music.play(); - spawnGhostCords = () => { - xGhost = 400; - yGhost = 210; - } - spawnGhostCords(); - }else if(helpNum == 13){ //Level 14 - spawnCords = () =>{ - x = 40; - y = 515; - } - spawnCords(); - music.src = "./res/music/song13.mp3"; - doorsTime = 54000; - music.play(); - spawnGhostCords = () => { - xGhost = 700; - yGhost = 310; - } - spawnGhostCords(); - }else if(helpNum == 14){ //Level 15 (Boss Fight) - bossLevel(); - }else if(helpNum == 15){ // Level 16 (Trophy Room) - spawnCords = () =>{ - x = 40; - y = 515; - } - finished[14] = 1; //Boss Beated -> Level 15 Doors are now green - spawnCords(); - music.src = "./res/music/ending.mp3"; - music.play(); - } - setTransitionCords(); - fadeOutTransition(); - saveGhostCordsX = xGhost; - saveGhostCordsY = yGhost; - if(helpNum != 15){ - timeNow = doorsTime/1000; - timerFunction(); - } - if(helpNum != 15){ - setTimeoutDoor = setTimeout(() => { - doorTimeout = true; - }, doorsTime); - } - entered = false; - gravity(); - }, 1300); -} - -//----------------------------------------BOSS LEVEL -const bossLevel = () => { - finalDoorUnlocked = false; - generatorAttackFunction(); - gravity(); - spawnCords = () => { - x = 500; - y = 220; - } - spawnCords(); - myHp.style.display = "flex"; - hps.style.display = "block"; - heart1.style.display = "block"; - heart2.style.display = "block"; - heart3.style.display = "block"; - hearts = 3; - bossX = 474; - bossY = 450; - playingBossFight = true; - sfx_boss_talk.src = "./res/sfx/killyou.mp3"; - sfx_boss_talk.play(); - music.currentTime = 0; - music.src = "./res/music/finalboss.mp3"; - doorsTime = 76000; - music.play(); - cancelAnimationFrame(bossMoveXId); - cancelAnimationFrame(bossMoveYId); - bossMoveY(); - bossMoveX(); - breakBottom = setTimeout(() => { - for (let index = 0; index < platformLevel1.length; index++) { - if(platformLevel1[index] == 6){ - platformLevel1[index] = 0; - } - } - shake(); - }, 13000); - bossLava = setTimeout(() => { - shake() - risingLavaActivated = true; - rising.style.display = "block"; - }, 25000); - endBossLava = setTimeout(() => { - shake(); - black.style.transition = "opacity 0s" - black.style.opacity = 1; - risingLavaActivated = false; - lavaIncreaseValue = 3.6; - lavaY = 576; - risingPercent = risingPercentOriginal; - rising.style.bottom = risingPercent + "%" - rising.style.display = "none"; - setTimeout(() => { - black.style.transition = "opacity 0.3s" - black.style.opacity = 0; - }, 20); - }, 36200); - bossDarkness = setTimeout(() => { - shake(); - black.style.transition = "opacity 0s" - black.style.opacity = 1; - setTimeout(() => { - black.style.transition = "opacity 0.3s" - black.style.opacity = 0; - }, 20); - darkness = true; - }, 43800); - endBossDarkness = setTimeout(() => { - shake(); - black.style.transition = "opacity 0s" - black.style.opacity = 1; - setTimeout(() => { - black.style.transition = "opacity 0.3s" - black.style.opacity = 0; - }, 20); - darkness = false; - }, 52000); - bossLava2 = setTimeout(() => { - shake() - risingLavaActivated = true; - rising.style.display = "block"; - }, 61500); - bossLava3 = setTimeout(() => { - shake() - risingLavaActivated = true; - rising.style.display = "block"; - risingIncreaseValue = 1.32; - lavaIncreaseValue = 7.92; - nonStopShake = setInterval(() => { - shake() - }, 300); - }, 67000); -} - -//----------------------------------------Boss Attack Generator - -let bossAttacking = false; -let attackNum = 0; - -let bossAttackGenerator; - -const generatorAttackFunction = () => { - bossAttackGenerator = setInterval(() => { - attackNum = Math.floor(Math.random() * 2) - if(attackNum == 1 && !bossAttacking){ - bossVelocity = 1.5; - currentFrameBoss = 0; - bossAttacking = true; - } - }, 500); -} - -//----------------------------------------SHAKE Function - -const shake = () => { - setTimeout(() => { - canvas.style.top = "50.5%";canvas.style.left = "50.5%"; - background.style.top = "50.5%";background.style.left = "50.5%"; - }, 50); - setTimeout(() => { - canvas.style.top = "49.5%";canvas.style.left = "50%"; - background.style.top = "49.5%";background.style.left = "50%"; - }, 100); - setTimeout(() => { - canvas.style.top = "50%";canvas.style.left = "50.5%"; - background.style.top = "50%";background.style.left = "50.5%"; - }, 150); - setTimeout(() => { - canvas.style.top = "50.5%";canvas.style.left = "49.5%"; - background.style.top = "50.5%";background.style.left = "49.5%"; - }, 200); - setTimeout(() => { - canvas.style.top = "50%";canvas.style.left = "50%"; - background.style.top = "50%";background.style.left = "50%"; - }, 250); -} - -//----------------------------------------Death Effects - -let playingBossFight = false; -let hearts = 3; - -let resistence = false; -let deadSoundCanBeUse = true; - -const grayScaleEffect = () => { - canvas.style.filter = "grayscale(1)"; - rising.style.filter = "grayscale(1)"; - setTimeout(() => { - canvas.style.transition = "filter 0.5s"; - canvas.style.filter = "grayscale(0)"; - rising.style.transition = "filter 0.5s"; - rising.style.filter = "grayscale(0)"; - setTimeout(() => { - canvas.style.transition = "filter 0s"; - rising.style.transition = "filter 0s"; - }, 250); - },500); -} - -//---------------------------------------- Death Function (Player) - -const dead = () => { - if(!goingBackToTheLobby){ - if(!playingBossFight){ //You are not playing BOSS FIGHT - if(yGhost < 2000 && xGhost < 2000){ - ghostVelocity = 2; - spawnGhostCords(); - } - if(ghostKilled){ - spawnGhostCords = () => { - xGhost = saveGhostCordsX; - yGhost = saveGhostCordsY; - } - ghostKilled = false; - spawnGhostCords(); - } - frameSpike = 0; - frameLava = 0; - velocity = 0; - velocityRight = 0; - velocityLeft = 0; - velocityJump = 0; - music.currentTime = 0; - clearTimeout(setTimeoutDoor) - setTimeoutDoor = setTimeout(() => { - doorTimeout = true; - }, doorsTime); - spawnCords(); - unCrouch(); - platformLevel1 = [...originalPlatform1]; - drawPlatform(); - dark(); - if(risingLavaActivated){ - risingIncreaseValue = 0.6; - lavaIncreaseValue = 3.6; - lavaY = 576; - risingPercent = risingPercentOriginal; - rising.style.bottom = risingPercent + "%" - } - if(frameDoor == 3){ - shake(); - doorTimeout = false; - frameDoor = 0; - } - grayScaleEffect(); - restartTimer(); - timerFunction(); - }else{ - if(!resistence || frameDoor == 3 || usedRetry){ - if(hearts == 3){ - heart3.style.display = "none"; - }else if(hearts == 2){ - heart2.style.display = "none"; - }else if(hearts == 1){ - heart1.style.display = "none"; - } - resistence = true; - hearts--; - velocity = 0; - velocityRight = 0; - velocityLeft = 0; - velocityJump = 0; - if(hearts == 0 || frameDoor == 3 || usedRetry || risingPercent >= -95){ - clearInterval(bossAttackGenerator); - grayScaleEffect(); - sfx_boss_laugh.pause(); - if(usedRetry){ - usedRetry = false; - } - cancelAnimationFrame(bossMoveXId); - cancelAnimationFrame(bossMoveYId); - clearTimeout(setTimeoutDoor) - setTimeoutDoor = setTimeout(() => { - doorTimeout = true; - }, doorsTime); - currentFrameBoss = 0; - bossAttacking = false; - currentHp = 100; - hp.style.width = currentHp + "%"; - setTimeout(() => { // Fixing bug - currentHp = 100; - hp.style.width = currentHp + "%"; - }, 100); - platformLevel1 = [...map[14]] - risingLavaActivated = false; - risingIncreaseValue = 0.6; - lavaIncreaseValue = 3.6; - lavaY = 576; - risingPercent = risingPercentOriginal; - rising.style.bottom = risingPercent + "%" - rising.style.display = "none"; - darkness = false; - heart1.style.display = "block"; - heart2.style.display = "block"; - heart3.style.display = "block"; - hearts = 3; - clearTimeout(breakBottom); - clearTimeout(bossLava); - clearTimeout(bossLava2); - clearTimeout(bossLava3); - clearTimeout(endBossLava); - clearTimeout(bossDarkness); - clearTimeout(endBossDarkness); - clearInterval(nonStopShake); - restartTimer(); - timerFunction(); - bossLevel(); - }else{ - sfx_boss_laugh.src = "./res/sfx/laugh.mp3"; - sfx_boss_laugh.play(); - } - setTimeout(() => { - resistence = false - }, 2000); - spawnCords(); - } - if(frameDoor == 3){ - doorTimeout = false; - frameDoor = 0; - } - } - if(deadSoundCanBeUse){ - sfx_dead.src = "./res/sfx/died.mp3"; - sfx_dead.play(); - deadSoundCanBeUse = false; - setTimeout(() => { - deadSoundCanBeUse = true; - }, 300); - } - - gravity(); - } -} - -//Fade **IN** Transition Function -//transition1 = Fade In -const fadeInTransition = () => { - setTimeout(() => { - transition2.currentTime = 0; - }, 30); - transition2.style.opacity = "0"; - transition2.pause(); - transition1.currentTime = 0; - setTimeout(() => { - transition1.style.opacity = "1"; - transition1.play(); - }, 30); - setTimeout(() => { - }, 100); -} - -//Fade **OUT** Transition Function -//transition2 = Fade Out -const fadeOutTransition = () => { - transition2.currentTime = 0; - setTimeout(() => { - transition2.style.opacity = "1"; - transition2.play(); - }, 30); - setTimeout(() => { - transition1.currentTime = 0; - setTimeout(() => { - transition1.style.opacity = "0"; - transition1.pause(); - }, 30); - }, 100); -} - -//---------------------------------------- Back to the Lobby (from level) - -let backToLobbyEntered = false; -let goingBackToTheLobby = false; - -const backToLobby = () => { - goingBackToTheLobby = true; - clearInterval(bossAttackGenerator); - clearTimeout(breakBottom); - clearTimeout(bossLava); - clearTimeout(bossLava2); - clearTimeout(bossLava3); - clearTimeout(endBossLava); - clearTimeout(bossDarkness); - clearTimeout(endBossDarkness); - clearInterval(nonStopShake); - clearTimeout(setTimeoutDoor); - cancelAnimationFrame(bossMoveXId); - cancelAnimationFrame(bossMoveYId) - restartTimer(); - timer.style.top = "-5%" - transition2.addEventListener("ended", () => { - canEnter = true; - }); - if(usedRetry){ - usedRetry = false; - } - canvas.style.filter = "blur(0)"; - background.style.filter = "blur(0)"; - rising.style.filter = "blur(0)"; - black.style.opacity = "0"; - risingLavaActivated = false; - finalDoorUnlocked = true; - canAttack = false; - myHp.style.display = "none"; - hps.style.display = "none"; - hearts = 3; - heart1.style.display = "block"; - heart2.style.display = "block"; - heart3.style.display = "block"; - currentHp = 100; - hp.style.width = currentHp + "%"; - music.pause(); - music.currentTime = 0; - inGame = false; - setTransitionCords(); - fadeInTransition(); - esc.style.display = "none"; - escShowed = false; - setTimeout(() => { - music.src = "./res/music/lobby_music.mp3"; - music.play(); - if(playingBossFight){ - lives = 3; - playingBossFight = false; - bossX = 1000000; - bossY = 0; - } - frameDoorFinal = 3; - risingIncreaseValue = 0.6; - lavaIncreaseValue = 3.6; - lavaY = 576; - risingPercent = risingPercentOriginal; - rising.style.bottom = risingPercentOriginal + "%" - rising.style.display = "none"; - darkness = false; - inGame = true; - platformLevel1 = [...lobby]; - spawnGhostCords = () => { - xGhost = 20000; - yGhost = 20000; - } - spawnGhostCords(); - if(helpNum == 0){ // Go to lobby From Levels 1 - 15 - x = 120; - y = 500; - }else if(helpNum == 1){ - x = 300; - y = 410 - }else if(helpNum == 2){ - x = 560; - y = 370 - }else if(helpNum == 3){ - x = 720; - y = 500 - }else if(helpNum == 4){ - x = 910; - y = 400 - }else if(helpNum == 5){ - x = 880; - y = 300; - }else if(helpNum == 6){ - x = 582; - y = 290; - }else if(helpNum == 7){ - x = 400; - y = 300; - }else if(helpNum == 8){ - x = 220; - y = 300; - }else if(helpNum == 9){ - x = 20; - y = 260; - }else if(helpNum == 10){ - x = 20; - y = 80; - }else if(helpNum == 11){ - x = 240; - y = 80; - }else if(helpNum == 12){ - x = 560; - y = 50; - }else if(helpNum == 13){ - x = 880; - y = 200; - }else if(helpNum == 14 || helpNum == 15){ - x = 920; - y = 80; - } - setTransitionCords(); - fadeOutTransition() - backToLobbyEntered = false; - goingBackToTheLobby = false; - gravity(); - }, 1300); -} -//Back from Level to the Lobby -button_back.onclick = () => { - canEnter = false; //Now you cant spam "e" - backToLobby(); -} -//Resume Function -button_resume.onclick = () => { - canvas.style.filter = "blur(0)" - background.style.filter = "blur(0)" - rising.style.filter = "blur(0)" - esc.style.display = "none"; - escShowed = false; - black.style.opacity = "0"; -} -//Back from Lobby to the Menu Function -button_menu.onclick = () => { - inGame = false; - text.style.opacity = "1"; - note_button.style.zIndex = "3"; - escape_button.style.zIndex = "3"; - fullBlack.style.opacity = "1"; - black.style.opacity = "1"; - esc.style.display = "none"; - escShowed = false; - tutorialButton.style.pointerEvents = "auto"; //Now I can again click tutorialButton - tutorialButton.style.opacity = "100%"; - music.currentTime = 0; //OFF Lobby Music - music.pause(); - canvas.style.filter = "blur(0)"; - background.style.filter = "blur(0)"; - rising.style.filter = "blur(0)"; - setTimeout(() => { - game.style.display = "none"; - startMenu.style.display = "block"; - playButton.style.pointerEvents = "auto"; - playButton.style.display = "block"; - creditsButton.style.display = "block"; - black.style.opacity = "0"; - fullBlack.style.opacity = "0"; - setTimeout(() => { - fullBlack.style.display = "none"; - note_button.style.zIndex = "11"; - escape_button.style.zIndex = "11"; - }, 1000); - }, 1300); -} - -let usedRetry = false; - -button_retry.onclick = () => { - usedRetry = true; - esc.style.display = "none"; - escShowed = false; - black.style.opacity = "0"; - canvas.style.filter = "blur(0)" - background.style.filter = "blur(0)" - rising.style.filter = "blur(0)" - dead(); -} - - -//----------------------------------------ESC Button Function - -const escFunction = () => { - canvas.style.filter = "blur(1px)"; - background.style.filter = "blur(1px)"; - rising.style.filter = "blur(1px)"; - if(JSON.stringify(lobby) !== JSON.stringify(platformLevel1)){ //When Lobby and current level are not same - button_back.style.display = "block"; - button_resume.style.display = "block"; - button_retry.style.display = "block"; - if(helpNum == 15 || currentHp <= 0){ - button_retry.style.display = "none"; - } - button_menu.style.display = "none"; - if(!escShowed){ - esc.style.display = "flex"; - escShowed = true; - black.style.opacity = "0.6"; - }else if(escShowed){ - canvas.style.filter = "blur(0)"; - background.style.filter = "blur(0)"; - rising.style.filter = "blur(0)"; - esc.style.display = "none"; - escShowed = false; - black.style.opacity = "0"; - } - }else if(JSON.stringify(lobby) === JSON.stringify(platformLevel1)){ //When Lobby and current level are same - button_back.style.display = "none"; - button_resume.style.display = "block"; - button_retry.style.display = "none"; - button_menu.style.display = "block"; - if(!escShowed){ - esc.style.display = "flex"; - escShowed = true; - black.style.opacity = "0.6"; - }else if(escShowed){ - canvas.style.filter = "blur(0)"; - background.style.filter = "blur(0)"; - rising.style.filter = "blur(0)"; - esc.style.display = "none"; - escShowed = false; - black.style.opacity = "0"; - } - } -} - -escape_button.onclick = () => { - if(inGame && !musicEditorOpened){ - escFunction(); - } -} - -//----------------------------------------Finished level - -let finished = new Array (15) - -for (let index = 0; index < finished.length; index++) { - finished[index] = 2; -} - -finished[helpNum] = 0; // Unlock 1st level - -//----------------------------------------UNLOCK ALL DOORS FUNCTION - -const unlockAll = () => { - for (let index = 0; index < finished.length; index++) { - if(finished[index] != 1){ - finished[index] = 0; - } - } -} - -//unlockAll() - -//---------------------------------------- OBJECTS Collision - -const objectsCollision = () => { - if(playingBossFight){ - bossCollision(); - } - ghostCollision(); - for (let i = 0; i < platformLevel1.length; i++) { - //Spikes and Moving Spikes - if ((platformLevel1[i] == 2 || platformLevel1[i] == 4 || platformLevel1[i] == 23 || platformLevel1[i] == 24) || (platformLevel1[i] == 10 || platformLevel1[i] == 20 || platformLevel1[i] == 21 || platformLevel1[i] == 22) && canDieOnSpike == true) { - let platformX = (i % 32) * 32; - let platformY = Math.floor(i / 32) * 32; - if ( - y + height >= platformY + 10 && - y + height <= platformY + 27 + height && - x + width >= platformX + 10 && - x <= platformX + 22 - ) { - dead(); - } - } - //Lava - if (platformLevel1[i] == 3) { - let platformX = (i % 32) * 32; - let platformY = Math.floor(i / 32) * 32; - if ( - y + height >= platformY + 10 && - y + height <= platformY + 32 && - x + width >= platformX + 10 && - x <= platformX + 22 - ) { - if(playingBossFight){ - resistence = false; - } - dead(); - } - } - //Portal 1 - if (platformLevel1[i] == 11) { - let platformX = (i % 32) * 32; - let platformY = Math.floor(i / 32) * 32; - if ( - y + height >= platformY + 10 && - y + height <= platformY + 64 + height && - x + width >= platformX + 10 && - x <= platformX + 22 - ) { - sfx.src = "./res/sfx/portal_sfx.mp3"; - sfx.play(); - x = cordsPortalX2; - y = cordsPortalY2; - } - } - //Portal 2 - if (platformLevel1[i] == 12) { - let platformX = (i % 32) * 32; - let platformY = Math.floor(i / 32) * 32; - if ( - y + height >= platformY + 10 && - y + height <= platformY + 64 + height && - x + width >= platformX + 10 && - x <= platformX + 22 - ) { - sfx.src = "./res/sfx/portal_sfx.mp3"; - sfx.play(); - x = cordsPortalX1; - y = cordsPortalY1; - } - } - //Closing Doors - if (platformLevel1[i] == 30) { - let platformX = (i % 32) * 32; - let platformY = Math.floor(i / 32) * 32; - if ( - y + height >= platformY && - y + height <= platformY + 64 && - x + width >= platformX + 24 && - x <= platformX + 40 - ) { - if(!backToLobbyEntered && frameDoor < 1){ - restartTimer(); - timer.style.top = "-5%" - canEnter = false; //Now you cant spam "e" - sfx.src = "./res/sfx/completed.mp3"; - sfx.play(); - finished[helpNum] = 1; // Level Completed -> Doors are now GREEN - if(finished[helpNum + 1] != 1){ - finished[helpNum + 1] = 0; // Another Level is available -> removed LOCK - } - backToLobby(); - backToLobbyEntered = true; - if(usedRetry){ - usedRetry = false; - } - localStorage.setItem("finished_" + helpNum, finished[helpNum]); - localStorage.setItem("unlocked_" + helpNum, finished[helpNum + 1]); - } - } - } - //Key - if (platformLevel1[i] == 31) { - let platformX = (i % 32) * 32; - let platformY = Math.floor(i / 32) * 32; - if ( - y + height >= platformY && - y + height <= platformY + 64 && - x + width >= platformX && - x <= platformX + 32 - ) { - platformLevel1[i] = 0; - sfx.src = "./res/sfx/key_pick.mp3"; - sfx.play(); - for (let index = 0; index < platformLevel1.length; index++) { - if(platformLevel1[index] == 32 || platformLevel1[index] == 33){ - platformLevel1[index] = 0; - } - } - } - } - //Final Trophy - if (platformLevel1[i] == 35) { - let platformX = (i % 32) * 32; - let platformY = Math.floor(i / 32) * 32; - if ( - y + height >= platformY && - y + height <= platformY + 232 && - x + width >= platformX && - x <= platformX + 32 - ) { - c.font = "80px VT323, monospace"; - c.fillStyle = "lime"; - c.fillText("Thanks For Playing <3", 20, 130); - c.font = "30px VT323, monospace"; - c.fillStyle = "lime"; - c.fillText("Game By: Philip B.", 30, 160); - } - } - } -} - - -//This will load you progress which was saved -window.onload = () => { - for (let i = 0; i <= 15; i++) { - let savedValue = localStorage.getItem("unlocked_" + i); - if (savedValue !== null) { - finished[i + 1] = parseInt(savedValue); // Convert to numbers - } - } - for (let i = 0; i <= 15; i++) { - let savedValue = localStorage.getItem("finished_" + i); - if (savedValue !== null) { - finished[i] = parseInt(savedValue); // Convert to numbers - } - } -} - -//Reset Local Storage Function -const resetLocalStorage = () => { - for (let i = 0; i <= 15; i++) { - localStorage.removeItem("finished_" + i); - } - for (let i = 0; i <= 15; i++) { - localStorage.removeItem("unlocked_" + i); - } -} - -//resetLocalStorage(); - -//---------------------------------------- ORB Collision -let canOrbJump = false; -let orbUsed = false; - -const orbCollision = () => { - for (let i = 0; i < platformLevel1.length; i++) { - if (platformLevel1[i] == 5) { - let platformX = (i % 32) * 32; - let platformY = Math.floor(i / 32) * 32; - if ( - y + height >= platformY && - y + height <= platformY + 32 + height && - x + width >= platformX && - x <= platformX + 32 - ) { - canOrbJump = true; - break; - } else { - canOrbJump = false; - } - } - } -} - -//---------------------------------------- GHOST Collision - -let ghostKilled = false; -let bounced = false; -let saveGhostCordsX = 0; -let saveGhostCordsY = 0; - -const ghostCollision = () => { - if( - y + height > yGhost && - y < yGhost + 32 && - x + width > xGhost + 10 && - x < xGhost + 20 - ){ - dead(); - } else if ( - y + height > yGhost - 20 && - y < yGhost + 32 && - x + width > xGhost + 10 && - x < xGhost + 20 - ){ - spawnGhostCords = () => { - xGhost = 10000; - yGhost = 10000; - } - ghostKilled = true; - bounced = true; - spawnGhostCords(); - jump() - } -} - -//---------------------------------------- Crouch and Stand (Player) - -let crouched = false; -let canStandUp = true; -let ahCollision; -let underCollision; - -//This Function is checking, if you do not have a block above you (then you can stand up) -let aboveHeadCollision = () => { - ahCollision = requestAnimationFrame(aboveHeadCollision); - if (crouched == true) { - for (let i = 0; i < platformLevel1.length; i++) { - if (platformLevel1[i] == 1 || platformLevel1[i] == 6 || platformLevel1[i] == 7 || platformLevel1[i] == 9 || platformLevel1[i] == 18 || platformLevel1[i] == 19 || platformLevel1[i] == 32 || platformLevel1[i] == 33) { - let platformX = (i % 32) * 32; - let platformY = Math.floor(i / 32) * 32; - if ( - y + height >= platformY + 64 && - y + height <= platformY + 64 && - x + width >= platformX && - x <= platformX + 32 - ) { - canStandUp = false; - break; - }else{ - canStandUp = true; - } - } - } - } -}; - -//Crouching Function - -let crouch = () => { - if(!stillJumping && !ladderCol){ - crouched = true; - height = 20; - y += 20; - aboveHeadCollision() - } -} - -//UnCrouching Function (Stand Up) -let unCrouch = () => { - if (canStandUp == true) { - height = 40; - y -= 20; - crouched = false; - cancelAnimationFrame(gravityId); - gravity(); - drawPlayer(); - cancelAnimationFrame(ahCollision); - } - canStandUp = true; -}; - -let wasUnder = true; - -//You will Stand Up if you do not have above you a block -let under = () => { - underCollision = window.requestAnimationFrame(under); - if(canStandUp == true){ - unCrouch(); - wasUnder = true; - cancelAnimationFrame(underCollision); - } -} - -//---------------------------------------- Collision Canvas BOTTOM and BLOCKS - -let onRock = false; -let onWood = false; - -const bottomCollision = () => { - for (let i = 0; i < platformLevel1.length; i++) { - if (platformLevel1[i] == 1 || platformLevel1[i] == 6 || platformLevel1[i] == 7 || platformLevel1[i] == 9 || platformLevel1[i] == 18 || platformLevel1[i] == 19 || platformLevel1[i] == 32 || platformLevel1[i] == 33) { - let platformX = (i % 32) * 32; - let platformY = Math.floor(i / 32) * 32; - if ( - y + height >= platformY && - y + height <= platformY + 32 && - x + width >= platformX && - x <= platformX + 32 - ) { - stillJumping = false; - if(sfx_land.paused && sfx_land.src != "./res/sfx/small_land.mp3" && velocity >= 3 && velocity < 8 && !ladderCol){ - sfx_land.src = "./res/sfx/small_land.mp3" - sfx_land.play(); - }else if(sfx_land.paused && sfx_land.src != "./res/sfx/large_land.mp3" && velocity >= 8 && !ladderCol){ - sfx_land.src = "./res/sfx/large_land.mp3" - sfx_land.play(); - } - sfx_climb.pause() - y = platformY - height; - velocity = 0; - velocityGoingDown = 0; - orbUsed = false; - if(platformLevel1[i] == 1 || platformLevel1[i] == 6 || platformLevel1[i] == 32 || platformLevel1[i] == 33){ //You are on Rock - onRock = true; - onWood = false; - }else if(platformLevel1[i] == 7 || platformLevel1[i] == 19 || platformLevel1[i] == 18 || platformLevel1[i] == 9){ //You are on Wood - onRock = false; - onWood = true; - } - if(downPressed && !crouched){ //You will still crouch, if - crouch(); - } - cancelAnimationFrame(gravityId); - cancelAnimationFrame(goingDownId); - break; - } - } - } - //Canvas Bottom detection - if (canvas.height - height < y) { - y = canvas.height - height; - velocity = 0; - velocityGoingDown = 0; - orbUsed = false; - stillJumping = false; - cancelAnimationFrame(goingDownId); - cancelAnimationFrame(gravityId); - } -} - -//---------------------------------------- Hitting your head to the block Collision - -const upCollision = () => { - if (deltaUp > interval) { - thenUp = nowUp - (deltaUp % interval); - velocityJump = velocityJump/1.22 - y -= velocityJump; - for (let i = 0; i < platformLevel1.length; i++) { - if (platformLevel1[i] == 1 || platformLevel1[i] == 6 || platformLevel1[i] == 7 || platformLevel1[i] == 9 || platformLevel1[i] == 18 || platformLevel1[i] == 19 || platformLevel1[i] == 32 || platformLevel1[i] == 33) { - let platformX = (i % 32) * 32; - let platformY = Math.floor(i / 32) * 32 + 42; - if ( - y + height >= platformY && - y + height <= platformY + 32 && - x + width >= platformX && - x <= platformX + 32 - ) { - if(ladderCol == true){ - y = platformY - 42 - velocityGoingUp + height; - }else{ - y = platformY - 39 - velocityJump + height; - } - stillJumping == false; - headHit = true; - velocityJump = 0; - velocity = 0; - velocityGoingUp = 0; - cancelAnimationFrame(goingUpId); - cancelAnimationFrame(jumpingId); - cancelAnimationFrame(gravityId); - gravity(); - break; - } - } - } - if(velocityJump <= 0.35 && headHit == false){ - headHit = true; - velocityJump = 0; - velocityGoingUp = 0; - velocity = 0; - cancelAnimationFrame(jumpingId); - cancelAnimationFrame(gravityId); - gravity(); - } - } -} - -//----------------------------------------Ladder Collision - -let ladderCol = false; -let canGravityActivate = false; - -const ladderCollision = () => { - for (let i = 0; i < platformLevel1.length; i++) { - if (platformLevel1[i] == 26) { - let platformX = (i % 32) * 32; - let platformY = Math.floor(i / 32) * 32; - if ( - y + height >= platformY + 22 && - y + height <= platformY + 54 && - x + width >= platformX + 10 && - x <= platformX + 22 - ) { - if(crouched){ - unCrouch(); - } - onRock = false; - onWood = false; - ladderCol = true; - cancelAnimationFrame(gravityId) - canGravityActivate = true; - break; - } else { - ladderCol = false; - } - } - } - //Cancel Ladder Functions - if(ladderCol == false) { - cancelAnimationFrame(goingUpId); - cancelAnimationFrame(goingDownId); - if(canGravityActivate == true){ - velocity = 0; - gravity(); - canGravityActivate = false - } - } -} - -//----------------------------------------Climbing on a Ladder - UP - -let goingUpId; -let nowGoingdUp; -let thenGoingdUp = Date.now(); -let deltaGoingdUp; - -let velocityGoingUp = 0; - -const goingUp = () => { - velocityGoingUp = 2; - goingUpId = requestAnimationFrame(goingUp); - nowGoingdUp = Date.now(); - deltaGoingdUp = nowGoingdUp - thenGoingdUp; - if (deltaGoingdUp > interval) { - thenGoingdUp = nowGoingdUp - (deltaGoingdUp % interval); - if(sfx_climb.paused && ladderCol && (!onWood || !onRock)){ - sfx_walk.pause(); - sfx_climb.src = "./res/sfx/ladder.mp3" - sfx_climb.play(); - } - y -= velocityGoingUp; - upCollision(); - } -} - -//----------------------------------------Climbing on a Ladder - DOWN -let goingDownId; -let nowGoingdDown; -let thenGoingdDown = Date.now(); -let deltaGoingdDown; - -let velocityGoingDown = 0; - -let alreadyGoingDown = false; - -const goingDown = () => { - alreadyGoingDown = true; - velocityGoingDown = 2; - goingDownId = requestAnimationFrame(goingDown); - nowGoingdDown = Date.now(); - deltaGoingdDown = nowGoingdDown - thenGoingdDown; - if (deltaGoingdDown > interval) { - thenGoingdDown = nowGoingdDown - (deltaGoingdDown % interval); - if(sfx_climb.paused && ladderCol){ - sfx_walk.pause(); - sfx_climb.src = "./res/sfx/ladder.mp3" - setTimeout(() => { - sfx_climb.play(); - }, 10); - } - y += velocityGoingDown; - bottomCollision(); - } -} - -//SFX Walk Function - -const sfxWalkFunction = () => { - if(sfx_walk.paused && sfx_jump.paused && (onWood || onRock) && (velocityRight > 2 || velocityLeft > 2) && !crouched && !ladderCol && velocity < 0.3 && !isJumping && (currentFrameRun % 2 == 0)) { - if(onWood && !ladderCol){ - sfx_walk.src = "./res/sfx/wood_steps.mp3"; //Walking on wood SFX - }else if(onRock && !ladderCol){ - sfx_walk.src = "./res/sfx/stone_steps.mp3"; //Walking on rock SFX - } - sfx_walk.play(); - } -} - -//---------------------------------------- Gravity Function (Player) - -let velocity = 0; - -let stillJumping = false; -let nowDown; -let thenDown = Date.now(); -let deltaDown; - -let gravity = () => { - if(velocityJump < 0.1){ - gravityId = requestAnimationFrame(gravity); - nowDown = Date.now(); - deltaDown = nowDown - thenDown; - if (deltaDown > interval) { - thenDown = nowDown - (deltaDown % interval); - if(crouched && velocity > 1){ - unCrouch(); - } - if(velocity >= 0.6){ - sfx_climb.pause(); - } - if(!sfx_walk.paused && velocityRight <= 2 && velocityLeft <= 2 && (!onWood || !onRock) || crouched || ladderCol || velocity >= 0.3 || isJumping && currentFrameRun != 1){ - sfx_walk.pause(); - } - velocityGoingUp = 0; - orbCollision(); - velocity += 0.3; - y += velocity; - bottomCollision(); //Condition - } - } -} - -gravity(); - -//---------------------------------------- Jumping Function (Player) - -let headHit; - -let nowUp; -let thenUp = Date.now(); -let deltaUp; - -let jump = () => { - if((stillJumping == false || canOrbJump == true && orbUsed == false) || bounced){ - onRock = false; - onWood = false; - sfx_walk.currentTime = 0; - if(!sfx_walk.paused) { - sfx_walk.pause(); //Jumping = OFF SFX Walk - } - if(canOrbJump && velocity >= 0){ - cancelAnimationFrame(gravityId); - cancelAnimationFrame(jumpingId); - velocityJump = 0; - velocityJump = 0; - orbUsed = true; - setTimeout(() => { - orbUsed = false; - }, 250); - sfx_extra_jump.src = "./res/sfx/orb_jump.mp3" - sfx_extra_jump.play(); - }else if(!canOrbJump && !bounced && !ladderCol){ - sfx_jump.src = "./res/sfx/jump.mp3" - sfx_jump.play(); - }else if(!canOrbJump && bounced && !ladderCol){ - sfx_extra_jump.src = "./res/sfx/bonus_jump.mp3" - sfx_extra_jump.play(); - } - bounced = false; - headHit = false; - velocityJump = 16; - stillJumping = true; - if(crouched){ - unCrouch(); - } - const jumping = () => { - jumpingId = requestAnimationFrame(jumping); - nowUp = Date.now(); - deltaUp = nowUp - thenUp; - if (deltaUp > interval) { - thenUp = nowUp - (deltaUp % interval); - upCollision(); //Podmínka - } - } - velocity = 0; - jumping(); - } -} -//----------------------------------------Moving Right Function (Player) - -let velocityRight = 0; - -let nowRight; -let thenRight = Date.now(); -let deltaRight; - -let moveRight = () => { - velocityRight = 0.2; - const movingRight = () => { - animationIdRight = requestAnimationFrame(movingRight); - nowRight = Date.now(); - deltaRight = nowRight - thenRight; - if (deltaRight > interval) { - thenRight = nowRight - (deltaRight % interval); - //Crouched - if(crouched == true && velocityRight >= 1){ - velocityRight -= 0.12; - cancelAnimationFrame(gravityId); - gravity(); - }else{ //Not Crouched - if(isMovingRight == true){ - if(velocityRight < 4 && crouched == false){ - velocityRight += 0.12; - }else if(velocityRight < 1 && crouched == true){ - velocityRight += 0.12; - cancelAnimationFrame(gravityId); - gravity(); - }else if(velocityRight + 0.12 >= 4){ - velocityRight = 4; - }else if(velocityRight >= 2 && velocityLeft >= 2){//If you walk to two sides at once, you won't move - velocityRight = 0; - velocityLeft = 0; - } - - }else if(isMovingRight == false){ - velocityRight -= 0.2; - if(velocityRight <= 0.1){ - if(velocityRight > velocityLeft && isMovingRight){ //Fixing switching sides - turnedLeft = false; - turnedRight = true; - } - cancelAnimationFrame(animationIdRight); - } - } - - } - for (let i = 0; i < platformLevel1.length; i++) { - if (platformLevel1[i] == 1 || platformLevel1[i] == 6 || platformLevel1[i] == 7 || platformLevel1[i] == 9 || platformLevel1[i] == 18 || platformLevel1[i] == 19 || platformLevel1[i] == 32 || platformLevel1[i] == 33) { - let platformX = (i % 32) * 32; - let platformY = Math.floor(i / 32) * 32; - if ( - y + height > platformY && - y < platformY + 32 && - x + width + velocityRight + 0.2 > platformX && - x < platformX + 32 - ) { - if(velocityRight > velocityLeft && isMovingRight){ //Fixing switching sides - turnedLeft = false; - turnedRight = true; - } - if(velocityRight >= 1 && velocityLeft >= 1){//If you walk to two sides at once, you won't move - velocityLeft = 0; - velocityRight = 0; - } - if(!canStandUp){ // This condition fixing uncrouch teleport bug - x = platformX - width - 0.12; - } - if(velocityRight > 0.5){ - velocityRight = 0; - x = platformX - width - 1.2; - }else{ - velocityRight = 0; - } - break; - } - } - } - x += velocityRight; - if (x >= canvas.width - width) { - x = canvas.width - width; - velocityRight = 0; - cancelAnimationFrame(animationIdRight); - } - if(stillJumping == false && !crouched){ - stillJumping = true; - cancelAnimationFrame(gravityId); - gravity(); - } - } - }; - movingRight(); -}; - - -//----------------------------------------Moving Left Function (Player) - -let velocityLeft = 0; - -let nowLeft; -let thenLeft = Date.now(); -let deltaLeft; - -let moveLeft = () => { - velocityLeft = 0.2; - const movingLeft = () => { - animationIdLeft = requestAnimationFrame(movingLeft); - nowLeft = Date.now(); - deltaLeft = nowLeft - thenLeft; - if (deltaLeft > interval) { - thenLeft = nowLeft - (deltaLeft % interval); - //Crouched - if(crouched == true && velocityLeft >= 1){ - velocityLeft -= 0.12; - cancelAnimationFrame(gravityId); - gravity(); - }else{ //Not Crouched - if(isMovingLeft == true){ - if(velocityLeft < 4 && crouched == false){ - velocityLeft += 0.12; - }else if(velocityLeft <= 1 && crouched == true){ - velocityLeft += 0.12; - cancelAnimationFrame(gravityId); - gravity(); - }else if(velocityLeft + 0.12 >= 4){ - velocityLeft = 4; - }else if(velocityRight >= 2 && velocityLeft >= 2){ //If you walk to two sides at once, you won't move - velocityRight = 0; - velocityLeft = 0; - } - }else if(isMovingLeft == false){ - velocityLeft -= 0.2; - if(velocityLeft <= 0.1){ - if(velocityRight <= velocityLeft && isMovingLeft){ //Fixing switching sides - turnedLeft = true; - turnedRight = false; - } - cancelAnimationFrame(animationIdLeft); - } - } - } - for (let i = 0; i < platformLevel1.length; i++) { - if (platformLevel1[i] == 1 || platformLevel1[i] == 6 || platformLevel1[i] == 7 || platformLevel1[i] == 9 || platformLevel1[i] == 18 || platformLevel1[i] == 19 || platformLevel1[i] == 32 || platformLevel1[i] == 33) { - let platformX = (i % 32) * 32; - let platformY = Math.floor(i / 32) * 32; - if ( - y + height > platformY && - y < platformY + 32 && - x - velocityLeft < platformX + 32 && - x > platformX - ) { - if(velocityRight <= velocityLeft && isMovingLeft){ //Fixing switching sides - turnedLeft = true; - turnedRight = false; - } - if(velocityRight >= 1 && velocityLeft >= 1){//If you walk to two sides at once, you won't move - velocityLeft = 0; - velocityRight = 0; - } - if(!canStandUp){ // This condition fixing uncrouch teleport bug - x = platformX + width + 2.24; - } - if(velocityLeft > 0.5){ - velocityLeft = 0; - x = platformX + width + 2.2; - }else{ - velocityLeft = 0; - } - break; - } - } - } - x -= velocityLeft; - if (x <= 0) { - x = 0; - velocityLeft = 0; - cancelAnimationFrame(animationIdLeft); - } - if(stillJumping == false && !crouched){ - stillJumping = true; - cancelAnimationFrame(gravityId); - gravity(); - } - } - }; - movingLeft(); -}; - -//--------------------------PUNCH Function - -let punched = false; -let alreadyPunched = false; -let punchCooldown = false; -let canPlayBreakSound = true; - -let currentHp = 100; - -const punch = () => { - if(!crouched && !punchCooldown){ - punchCooldown = true; - punched = true; - if(playingAsRuby){ - sfx_player.src = "./res/sfx/ruby_attack.mp3"; - }else if(playingAsRioter){ - sfx_player.src = "./res/sfx/rioter_attack.mp3"; - } - sfx_player.play(); - sfx_miss.src = "./res/sfx/miss.mp3"; - sfx_miss.play(); - if(canAttack){ - sfx_punch.src = "./res/sfx/punch.mp3"; - sfx_punch.play(); - currentHp -= 5.5566; //5.5566 - hp.style.width = currentHp + "%"; - if(currentHp <= 0 && !backToLobbyEntered){ - deadBoss(); - finalDoorUnlocked = true; - } - }else{ - for (let i = 0; i < platformLevel1.length; i++) { - if (platformLevel1[i] == 6) { - let platformX = (i % 32) * 32; - let platformY = Math.floor(i / 32) * 32; - if ( - (y + height > platformY&& - y < platformY + 32 && - x + width > platformX - 10 && - x < platformX && turnedRight) - || - (y + height > platformY && - y < platformY + 32 && - x < platformX + 42 && - x > platformX + 32 && turnedLeft) - ) { - platformLevel1[i] = 0; - if(canPlayBreakSound){ //When you hit 2 blocks, sound will be played once - canPlayBreakSound = false; - sfx_punch.src = "./res/sfx/wall_break.mp3"; - sfx_punch.play(); - setTimeout(() => { - canPlayBreakSound = true; - }, 500); - } - } - } - } - } - } -} - -//--------------------------Dead Boss Function - -const deadBoss = () => { - restartTimer(); - timer.style.top = "-5%" - canAttack = false; - inGame = false; - sfx_boss_laugh.pause(); - black.style.opacity = "1"; - setTimeout(() => { - frameDoorFinal = 0; - }, 2000); - scene.addEventListener("ended", () => { - scene.style.display = "none"; - black.style.opacity = "0"; - inGame = true; - spawnCords(); - gravity(); - }); - clearTimeout(setTimeoutDoor); - music.pause(); - lives = 3; - playingBossFight = false; - bossX = 1000000; - bossY = 0; - if(playingAsRioter){ - scene.src = "./res/vid/rioter_scene.mp4"; - }else{ - scene.src = "./res//vid/ruby_scene.mp4"; - } - scene.style.display = "block"; - scene.play(); - clearInterval(bossAttackGenerator); - if(usedRetry){ - usedRetry = false; - } - cancelAnimationFrame(bossMoveXId); - cancelAnimationFrame(bossMoveYId); - clearTimeout(setTimeoutDoor) - bossAttacking = false; - hp.style.width = currentHp + "%"; - hps.style.display = "none" - myHp.style.display = "none" - risingLavaActivated = false; - lavaIncreaseValue = 3; - lavaY = 576; - risingPercent = risingPercentOriginal; - rising.style.bottom = risingPercent + "%" - rising.style.display = "none"; - darkness = false; - heart1.style.display = "block"; - heart2.style.display = "block"; - heart3.style.display = "block"; - hearts = 3; - clearTimeout(breakBottom); - clearTimeout(bossLava); - clearTimeout(bossLava2); - clearTimeout(bossLava3); - clearTimeout(endBossLava); - clearTimeout(bossDarkness); - clearTimeout(endBossDarkness); - clearInterval(nonStopShake); - spawnCords(); - velocity = 0; - cancelAnimationFrame(gravityId); - platformLevel1 = [...map[14]]; - originalPlatform1 = [...platformLevel1]; -} - -//-------------------------- Pressing KEYBOARD Buttons -let up = "w"; -let down = "s"; -let right = "d"; -let left = "a"; - -let UP = "W"; -let DOWN = "S"; -let RIGHT = "D"; -let LEFT = "A"; - -let space = " "; - -let escShowed = false; -let inGame = false; - -let downPressed = false; - -let jumpInterval; -let jumpIntervalSet = false; - -window.addEventListener("keydown", (event) => { - // W - Jumping / Climbing Up - if ((event.key == up || event.key == UP) && canStandUp == true && inGame && !isJumping) { - currentFrame = 0; - isJumping = true; - if(ladderCol){ - goingUp(); - }else{ - if(!jumpIntervalSet && stillJumping){ //Better W pressed detection - jump() - jumpInterval = setInterval(() => { - if(canOrbJump && velocity == 0){ - clearInterval(jumpInterval) - }else{ - jump() - } - }, 10); - setTimeout(() => { - clearInterval(jumpInterval) - }, 100); - }else if(!stillJumping && !jumpIntervalSet){ - jump(); - } - jumpIntervalSet = true; - } - // D - Moving Right / Climbing Right - } else if ((event.key == right || event.key == RIGHT) && !isMovingRight && inGame) { - currentFrame = 0; - isMovingRight = true; - turnedRight = true; - turnedLeft = false; - cancelAnimationFrame(animationIdRight); - moveRight(); - // A - Moving Left / Climbing Left - } else if ((event.key == left || event.key == LEFT) && !isMovingLeft && inGame) { - currentFrame = 0; - isMovingLeft = true; - turnedRight = false; - turnedLeft = true; - cancelAnimationFrame(animationIdLeft); - moveLeft(); - // S - Crouching / Climbing Down - } else if ((event.key == down || event.key == DOWN) && !punched) { - if(!crouched && !downPressed && !ladderCol && inGame){ - crouch(); - currentFrame = 0; - } else if (ladderCol && !alreadyGoingDown){ - sfx_climb.pause(); - goingDown(); - } - downPressed = true; - // SPACE - Punching BOSS / Breaking Cracked Blocks - } else if (event.key == space) { - if(!alreadyPunched && !ladderCol && inGame){ - punch(); - } - alreadyPunched = true; - } else if (event.key == "Escape" && inGame) { - if(musicEditorOpened){ - music_editor.style.display = "none"; - musicEditorOpened = false; - black.style.opacity = "0"; - canvas.style.filter = "blur(0)" - background.style.filter = "blur(0)" - rising.style.filter = "blur(0)" - }else{ - escFunction(); - } - } -}); - -//-------------------------- Releasing KEYBOARD Buttons - -window.addEventListener("keyup", (event) => { - // W - Stop Climbing UP - if (event.key == up || event.key == UP && inGame) { - isJumping = false; - jumpIntervalSet = false; - clearInterval(jumpInterval) - if(ladderCol){ - cancelAnimationFrame(goingUpId); - sfx_climb.pause(); - } - velocityGoingUp = 0; - } - // D - Stop Moving Right - if (event.key == right || event.key == RIGHT) { - isMovingRight = false; - if(velocityRight <= velocityLeft && isMovingLeft){ //Fixing switching sides - turnedLeft = true; - turnedRight = false; - } - } - // A - Stop Moving Left - if (event.key == left || event.key == LEFT) { - isMovingLeft = false; - if(velocityRight > velocityLeft && isMovingRight){ //Fixing switching sides - turnedLeft = false; - turnedRight = true; - } - } - // S - UnCrouch / Stop Climbing Down - if (event.key == down ||event.key == DOWN) { - downPressed = false; - if(velocity <= 0.35 && crouched == true && canStandUp == true && ladderCol == false){ - unCrouch(); - }else if(canStandUp == false){ - if(wasUnder == true){ - wasUnder = false; - under(); - } - } - if(ladderCol){ - velocityGoingDown = 0; - cancelAnimationFrame(goingDownId); - alreadyGoingDown = false; - sfx_climb.pause(); - } - } - if (event.key == space && inGame) { - alreadyPunched = false; - } -}); \ No newline at end of file diff --git a/res/music/ending.mp3 b/res/music/ending.mp3 deleted file mode 100644 index a9878b8..0000000 Binary files a/res/music/ending.mp3 and /dev/null differ diff --git a/res/music/finalboss.mp3 b/res/music/finalboss.mp3 deleted file mode 100644 index 65107dd..0000000 Binary files a/res/music/finalboss.mp3 and /dev/null differ diff --git a/res/music/lobby_music.mp3 b/res/music/lobby_music.mp3 deleted file mode 100644 index 64812a0..0000000 Binary files a/res/music/lobby_music.mp3 and /dev/null differ diff --git a/res/music/song0.mp3 b/res/music/song0.mp3 deleted file mode 100644 index e183a06..0000000 Binary files a/res/music/song0.mp3 and /dev/null differ diff --git a/res/music/song1.mp3 b/res/music/song1.mp3 deleted file mode 100644 index b035417..0000000 Binary files a/res/music/song1.mp3 and /dev/null differ diff --git a/res/music/song10.mp3 b/res/music/song10.mp3 deleted file mode 100644 index e090c6b..0000000 Binary files a/res/music/song10.mp3 and /dev/null differ diff --git a/res/music/song11.mp3 b/res/music/song11.mp3 deleted file mode 100644 index e61e95b..0000000 Binary files a/res/music/song11.mp3 and /dev/null differ diff --git a/res/music/song12.mp3 b/res/music/song12.mp3 deleted file mode 100644 index c34ae90..0000000 Binary files a/res/music/song12.mp3 and /dev/null differ diff --git a/res/music/song13.mp3 b/res/music/song13.mp3 deleted file mode 100644 index 893f7cc..0000000 Binary files a/res/music/song13.mp3 and /dev/null differ diff --git a/res/music/song2.mp3 b/res/music/song2.mp3 deleted file mode 100644 index 54270a3..0000000 Binary files a/res/music/song2.mp3 and /dev/null differ diff --git a/res/music/song3.mp3 b/res/music/song3.mp3 deleted file mode 100644 index daf42c7..0000000 Binary files a/res/music/song3.mp3 and /dev/null differ diff --git a/res/music/song4.mp3 b/res/music/song4.mp3 deleted file mode 100644 index 7723ee5..0000000 Binary files a/res/music/song4.mp3 and /dev/null differ diff --git a/res/music/song5.mp3 b/res/music/song5.mp3 deleted file mode 100644 index d493cee..0000000 Binary files a/res/music/song5.mp3 and /dev/null differ diff --git a/res/music/song6.mp3 b/res/music/song6.mp3 deleted file mode 100644 index 4afe340..0000000 Binary files a/res/music/song6.mp3 and /dev/null differ diff --git a/res/music/song7.mp3 b/res/music/song7.mp3 deleted file mode 100644 index def6ca1..0000000 Binary files a/res/music/song7.mp3 and /dev/null differ diff --git a/res/music/song8.mp3 b/res/music/song8.mp3 deleted file mode 100644 index 2108f66..0000000 Binary files a/res/music/song8.mp3 and /dev/null differ diff --git a/res/music/song9.mp3 b/res/music/song9.mp3 deleted file mode 100644 index 2f9f67d..0000000 Binary files a/res/music/song9.mp3 and /dev/null differ diff --git a/res/sfx/bonus_jump.mp3 b/res/sfx/bonus_jump.mp3 deleted file mode 100644 index 39a5d55..0000000 Binary files a/res/sfx/bonus_jump.mp3 and /dev/null differ diff --git a/res/sfx/boss_slash.mp3 b/res/sfx/boss_slash.mp3 deleted file mode 100644 index aff0a95..0000000 Binary files a/res/sfx/boss_slash.mp3 and /dev/null differ diff --git a/res/sfx/completed.mp3 b/res/sfx/completed.mp3 deleted file mode 100644 index a2af728..0000000 Binary files a/res/sfx/completed.mp3 and /dev/null differ diff --git a/res/sfx/died.mp3 b/res/sfx/died.mp3 deleted file mode 100644 index 5442d5d..0000000 Binary files a/res/sfx/died.mp3 and /dev/null differ diff --git a/res/sfx/door.mp3 b/res/sfx/door.mp3 deleted file mode 100644 index 2a9f945..0000000 Binary files a/res/sfx/door.mp3 and /dev/null differ diff --git a/res/sfx/jump.mp3 b/res/sfx/jump.mp3 deleted file mode 100644 index 4be24c5..0000000 Binary files a/res/sfx/jump.mp3 and /dev/null differ diff --git a/res/sfx/key_pick.mp3 b/res/sfx/key_pick.mp3 deleted file mode 100644 index 45c7ae2..0000000 Binary files a/res/sfx/key_pick.mp3 and /dev/null differ diff --git a/res/sfx/killyou.mp3 b/res/sfx/killyou.mp3 deleted file mode 100644 index cfe017e..0000000 Binary files a/res/sfx/killyou.mp3 and /dev/null differ diff --git a/res/sfx/ladder.mp3 b/res/sfx/ladder.mp3 deleted file mode 100644 index f42065d..0000000 Binary files a/res/sfx/ladder.mp3 and /dev/null differ diff --git a/res/sfx/large_land.mp3 b/res/sfx/large_land.mp3 deleted file mode 100644 index acb4130..0000000 Binary files a/res/sfx/large_land.mp3 and /dev/null differ diff --git a/res/sfx/laugh.mp3 b/res/sfx/laugh.mp3 deleted file mode 100644 index f043c74..0000000 Binary files a/res/sfx/laugh.mp3 and /dev/null differ diff --git a/res/sfx/miss.mp3 b/res/sfx/miss.mp3 deleted file mode 100644 index 4aeb682..0000000 Binary files a/res/sfx/miss.mp3 and /dev/null differ diff --git a/res/sfx/orb_jump.mp3 b/res/sfx/orb_jump.mp3 deleted file mode 100644 index 9edea6f..0000000 Binary files a/res/sfx/orb_jump.mp3 and /dev/null differ diff --git a/res/sfx/portal_sfx.mp3 b/res/sfx/portal_sfx.mp3 deleted file mode 100644 index 0897f30..0000000 Binary files a/res/sfx/portal_sfx.mp3 and /dev/null differ diff --git a/res/sfx/punch.mp3 b/res/sfx/punch.mp3 deleted file mode 100644 index 50708f0..0000000 Binary files a/res/sfx/punch.mp3 and /dev/null differ diff --git a/res/sfx/rioter_attack.mp3 b/res/sfx/rioter_attack.mp3 deleted file mode 100644 index 1ad7f46..0000000 Binary files a/res/sfx/rioter_attack.mp3 and /dev/null differ diff --git a/res/sfx/ruby_attack.mp3 b/res/sfx/ruby_attack.mp3 deleted file mode 100644 index 232f850..0000000 Binary files a/res/sfx/ruby_attack.mp3 and /dev/null differ diff --git a/res/sfx/small_land.mp3 b/res/sfx/small_land.mp3 deleted file mode 100644 index 68624b3..0000000 Binary files a/res/sfx/small_land.mp3 and /dev/null differ diff --git a/res/sfx/stone_steps.mp3 b/res/sfx/stone_steps.mp3 deleted file mode 100644 index cd429b1..0000000 Binary files a/res/sfx/stone_steps.mp3 and /dev/null differ diff --git a/res/sfx/wall_break.mp3 b/res/sfx/wall_break.mp3 deleted file mode 100644 index 329352e..0000000 Binary files a/res/sfx/wall_break.mp3 and /dev/null differ diff --git a/res/sfx/wood_steps.mp3 b/res/sfx/wood_steps.mp3 deleted file mode 100644 index 52373e7..0000000 Binary files a/res/sfx/wood_steps.mp3 and /dev/null differ diff --git a/res/vid/rioter_scene.mp4 b/res/vid/rioter_scene.mp4 deleted file mode 100644 index 14ccd9e..0000000 Binary files a/res/vid/rioter_scene.mp4 and /dev/null differ diff --git a/res/vid/ruby_scene.mp4 b/res/vid/ruby_scene.mp4 deleted file mode 100644 index 66c7f65..0000000 Binary files a/res/vid/ruby_scene.mp4 and /dev/null differ diff --git a/res/vid/scene.mp4 b/res/vid/scene.mp4 deleted file mode 100644 index 2cd5b67..0000000 Binary files a/res/vid/scene.mp4 and /dev/null differ diff --git a/res/vid/transition1.webm b/res/vid/transition1.webm deleted file mode 100644 index bffe4c6..0000000 Binary files a/res/vid/transition1.webm and /dev/null differ diff --git a/res/vid/transition2.webm b/res/vid/transition2.webm deleted file mode 100644 index 1dd9354..0000000 Binary files a/res/vid/transition2.webm and /dev/null differ