secret passages(platformer)

Instructions: use arrow keys or WASD\nclick green flag 3-2 times\n\nSequel: https://scratch.mit.edu/projects/448990092/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nI will stop working on this project\n\nthis guy pretty cool https://www.youtube.com/channel/UC5BBWuXbagRaINbgdvOdGwA/videos

@Stage\n\nwhen flag clicked\nforever\n    if <not <<(boss) = [1]> or <(scene?) = [yes]>>> then\n        set volume to (7) %\n        stop all sounds\n        play sound [Cave edited v] until done\n        if <(scene?) = [yes]> then\n            stop all sounds\n        end\n    end\n    if <(boss) = [1]> then\n        set volume to (50) %\n        stop all sounds\n        play sound [Movie 2 edited v] until done\n    end\nend\n\nset [level v] to [13]\n\n@ground\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\nwhen flag clicked\nset [level v] to [1]\nset [scene? v] to [no]\nforever\n    switch costume to (level)\nend\n\nset [spikes v] to [1]\n\n@player\n\ndefine grav (grav) jump h (jump h) move x (x) friction (fric) slope (slope)\nset [slope v] to (slope)\nchange [y vel v] by (grav)\nchange y by (y vel)\nif <touching (ground v)?> then\n    repeat until <not <touching (ground v)?>>\n        change y by ((([abs v] of (y vel) ) / (y vel)) * (-1))\n    end\n    set [y vel v] to (<<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <(([abs v] of (y vel) ) / (y vel)) = [-1]>> * (jump h))\nend\nset [x vel v] to (((x vel) + ((<<key (a v) pressed?> or <key (left arrow v) pressed?>> * ((x) * (-1))) + (<<key (right arrow v) pressed?> or <key (d v) pressed?>> * (x)))) * (fric))\nchange x by (x vel)\nset [slope v] to [0]\nrepeat until <<(slope) = ((slope) * (-1))> or >\n    change y by (1)\n    change [slope v] by (-1)\nend\nif <touching (ground v)?> then\n    change y by (slope)\n    repeat until <not <touching (ground v)?>>\n        change x by ((([abs v] of (x vel) ) / (x vel)) * (-1))\n    end\nend\nif <<<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> or <<key (d v) pressed?> or <key (a v) pressed?>>> then\n    set [walk v] to [1]\nelse\n    set [walk v] to [0]\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    point in direction (90)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    point in direction (-90)\nend\nif <(y vel) > [0]> then\n    switch costume to (idle2 v)\nend\n\nwhen flag clicked\nforever\n    if <(level) = [10]> then\n        grav [-1] jump h [15] move x [3] friction [0.9] slope [11]\n    else\n        grav [-1] jump h [15] move x [1] friction [0.9] slope [2]\n    end\nend\n\nwhen flag clicked\ngo to x: (-223) y: (-72)\nset [x vel v] to [0]\nset [y vel v] to [0]\nset [imunity v] to [0]\nforever\n    if <<(level) = [10]> and <not <(boss) = [1]>>> then\n        go to x: (0) y: (-81)\n        switch costume to (idle v)\n        set [imunity v] to [1]\n    else\n        set [imunity v] to [0]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(y vel) > [0]> then\n        set volume to (30) %\n        start sound [Jump v]\n        wait until <not <(y vel) > [0]>>\n    end\nend\n\nwhen flag clicked\nset [test v] to [no]\nforever\n    if <<(username) = [gtpoptestschool]> and <key (0 v) pressed?>> then\n        set [test v] to [no]\n    end\n    if <<key (1 v) pressed?> and <(username) = [gtpoptestschool]>> then\n        set [test v] to [yes]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(test) = [yes]> then\n        create clone of (_myself_ v)\n        wait (0.1) seconds\n    end\nend\n\nwhen I start as a clone\nset [ghost v] effect to (45)\nwait (3) seconds\ndelete this clone\n\nwhen flag clicked\nforever\n    if <(walk) = [1]> then\n        next costume\n        if <<(costume [number v]) = [7]> or <(costume [number v]) = [6]>> then\n            switch costume to (walk v)\n        end\n    else\n        if <(y vel) < [3]> then\n            switch costume to (idle v)\n        end\n    end\n    if <(x position) > [220]> then\n        start sound [Collect v]\n        change [level v] by (1)\n        go to x: (-223) y: (-72)\n        set [x vel v] to [0]\n        set [y vel v] to [0]\n    end\n    if <<touching (spikes v)?> or <touching (bullets v)?>> then\n        start sound [Rip v]\n        go to x: (-223) y: (-72)\n        set [x vel v] to [0]\n        set [y vel v] to [0]\n    end\n    if <not <(imunity) = [1]>> then\n        if <<touching (spike boss  v)?> and <(attack) = [1]>> then\n            set [spikes v] to [25]\n            clear sound effects\n            stop all sounds\n            start sound [Rip v]\n            go to x: (0) y: (-81)\n            switch costume to (idle v)\n            set [x vel v] to [0]\n            set [y vel v] to [0]\n            set [boss v] to [0]\n            set [scene? v] to [yes]\n        end\n    end\nend\n\nset [level v] to [10]\n\nset [spikes v] to [0]\n\nwhen flag clicked\nforever\n    if <<(spikes) < [1]> and <(level) = [10]>> then\n        go to x: (0) y: (-81)\n        switch costume to (idle v)\n    end\nend\n\n@text\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [level v] to [1]\nforever\n    go to [front v] layer\n    switch costume to (level)\nend\n\nwhen flag clicked\nset volume to (100) %\nset [level v] to [1]\nforever\n    if <(level) = [1]> then\n        set voice to (tenor v)::tts\n        speak [hello]::tts\n        wait until <not <(level) = [1]>>\n    end\n    if <(level) = [2]> then\n        set voice to (tenor v)::tts\n        speak [there's a secret passage can you see it]::tts\n        wait until <not <(level) = [2]>>\n    end\n    if <(level) = [3]> then\n        set voice to (tenor v)::tts\n        speak [there's gonna be more secret passages beware!]::tts\n        wait until <not <(level) = [3]>>\n    end\n    if <(level) = [4]> then\n        set voice to (tenor v)::tts\n        speak [bye]::tts\n        wait until <not <(level) = [4]>>\n    end\n    if <(level) = [4]> then\n        set voice to (tenor v)::tts\n        speak [bye]::tts\n        wait until <not <(level) = [4]>>\n    end\n    if <(level) = [13]> then\n        set voice to (tenor v)::tts\n        speak [as you can see there is a cannon]::tts\n        speak [please dont touch it]::tts\n        wait until <not <(level) = [13]>>\n    end\n    if <(level) = [14]> then\n        set voice to (tenor v)::tts\n        speak [hey imagine this!]::tts\n        speak [quadruple spike+double cannon 0.1 reload]::tts\n        speak [yeah]::tts\n        wait until <not <(level) = [14]>>\n    end\n    if <(level) = [15]> then\n        set voice to (tenor v)::tts\n        speak [so hows the boss]::tts\n        speak [easy right well]::tts\n        speak [it was level 1]::tts\n        wait until <not <(level) = [15]>>\n    end\n    if <(level) = [16]> then\n        set voice to (tenor v)::tts\n        speak [so um]::tts\n        speak [yeah]::tts\n    end\n    wait until <not <(level) = [16]>>\nend\n\nset [level v] to [12]\n\n@bg\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    switch costume to (level)\nend\n\nwhen flag clicked\nstop all sounds\nset [ghost v] effect to (40)\nforever\n    if <touching (player v)?> then\n        start sound [Connect v]\n        set volume to (30) %\n        go to [back v] layer\n        repeat (10)\n            change [ghost v] effect by (5)\n        end\n        wait until <not <touching (player v)?>>\n    else\n        start sound [Disconnect v]\n        set volume to (30) %\n        go to [front v] layer\n        repeat (10)\n            change [ghost v] effect by (-5)\n        end\n        wait until <touching (player v)?>\n    end\nend\n\nset [level v] to [16]\n\n@spikes\n\nwhen flag clicked\ngo to [front v] layer\ngo to x: (0) y: (0)\nset [level v] to [1]\nforever\n    switch costume to (level)\nend\n\n@Sprite1\n\nwhen flag clicked\nforever\n    if <<key (space v) pressed?> and <(username) = [gtpoptestschool]>> then\n        point in direction (85)\n        switch costume to (costume6 v)\n        go to x: (0) y: (0)\n        show\n        go to [front v] layer\n        stop [all v]\n    else\n        hide\n    end\nend\n\n@boss\n\nwhen flag clicked\nforever\n    go to x: (0) y: (110)\n    if <(level) = [10]> then\n        show\n        set [ghost v] effect to (0)\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nset [scene? v] to [no]\nset [end v] to [0]\nforever\n    if <(level) = [10]> then\n        set [scene? v] to [yes]\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nset [boss v] to [0]\nforever\n    if <(scene?) = [yes]> then\n        switch costume to (scene v)\n        set voice to (giant v)::tts\n        speak (join [hello ] (username))::tts\n        speak [my name is the boss]::tts\n        speak [i am here to stop you from finishing this game]::tts\n        speak [i meant trap]::tts\n        speak [nevermind be gone]::tts\n        set [boss v] to [1]\n        set [scene? v] to [no]\n        wait until <not <(scene?) = [yes]>>\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(boss) = [1]> and <(end) = [0]>> then\n        switch costume to (scene v)\n        repeat until <(costume [number v]) = [8]>\n            next costume\n        end\n        broadcast (spikes v)\n        wait (0.1) seconds\n        repeat until <(costume [number v]) = [14]>\n            next costume\n        end\n        wait (2) seconds\n    else\n    end\nend\n\nset [level v] to [10]\n\nset [level v] to [10]\n\nwhen flag clicked\nforever\n    if <(end) = [1]> then\n        set [boss v] to [0]\n        show\n        switch costume to (scene v)\n        repeat until <(costume [number v]) = [7]>\n            next costume\n        end\n        repeat (2)\n            wait (0.1) seconds\n            start sound [Basketball Bounce v]\n            switch costume to (boss act-7 v)\n            wait (0.1) seconds\n            switch costume to (boss act-6 v)\n            wait (1) seconds\n        end\n        wait (1) seconds\n        repeat (20)\n            start sound [Basketball Bounce v]\n            wait (0) seconds\n            switch costume to (boss act-7 v)\n            wait (0) seconds\n            switch costume to (boss act-6 v)\n        end\n        start sound [Basketball Bounce v]\n        switch costume to (boss act-7 v)\n        wait (1) seconds\n        switch costume to (boss act-6 v)\n        wait (0.1) seconds\n        start sound [Basketball Bounce v]\n        switch costume to (boss act-7 v)\n        wait (0.1) seconds\n        switch costume to (end scene-1 v)\n        repeat until <(costume [number v]) = [22]>\n            next costume\n        end\n        switch costume to (end scene-9 v)\n        start sound [Bonk v]\n        set [level v] to [11]\n        set [end v] to [0]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(spikes) < [1]> then\n        stop all sounds\n        set [end v] to [1]\n        wait until <not <(spikes) < [1]>>\n    end\nend\n\nset [spikes v] to [0]\n\n@spike boss \n\nwhen flag clicked\nhide\nforever\n    go to x: (0) y: (0)\n    if <(scene?) = [yes]> then\n        hide\n        stop all sounds\n        clear sound effects\n    end\n    if <(spikes) < [1]> then\n        hide\n    end\nend\n\nwhen I receive [spikes v]\nif <not <(spikes) < [1]>> then\n    set [attack v] to [0]\n    show\n    switch costume to (join [warning-] (pick random (1) to (3)))\n    repeat (2)\n        set volume to (40) %\n        play sound [Alert v] until done\n    end\n    start sound [Crunch v]\n    set [attack v] to [1]\n    change [spikes v] by (-1)\n    if <(costume [number v]) = [1]> then\n        switch costume to (spikes-1 v)\n    end\n    if <(costume [number v]) = [3]> then\n        switch costume to (spikes-2 v)\n    end\n    if <(costume [number v]) = [5]> then\n        switch costume to (spikes-3 v)\n    end\n    wait (1) seconds\n    hide\nend\n\n@spike counter\n\nwhen flag clicked\nset [spikes v] to [25]\nforever\n    go to x: (176) y: (160)\n    if <(level) = [10]> then\n        show\n        set [ghost v] effect to (0)\n    else\n        if <(spikes) > [0]> then\n            hide\n        end\n    end\n    if <(spikes) < [1]> then\n        hide\n    else\n        switch costume to (spikes)\n    end\nend\n\nset [level v] to [10]\n\n@cannon\n\nwhen flag clicked\nforever\n    hide\n    if <(level) = [13]> then\n        show\n        point in direction (120)\n        go to x: (-83) y: (118)\n        create clone of (bullets v)\n        wait (1) seconds\n    end\n    if <(level) = [14]> then\n        show\n        point in direction (180)\n        go to x: (0) y: (165)\n        create clone of (bullets v)\n        wait (0.5) seconds\n    end\n    if <(level) = [15]> then\n        show\n        go to x: (-220) y: (0)\n        point in direction (90)\n        create clone of (bullets v)\n        wait (1) seconds\n    end\n    if <(level) = [16]> then\n        show\n        go to x: (194) y: (100)\n        point in direction (-90)\n        create clone of (bullets v)\n        wait (2) seconds\n    end\nend\n\n\n\nset [level v] to [12]\n\n@bullets\n\nwhen I start as a clone\ngo to (cannon v)\npoint in direction ([direction v] of [cannon v])\nshow\nmove (30) steps\nrepeat until <<touching (_edge_ v)?> or <touching (ground v)?>>\n    move (10) steps\nend\ndelete this clone\n\nwhen flag clicked\nhide\n\nset [level v] to [11]\n\n