World　Platformer
@Stage\n\nwhen flag clicked\nbroadcast (Intro v)\nbroadcast (Restart player stats v)\n\nwhen flag clicked\nset [timer v] to [0]\nforever\n    set [frametime v] to (timer)\n    change [timer v] by (FrameTime)\n    insert (FrameTime) at (1) of [fps.mem v] \n    delete (6) of [fps.mem v]\n    reset timer\n    Calculate movmulti\nend\n\nwhen flag clicked\nforever\n    list.update "keys"\nend\n\ndefine list.update "keys"\ndelete all of [keys v]\nadd <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <key (space v) pressed?>> to [keys v]\nadd <<key (a v) pressed?> or <key (left arrow v) pressed?>> to [keys v]\nadd <<key (s v) pressed?> or <key (down arrow v) pressed?>> to [keys v]\nadd <<key (d v) pressed?> or <key (right arrow v) pressed?>> to [keys v]\n\nwhen I receive [intro v]\nswitch backdrop to (backdrop1 v)\nset [brightness v] effect to (-10)\n\nwhen I receive [startgame v]\nset [pause v] to [0]\nswitch backdrop to (backdrop2 v)\nset [brightness v] effect to (0)\n\nwhen I receive [start story v]\nset [brightness v] effect to (-100)\n\nwhen I receive [intro v]\nstop all sounds\nclear sound effects\nset [stage v] to [1]\nset [volume v] to [100]\nset [volumetarget v] to [100]\nrepeat until <not <(Stage) = [1]>>\n    play sound [Undertale OST 002 - Start Menu v] until done\nend\n\nwhen I receive [song.intro v]\nset [stage v] to [2]\nset [volume v] to [100]\nset [volumetarget v] to [0]\n\nwhen I receive [start story v]\nset [volume v] to [100]\nset [volumetarget v] to [100]\nrepeat until <(Stage) = [3]>\n    play sound [Undertale OST 001 - Once Upon A Time v] until done\nend\n\nwhen I receive [startgame v]\nset [current song v] to [1]\nstop all sounds\nset [volume v] to [0]\nset [stage v] to [3]\nset [volumetarget v] to [100]\nrepeat until <(Stage) = [4]>\n    play sound (Current song) until done\nend\n\ndefine Calculate movmulti\nset [stage: i v] to [1]\nset [movement multiplier v] to [0]\nrepeat (length of [fps.mem v])\n    change [movement multiplier v] by (item (stage: i) of [fps.mem v])\n    change [stage: i v] by (1)\nend\nset [movement multiplier v] to ((round (((Movement multiplier) / (length of [fps.mem v])) * (1000))) / (1000))\nset [movement multiplier v] to ((Movement multiplier) * (30))\n\nwhen I receive [startgame v]\nforever\n    broadcast (Update visuals v)\nend\n\nwhen I receive [restart player stats v]\nReset talker stages\n\ndefine Reset talker stages\ndelete all of [talkers.talkingstage v]\nrepeat (10)\n    add [1] to [talkers.talkingstage v]\nend\n\nwhen [r v] key pressed\nif <(username) = [coltroc]> then\n    broadcast (Show thumbnail v)\nend\n\nwhen flag clicked\nforever\n    change [volume v] by (((VolumeTarget) - (Volume)) / (10))\n    set volume to ((Volume) * (0.6)) %\nend\n\nwhen I receive [death v]\nset [volumetarget v] to [0]\n\nwhen I receive [respawn v]\nif <(Checkpoint.x) = [-100]> then\n    set [volume v] to [100]\n    set [volumetarget v] to [100]\n    set [current song v] to [1]\nend\nstop all sounds\nif <<(Player.x) > [1680]> and <(BossBattle?) = [0]>> then\n    set [volumetarget v] to [100]\n    set [current song v] to [3]\nend\n\nwhen I receive [walk outside v]\nset [volumetarget v] to [0]\nwait (0.5) seconds\nset [volumetarget v] to [100]\nif <not <(Current song) = [2]>> then\n    stop all sounds\nend\nset [current song v] to [2]\n\nwhen I receive [walk inside v]\nwait (0.5) seconds\nset [volumetarget v] to [100]\nif <not <(Current song) = [1]>> then\n    stop all sounds\nend\nset [current song v] to [1]\n\nwhen I receive [sound.dooropen v]\nset [volumetarget v] to [50]\n\nwhen I receive [close gate v]\nset [volumetarget v] to [0]\nwait (0.5) seconds\nif <not <(Current song) = [3]>> then\n    stop all sounds\nend\nset [current song v] to [3]\nset [volumetarget v] to [100]\n\nwhen I receive [start boss battle v]\nset [volume v] to [100]\nset [volumetarget v] to [100]\nset [current song v] to [4]\nstop all sounds\n\nwhen I receive [start boss gate closing v]\nset [volume v] to [100]\nset [volumetarget v] to [100]\nset [current song v] to [5]\n\nwhen [b v] key pressed\nif <(username) = [coltroc]> then\n    set [player.x v] to [7320]\nend\n\nwhen I receive [clicked boss button v]\nset [volume v] to [100]\nset [volumetarget v] to [100]\nset [current song v] to [6]\nstop all sounds\n\nwhen I receive [end v]\nset [volume v] to [100]\nset [volumetarget v] to [100]\nset [current song v] to [7]\nstop all sounds\n\n@Castle gate\n\nwhen I receive [update visuals v]\nif <(pause) = [0]> then\n    go to [back v] layer\n    set size to (100000) %\n    set [x v] to ((33.69) * (item (4) of [world.info v]))\n    go to x: ((x) - (Cam.x)) y: ((y) - (Cam.y))\n    set size to (600) %\n    set [brightness v] effect to (10)\nend\n\nwhen flag clicked\nset [gate closed? v] to [0]\nhide\n\nwhen I receive [startgame v]\nshow\n\nwhen I receive [close gate v]\nset [checkpoint.x v] to [1700]\nset [checkpoint.y v] to [0]\nset [gate closed? v] to [1]\nrepeat (10)\n    change [y v] by (((item (4) of [world.info v]) * (3)) / (-10))\nend\n\nwhen I receive [startgame v]\nset [y v] to ((2.75) * (item (4) of [world.info v]))\nwait (5) seconds\nwait until <(Player.x) > [1680]>\nbroadcast (Close gate v)\n\n@Skeletons\n\n@Blocks\n\ndefine Get block pos id: (id)\ndelete all of [variables v]\nadd ([floor v] of (((id) - (1)) / (item (1) of [world.info v])) ) to [variables v]\nadd (((id) - (1)) - ((item (1) of [world.info v]) * ([floor v] of (((id) - (1)) / (item (1) of [world.info v])) ))) to [variables v]\n\nwhen I receive [startgame v]\nif <(clone) = [0]> then\n    Create block clones\nend\n\nwhen flag clicked\nset [editing v] to [0]\nset [clone v] to [0]\nList.reset "world.info"\nforever\n    hide\n    hide variable [selected block v]\n    if <(username) = [coltroc]> then\n        if <(Editing) = [1]> then\n            show\n            set [pause v] to [0]\n        end\n    else\n        set [editing v] to [0]\n    end\nend\n\ndefine Create block clones\nreplace item (1) of [block.xygrid v] with [0]\nset [b.costume v] to [1]\nset [id v] to [1]\nrepeat (item (2) of [world.info v])\n    replace item (2) of [block.xygrid v] with [0]\n    repeat (item (3) of [world.info v])\n        create clone of (_myself_ v)\n        change [id v] by (1)\n        replace item (2) of [block.xygrid v] with ((item (2) of [block.xygrid v]) + (1))\n    end\n    replace item (1) of [block.xygrid v] with ((item (1) of [block.xygrid v]) + (1))\nend\n\nwhen I start as a clone\nset [clone v] to [1]\n\ndefine List.reset "world.info"\ndelete all of [world.info v]\nadd [30] to [world.info v]\nadd (([ceiling v] of (10) ) + (1)) to [world.info v]\nadd (([ceiling v] of (7.5) ) + (1)) to [world.info v]\nadd [48] to [world.info v]\n\nwhen I start as a clone\nforever\n    show\n    go to [back v] layer\n    go [forward v] (id) layers\nend\n\ndefine Get block id x: (x) y: (y)\ndelete all of [variables v]\nadd ((1) + (((x) * (item (1) of [world.info v])) + (y))) to [variables v]\n\ndefine Get block positions with camxy\ndelete all of [block.xy v]\nadd ((item (1) of [block.xygrid v]) + ([floor v] of ((Cam.x) / (item (4) of [world.info v])) )) to [block.xy v]\nadd ((item (2) of [block.xygrid v]) + ([floor v] of ((Cam.y) / (item (4) of [world.info v])) )) to [block.xy v]\n\nwhen [e v] key pressed\nif <(clone) = [0]> then\n    if <(username) = [coltroc]> then\n        if <(Editing) = [1]> then\n            set [editing v] to [0]\n        else\n            set [editing v] to [1]\n        end\n    end\nend\n\ndefine Get visual block pos x: (x) y: (y)\ndelete all of [variables v]\nadd (((item (4) of [world.info v]) * ((1) + ((x) - ((item (2) of [world.info v]) / (2))))) - (Cam.x)) to [variables v]\nadd (((item (4) of [world.info v]) * ((1.75) + ((y) - ([ceiling v] of ((item (3) of [world.info v]) / (2)) )))) - (Cam.y)) to [variables v]\n\nwhen I receive [update visuals v]\nchange [b.costume v] by (0.5)\nif <(b.costume) > [16]> then\n    set [b.costume v] to [1]\nend\nif <(clone) = [0]> then\n    set [checkpointtouching v] to [0]\nend\nif <(pause) = [0]> then\n    if <(clone) = [0]> then\n        hide\n        if <(Editing) = [1]> then\n            switch costume to (editor v)\n            set [mouse.x v] to (((mouse x) + (240)) + (Cam.x))\n            if <(mouse x) = [240]> then\n                change [mouse.x v] by (-1)\n            end\n            set [mouse.y v] to (((mouse y) + (180)) + (Cam.y))\n            if <(mouse y) = [180]> then\n                change [mouse.y v] by (-1)\n            end\n            Get block id x: ([floor v] of ((mouse.x) / (item (4) of [world.info v])) ) y: ([floor v] of ((mouse.y) / (item (4) of [world.info v])) )\n            if <mouse down?> then\n                replace item (item (1) of [variables v]) of [blocks.current.type v] with (Selected block)\n            end\n            Get block pos id: (item (1) of [variables v])\n            Get visual block pos x: (item (1) of [variables v]) y: (item (2) of [variables v])\n            set size to (100000) %\n            go to x: (item (1) of [variables v]) y: (item (2) of [variables v])\n            set size to (600) %\n            show\n            show variable [selected block v]\n        end\n    else\n        Get block positions with camxy\n        Get block id x: (item (1) of [block.xy v]) y: (item (2) of [block.xy v])\n        switch costume to (join [block] (item (item (1) of [variables v]) of [blocks.current.type v]))\n        set [b.id v] to (item (1) of [variables v])\n        set size to (10000000) %\n        Get visual block pos x: (item (1) of [block.xy v]) y: (item (2) of [block.xy v])\n        go to x: (item (1) of [variables v]) y: (item (2) of [variables v])\n        if <(item (b.id) of [blocks.current.type v]) = [6]> then\n            if <<([abs v] of ((item (2) of [variables v]) - ((Player.y) - (Cam.y))) ) < [200]> and <([abs v] of (((item (1) of [variables v]) + (30)) - ((Player.x) - (Cam.x))) ) < [140]>> then\n                switch costume to (block6.1 v)\n            end\n            if <not <<<([abs v] of ((item (2) of [variables v]) - ((Player.y) - (Cam.y))) ) < [200]> and <([abs v] of (((item (1) of [variables v]) + (30)) - ((Player.x) - (Cam.x))) ) < [140]>> = <<([abs v] of ((item (2) of [variables v]) - ((Player.y) - (Cam.y))) ) < [200]> and <([abs v] of (((item (1) of [variables v]) + (30)) - (((Player.x) - (Player.xv)) - (Cam.x))) ) < [140]>>>> then\n                if <<([abs v] of ((item (2) of [variables v]) - ((Player.y) - (Cam.y))) ) < [200]> and <([abs v] of (((item (1) of [variables v]) + (30)) - ((Player.x) - (Cam.x))) ) < [140]>> then\n                    broadcast (Sound.DoorOpen v)\n                else\n                    broadcast (Sound.DoorClose v)\n                    if <((Player.x) - (Cam.x)) > (item (1) of [variables v])> then\n                        broadcast (Walk outside v)\n                    else\n                        broadcast (Walk inside v)\n                    end\n                end\n            end\n        end\n        if <(item (b.id) of [blocks.current.type v]) = [11]> then\n            if <not <(Checkpoint.x) < ((item (1) of [variables v]) + (Cam.x))>> then\n                switch costume to (block11.1 v)\n            else\n                if <<([abs v] of ((item (2) of [variables v]) - ((Player.y) - (Cam.y))) ) < [55]> and <([abs v] of (((item (1) of [variables v]) + (0)) - ((Player.x) - (Cam.x))) ) < [55]>> then\n                    set [checkpointtouching.x v] to ((item (1) of [variables v]) + (Cam.x))\n                    set [checkpointtouching.y v] to ((item (2) of [variables v]) + (Cam.y))\n                    set [checkpointtouching v] to [1]\n                end\n            end\n        end\n        if <(item (b.id) of [blocks.current.type v]) = [16]> then\n            switch costume to (join [block16.] (round (b.costume)))\n            set size to (500) %\n            if <touching (player v)?> then\n                broadcast (Death v)\n            end\n        end\n        if <(item (b.id) of [blocks.current.type v]) = [17]> then\n            set size to (475) %\n            if <touching (player v)?> then\n                broadcast (Death v)\n            end\n        end\n        if <(item (b.id) of [blocks.current.type v]) = [18]> then\n            set size to (550) %\n            if <touching (player v)?> then\n                broadcast (Death v)\n            end\n        end\n        set size to (600) %\n    end\nend\n\n@Bossgate\n\nwhen I receive [update visuals v]\nif <(pause) = [0]> then\n    go to [front v] layer\n    go [backward v] (100) layers\n    switch costume to (costume2 v)\n    set size to (100000) %\n    set [x v] to ((156.71) * (item (4) of [world.info v]))\n    go to x: ((x) - (Cam.x)) y: ((y) - (Cam.y))\n    switch costume to (costume1 v)\n    set size to (600) %\n    set [brightness v] effect to (-20)\nend\n\nwhen I receive [respawn v]\nset [y v] to (((-1.25) + ((20) * (0.375))) * (item (4) of [world.info v]))\nif <(Boss beaten) = [0]> then\n    set [bossgateclosed v] to [0]\nend\nshow\n\nwhen flag clicked\nset [boss beaten v] to [0]\nhide\n\nwhen I receive [close boss gate v]\nset [bossgateclosed v] to [1]\nrepeat (20)\n    change [y v] by ((-0.375) * (item (4) of [world.info v]))\nend\nset [y v] to ((-1.25) * (item (4) of [world.info v]))\n\n@Camera Controller\n\nwhen I receive [startgame v]\nset [cam.x v] to [0]\nset [cam.y v] to [0]\nforever\n    if <(pause) = [0]> then\n        if <(Editing) = [1]> then\n            repeat until <(Editing) = [0]>\n                if <(pause) = [0]> then\n                    Camera movement update\n                end\n            end\n        else\n            set [cam.x v] to (Player.x)\n            set [cam.y v] to (Player.y)\n            repeat until <(Editing) = [1]>\n                if <(pause) = [0]> then\n                    change [cam.x v] by (((Player.x) - (Cam.x)) / (4))\n                    change [cam.y v] by (((Player.y) - (Cam.y)) / (4))\n                    if <(Cam.x) < [0]> then\n                        set [cam.x v] to [0]\n                    end\n                    if <<(BossGateClosed) = [1]> and <(Cam.x) < (((156.71) * (item (4) of [world.info v])) + (224))>> then\n                        set [cam.x v] to (((156.71) * (item (4) of [world.info v])) + (224))\n                    end\n                    if <(Cam.y) < [0]> then\n                        set [cam.y v] to [0]\n                    end\n                    if <(Cam.y) > [1080]> then\n                        set [cam.y v] to [1080]\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Camera movement update\nif (item (1) of [keys v]) then\n    change [cam.y v] by (10)\nend\nif (item (2) of [keys v]) then\n    change [cam.x v] by (-10)\nend\nif (item (3) of [keys v]) then\n    change [cam.y v] by (-10)\nend\nif (item (4) of [keys v]) then\n    change [cam.x v] by (10)\nend\nif <(Cam.x) < [0]> then\n    set [cam.x v] to [0]\nend\nif <(Cam.y) < [0]> then\n    set [cam.y v] to [0]\nend\nif <(Cam.y) > [1080]> then\n    set [cam.y v] to [1080]\nend\n\n@Old cube\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\nwhen I receive [update visuals v]\nif <(pause) = [0]> then\n    set size to (100000) %\n    set [x v] to ((30) * (item (4) of [world.info v]))\n    set [y v] to ((-0.25) * (item (4) of [world.info v]))\n    go to x: ((x) - (Cam.x)) y: ((y) - (Cam.y))\n    set size to (600) %\n    switch costume to <(Player.x) > (x)>\n    replace item (2) of [talkers.touching v] with <<([abs v] of ((Player.x) - (x)) ) < [80]> and <([abs v] of ((Player.y) - (y)) ) < [80]>>\nend\n\nwhen I receive [startgame v]\nshow\n\n@Castle guy\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\nwhen I receive [update visuals v]\nif <(pause) = [0]> then\n    set size to (100000) %\n    set [x v] to ((83) * (item (4) of [world.info v]))\n    set [y v] to ((-0.25) * (item (4) of [world.info v]))\n    go to x: ((x) - (Cam.x)) y: ((y) - (Cam.y))\n    set size to (600) %\n    switch costume to <(Player.x) > (x)>\n    replace item (3) of [talkers.touching v] with <<([abs v] of ((Player.x) - (x)) ) < [80]> and <([abs v] of ((Player.y) - (y)) ) < [80]>>\nend\n\nwhen I receive [startgame v]\nshow\n\n@Mom cube\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\nwhen I receive [update visuals v]\nif <(pause) = [0]> then\n    set size to (100000) %\n    set [x v] to ((1) * (item (4) of [world.info v]))\n    set [y v] to ((-0.25) * (item (4) of [world.info v]))\n    go to x: ((x) - (Cam.x)) y: ((y) - (Cam.y))\n    set size to (600) %\n    switch costume to <(Player.x) > ((1) * (item (4) of [world.info v]))>\n    replace item (1) of [talkers.touching v] with <<([abs v] of ((Player.x) - (x)) ) < [80]> and <([abs v] of ((Player.y) - (y)) ) < [80]>>\nend\n\nwhen I receive [startgame v]\nshow\n\n@Boss Cube\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\nwhen I receive [update visuals v]\nif <(pause) = [0]> then\n    if <(Boss beaten) = [0]> then\n        set size to (100000) %\n        if <(BossBattle?) = [1]> then\n            change [yv v] by (-0.5)\n            change [y v] by (yv)\n            if <(y) < ((-1.25) * (item (4) of [world.info v]))> then\n                set [y v] to ((-1.25) * (item (4) of [world.info v]))\n                set [yv v] to [0]\n            end\n        end\n        go to x: ((x) - (Cam.x)) y: ((y) - (Cam.y))\n        set size to (600) %\n    end\nend\n\nwhen I receive [startgame v]\nshow\n\nwhen I receive [start boss battle v]\nset [bossbattle? v] to [1]\nset [player movement? v] to [0]\nbroadcast (Close Boss Gate v)\n\nwhen I receive [respawn v]\nshow\nreplace item (4) of [talkers.talkingstage v] with [1]\nswitch costume to ( v)\nset [boss stage v] to [1]\nreplace item (4) of [talkers.touching v] with [false]\nset [bossbattle? v] to [0]\nset [y v] to ((-1.25) * (item (4) of [world.info v]))\nset [x v] to ((170) * (item (4) of [world.info v]))\nwait (1) seconds\nwait until <(Player.x) > (((156.71) * (item (4) of [world.info v])) + (224))>\nbroadcast (Start boss battle v)\n\nwhen I receive [start boss walk v]\nrepeat (150)\n    change [x v] by (-2)\n    if <(pause) = [1]> then\n        wait until <(pause) = [0]>\n    end\nend\nwait (1) seconds\nbroadcast (Start boss talking v)\nreplace item (4) of [talkers.touching v] with [true]\nset [player movement? v] to [1]\n\nwhen I receive [start boss gate closing v]\nbroadcast (Sound.Boss short walk v)\nrepeat (50)\n    change [x v] by (2)\n    if <(pause) = [1]> then\n        wait until <(pause) = [0]>\n    end\nend\nwait (0.2) seconds\nbroadcast (Flash v)\n\ndefine Create fire ball dir: (dir)\nif <<<(Talking) = [0]> and <<(pause) = [0]> and <(Player movement?) = [1]>>> and <<(BossGateClosed) = [1]> and <(BossBattle?) = [1]>>> then\n    set [fb.dir v] to (dir)\n    broadcast (Create fire ball v)\nend\n\nset [player.x v] to [7320]\n\ndefine Time to fire stage: (stage)\nif <(stage) = [3]> then\n    set [boss stage v] to [1]\n    set [yv v] to [15]\nelse\n    if <(stage) = [1]> then\n        point towards (player v)\n        Create fire ball dir: (direction)\n        point in direction (90)\n    else\n        set [i v] to (pick random (2) to (4))\n        repeat until <<<(i) = [0]> or <(Dead) = [1]>> or <(BossGateClosed) = [0]>>\n            point towards (player v)\n            Create fire ball dir: (direction)\n            point in direction (90)\n            wait (2) seconds\n            change [boss stage timer v] by (2)\n            change [i v] by (-1)\n        end\n    end\nend\nchange [boss stage v] by (1)\n\nwhen I receive [start boss gate closing v]\nset [boss stage v] to [1]\nset [boss stage timer v] to [5]\nrepeat until <<(Dead) = [1]> or <(Boss beaten) = [1]>>\n    if <<(Talking) = [0]> and <<(pause) = [0]> and <(Player movement?) = [1]>>> then\n        change [boss stage timer v] by (() - (FrameTime))\n        if <not <(Boss stage timer) > [0]>> then\n            Time to fire stage: (Boss stage)\n            set [boss stage timer v] to [3]\n        end\n    end\nend\n\nwhen I receive [start boss explosion v]\nrepeat (12)\n    set size to (60) %\n    next costume\nend\nhide\nset [pause v] to [0]\nset [player movement? v] to [1]\n\n@Fire ball\n\nwhen flag clicked\nset [clone v] to [0]\nforever\n    point towards (mouse-pointer v)\n    move (10) steps\nend\n\nwhen I receive [create fire ball v]\nif <<(clone) = [0]> and <(Boss beaten) = [0]>> then\n    go to x: (0) y: (0)\n    point in direction (FB.dir)\n    move (7) steps\n    set [xv v] to (x position)\n    set [yv v] to (y position)\n    create clone of (_myself_ v)\n    set [x v] to (([x v] of [boss cube v]) + ((xv) * (0.75)))\n    set [y v] to (([y v] of [boss cube v]) + ((yv) * (0.75)))\nend\n\nwhen I start as a clone\nset [clone v] to [1]\ngo to [front v] layer\ngo [backward v] (20) layers\nrepeat (400)\n    go [forward v] (1) layers\nend\ndelete this clone\n\nwhen I start as a clone\nforever\n    wait (0.1) seconds\n    next costume\nend\n\nwhen I receive [update visuals v]\nif <<(clone) = [1]> and <(pause) = [0]>> then\n    set size to (10000000000) %\n    show\n    change [x v] by (xv)\n    change [y v] by (yv)\n    go to x: ((x) - (Cam.x)) y: ((y) - (Cam.y))\n    if <(distance to [player v]) < [20]> then\n        broadcast (Death v)\n        delete this clone\n    end\n    if <(Boss beaten) = [1]> then\n        delete this clone\n    end\n    set size to (400) %\nend\n\nwhen I receive [respawn v]\ndelete this clone\n\nwhen I receive [clicked boss button v]\ndelete this clone\n\n@Button\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\nwhen I receive [startgame v]\nshow\n\nwhen I receive [update visuals v]\nif <(pause) = [0]> then\n    set size to (100000) %\n    set [x v] to ((169.5) * (item (4) of [world.info v]))\n    set [y v] to ((-1.25) * (item (4) of [world.info v]))\n    go to x: ((x) - (Cam.x)) y: ((y) - (Cam.y))\n    set size to (600) %\n    if <<touching (player v)?> and <not <(costume [number v]) = [2]>>> then\n        broadcast (Clicked boss button v)\n        broadcast (Sound.Button click v)\n        switch costume to (costume2 v)\n        set [boss beaten v] to [1]\n        set [pause v] to [1]\n    end\nend\n\nwhen I receive [respawn v]\nswitch costume to (costume1 v)\n\n@Player\n\nwhen I receive [startgame v]\nset [cam.x v] to [0]\nset [cam.y v] to [0]\nset [bossgateclosed v] to [0]\nset [gate closed? v] to [0]\nbroadcast (Respawn v)\nforever\n    set [coll.lava v] to [0]\n    hide\n    if <(Editing) = [0]> then\n        show\n        if <(pause) = [0]> then\n            if <(Player movement?) = [1]> then\n                if (item (4) of [keys v]) then\n                    switch costume to (r v)\n                    change [player.xv v] by (3.5)\n                end\n                if (item (2) of [keys v]) then\n                    switch costume to (l v)\n                    change [player.xv v] by (-3.5)\n                end\n            end\n            set [player.xv v] to ((Player.xv) * (0.7))\n            change [player.x v] by (Player.xv)\n            if <<(Player.x) < ((157.45) * (item (4) of [world.info v]))> and <(BossGateClosed) = [1]>> then\n                set [player.x v] to ((157.45) * (item (4) of [world.info v]))\n                set [player.xv v] to [0]\n            else\n                if <<(Player.x) < ((34.5) * (item (4) of [world.info v]))> and <(Gate closed?) = [1]>> then\n                    set [player.x v] to ((34.5) * (item (4) of [world.info v]))\n                    set [player.xv v] to [0]\n                else\n                    if <(Player.x) < ((-240) + ((Player.size.width) / (2)))> then\n                        set [player.x v] to ((-240) + ((Player.size.width) / (2)))\n                        set [player.xv v] to [0]\n                    else\n                        Collision\n                        if <(collision) = [1]> then\n                            set [player.x v] to ((coll.x) + ((((item (4) of [world.info v]) + (Player.size.width)) / (2)) * (() - ((Player.xv) / ([abs v] of (Player.xv) )))))\n                            set [player.xv v] to [0]\n                        end\n                    end\n                end\n            end\n            change [player.yv v] by (-1.4)\n            if <(Player.yv) < [-24]> then\n                set [player.yv v] to [-24]\n            end\n            change [player.y v] by (Player.yv)\n            Collision\n            if <(collision) = [1]> then\n                set [player.y v] to ((coll.y) + ((((item (4) of [world.info v]) + (Player.size.height)) / (2)) * (() - ((Player.yv) / ([abs v] of (Player.yv) )))))\n                if <(Player.yv) < [0]> then\n                    set [player.yv v] to [0]\n                    if <(Player movement?) = [1]> then\n                        if (item (1) of [keys v]) then\n                            set [player.yv v] to [18]\n                        end\n                    end\n                else\n                    set [player.yv v] to [0]\n                end\n            end\n        end\n    end\n    if <(Dead) = [1]> then\n        hide\n    end\n    if <(coll.lava) = [1]> then\nend\n\nwhen I receive [respawn v]\nswitch costume to (r v)\nset [player.x v] to (Checkpoint.x)\nset [player.y v] to (Checkpoint.y)\nset [cam.x v] to (Checkpoint.x)\nset [cam.y v] to (Checkpoint.y)\nset [player.xv v] to [0]\nset [player.yv v] to [0]\nset [player.size.height v] to [42]\nset [player.size.width v] to [42]\n\nwhen I receive [update visuals v]\nif <(pause) = [0]> then\n    set size to (10000) %\n    go to x: ((Player.x) - (Cam.x)) y: ((Player.y) - (Cam.y))\n    set size to (600) %\nend\n\ndefine Collision\nset [collision v] to [0]\nblock coll x: [-1] y: [-1]\nblock coll x: [0] y: [-1]\nblock coll x: [1] y: [-1]\nblock coll x: [-1] y: [0]\nblock coll x: [0] y: [0]\nblock coll x: [1] y: [0]\nblock coll x: [-1] y: [1]\nblock coll x: [0] y: [1]\nblock coll x: [1] y: [1]\n\ndefine block coll x: (x) y: (y)\nGet block id x: ((x) + (round (((Player.x) / (item (4) of [world.info v])) + (4.5)))) y: ((y) + (round (((Player.y) / (item (4) of [world.info v])) + (3))))\nset [i v] to (item (1) of [variables v])\nGet block pos id: (item (1) of [variables v])\nGet visual block pos x: (item (1) of [variables v]) y: (item (2) of [variables v])\nif <(item (i) of [blocks.current.type v]) > [0]> then\n    if <([abs v] of ((Player.x) - (item (1) of [variables v])) ) < (((item (4) of [world.info v]) + (Player.size.width)) / (2))> then\n        if <([abs v] of ((Player.y) - (item (2) of [variables v])) ) < (((item (4) of [world.info v]) + (Player.size.height)) / (2))> then\n            if <(item (item (i) of [blocks.current.type v]) of [blocks.type.hitbox v]) = [1]> then\n                set [coll.x v] to (item (1) of [variables v])\n                set [coll.y v] to (item (2) of [variables v])\n                set [collision v] to [1]\n            end\n            if <<(item (item (i) of [blocks.current.type v]) of [blocks.type.hitbox v]) = [2]> and <([abs v] of ((Player.y) - (item (2) of [variables v])) ) < ((((item (4) of [world.info v]) + (Player.size.height)) / (2)) - (5))>> then\n                set [coll.lava v] to [1]\n            end\n        end\n    end\nend\n\ndefine Get block id x: (x) y: (y)\ndelete all of [variables v]\nadd ((1) + (((x) * (item (1) of [world.info v])) + (y))) to [variables v]\n\ndefine Get block pos id: (id)\ndelete all of [variables v]\nadd ([floor v] of (((id) - (1)) / (item (1) of [world.info v])) ) to [variables v]\nadd (((id) - (1)) - ((item (1) of [world.info v]) * ([floor v] of (((id) - (1)) / (item (1) of [world.info v])) ))) to [variables v]\n\ndefine Get block id x: (x) y: (y)\ndelete all of [variables v]\nadd ((1) + (((x) * (item (1) of [world.info v])) + (y))) to [variables v]\n\ndefine Get visual block pos x: (x) y: (y)\ndelete all of [variables v]\nadd ((item (4) of [world.info v]) * ((1) + ((x) - ((item (2) of [world.info v]) / (2))))) to [variables v]\nadd ((item (4) of [world.info v]) * ((1.75) + ((y) - ([ceiling v] of ((item (3) of [world.info v]) / (2)) )))) to [variables v]\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\nwhen I receive [restart player stats v]\nset [checkpoint.x v] to [-100]\nset [checkpoint.y v] to [0]\n\nwhen I receive [close gate v]\nset [player movement? v] to [0]\n\nwhen I receive [respawn v]\nif <(BossBattle?) = [1]> then\n    set [bossgateclosed v] to [0]\n    set [player movement? v] to [1]\n    set [player.x v] to (Checkpoint.x)\n    set [player.y v] to (Checkpoint.y)\n    set [cam.x v] to (Checkpoint.x)\n    set [cam.y v] to (Checkpoint.y)\n    set [player.xv v] to [0]\n    set [player.yv v] to [0]\nend\n\nwhen I receive [respawn v]\nset [player movement? v] to [1]\nwait (0.5) seconds\nset [player movement? v] to [1]\nrepeat until <(Dead) = [1]>\n    if <(Dead) = [0]> then\n        if <<touching (boss cube v)?> and <(Boss beaten) = [0]>> then\n            broadcast (Death v)\n        end\n    end\nend\n\nwhen I receive [start boss battle v]\nset [player.x v] to (((156.71) * (item (4) of [world.info v])) + (224))\n\n@Shader\n\nwhen flag clicked\nclear graphic effects\nforever\n    go to x: (0) y: (0)\n    go to [front v] layer\n    set [ghost v] effect to (50)\n    hide\n    if <(Gate closed?) = [1]> then\n        show\n    end\nend\n\nwhen I receive [update visuals v]\ngo to [front v] layer\ngo [backward v] (1) layers\n\nwhen I receive [flash v]\nset [brightness v] effect to (100)\nrepeat (20)\n    change [brightness v] effect by (-5)\nend\n\n@checkpoint text\n\nwhen flag clicked\nhide\n\nwhen I receive [startgame v]\nforever\n    go to x: (0) y: (-100)\n    switch costume to (c8977b6d69a14a4d84dcfc652f6417ba v)\n    set size to (70) %\n    if <(CheckpointTouching) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen [z v] key pressed\nif <(CheckpointTouching) = [1]> then\n    broadcast (Activate checkpoint v)\n    set [checkpoint.x v] to (checkpointTouching.x)\n    set [checkpoint.y v] to (checkpointTouching.y)\nend\n\n@Intro\n\nwhen I receive [intro v]\nshow\nswitch costume to (332a66b8ffad046792b9332202938b02 v)\ncreate clone of (_myself_ v)\nswitch costume to (fade v)\ncreate clone of (_myself_ v)\nswitch costume to (costume1 v)\n\nwhen flag clicked\nhide\nforever\n    switch costume to (costume1 v)\n    set size to (50) %\n    go to x: (0) y: (([sin v] of ((timer) * (100)) ) * (4))\nend\n\nwhen [any v] key pressed\nif <(ting) = [0]> then\n    set [ting v] to [1]\n    broadcast (Song.intro v)\n    repeat (25)\n        change [ghost v] effect by (-4)\n    end\n    wait (pick random (1.5) to (2)) seconds\n    broadcast (StartGame v) and wait\nend\n\nwhen I start as a clone\nset [ting v] to [0]\nset [ghost v] effect to (100)\nforever\n    if <(costume [number v]) = [3]> then\n        set size to (100) %\n        go to [front v] layer\n        go to x: (0) y: (0)\n    else\n        set size to (50) %\n        set [ghost v] effect to (0)\n        go to x: (0) y: (-100)\n    end\nend\n\nwhen I receive [startgame v]\nif <(costume [number v]) = [3]> then\n    repeat (20)\n        change [ghost v] effect by (5)\n        set [cam.x v] to [0]\n        set [cam.y v] to [0]\n    end\n    hide\n    delete this clone\nelse\n    hide\n    delete this clone\nend\n\n@Text box\n\nwhen flag clicked\nset [clone v] to [0]\nhide\nforever\n    if <key (z v) pressed?> then\n        change [keyz.time pressed v] by (FrameTime)\n    else\n        set [keyz.time pressed v] to [0]\n    end\nend\n\nwhen I start as a clone\nset [clone v] to [1]\ngo to [front v] layer\n\nwhen I start as a clone\nif <(letter (((_Ct y) * (26)) + (1)) of (Text)) = [ ]> then\n    change x by (-16)\nend\nrepeat (i)\n    hide\nend\nchange [donetalking v] by (1)\nif <<<<not <(costume [number v]) = [ ]>> and <(pick random (1) to (4)) = [1]>> or <((i) / (3)) = (round ((i) / (3)))>> or <(i) = [1]>> then\n    broadcast (join [Sound.Talker] (TalkingSpeaker))\nend\nshow\nset size to (400) %\nset [brightness v] effect to (100)\nforever\n    go to [front v] layer\nend\n\ndefine Create text: (text)\nif <(clone) = [0]> then\n    broadcast (delete all clones v)\n    Make text fit text: (text)\n    go to x: (-208) y: (-55)\n    set [donetalking v] to [0]\n    set [i v] to [1]\n    set [_ct y v] to [0]\n    repeat (length of (Text))\n        if <<((i) - (1)) > [0]> and <(((i) - (1)) / (26)) = ([floor v] of (((i) - (1)) / (26)) )>> then\n            set x to (-208)\n            change y by (-28)\n            change [_ct y v] by (1)\n        end\n        switch costume to (join [] (letter (i) of (Text)))\n        create clone of (_myself_ v)\n        change x by (16)\n        change [i v] by (1)\n    end\n    switch costume to (text box v)\n    set size to (100) %\n    clear graphic effects\n    go to x: (0) y: (0)\n    go to [front v] layer\nelse\n    delete this clone\nend\n\ndefine Make text fit text: (text)\nset [text v] to (text)\nset [_mtft i v] to [1]\nrepeat (4)\n    if <<not <(letter ((_Mtft i) * (26)) of (Text)) = [ ]>> and <not <(letter (((_Mtft i) * (26)) + (1)) of (Text)) = [ ]>>> then\n        if <<not <(letter ((_Mtft i) * (26)) of (Text)) = []>> and <not <(letter (((_Mtft i) * (26)) + (1)) of (Text)) = []>>> then\n            set [i v] to ((_Mtft i) * (26))\n            set [_spaces to add v] to [0]\n            repeat until <(letter (i) of (Text)) = [ ]>\n                change [_spaces to add v] by (1)\n                change [i v] by (-1)\n            end\n            Find word from letter: [1] to letter: (i) in text: (Text)\n            set [_mtft text v] to (_w)\n            repeat (_spaces to add)\n                set [_mtft text v] to (join (_Mtft text) [ ])\n            end\n            Find word from letter: ((i) + (1)) to letter: (length of (Text)) in text: (Text)\n            set [text v] to (join (_Mtft text) (_w))\n        end\n    end\n    change [_mtft i v] by (1)\nend\n\nwhen I receive [delete all clones v]\ndelete this clone\n\nwhen I receive [startgame v]\nset [talking v] to [0]\n\nwhen I receive [startgame v]\nrepeat (10)\n    hide\nend\nforever\n    if <(Talking) = [1]> then\n        switch costume to (text box v)\n        set size to (100) %\n        clear graphic effects\n        go to x: (0) y: (0)\n        go to [front v] layer\n        show\n    else\n        hide\n        if <[talkers.touching v] contains [true]?> then\n            show\n            switch costume to (press z to talk v)\n            set size to (50) %\n            clear graphic effects\n            go to x: (0) y: (-100)\n            go to [front v] layer\n        end\n    end\nend\n\nwhen [z v] key pressed\nif <(Stage) = [3]> then\n    if <not <(KeyZ.Time pressed) > ((FrameTime) * (3))>> then\n        if <(clone) = [0]> then\n            if <(Talking) = [1]> then\n                if <not <(DoneTalking) < (length of (Text))>> then\n                    change [text.currentstage v] by (1)\n                    Talk person: (item # of [true] in [talkers.touching v])\n                end\n            else\n                if <[talkers.touching v] contains [true]?> then\n                    set [pause v] to [1]\n                    set [talking v] to [1]\n                    set [text.currentstage v] to [1]\n                    Talk person: (item # of [true] in [talkers.touching v])\n                end\n            end\n        end\n    end\nend\n\ndefine Talk person: (person)\nset [talkingspeaker v] to (person)\nif <(person) = [10]> then\n    if <(((Text.currentStage) + ((item # of (join [_] (item (person) of [talkers.talkingstage v])) in [talker0 texts v]) + (1))) - (1)) > ((item # of (join [_] ((item (person) of [talkers.talkingstage v]) + (1))) in [talker0 texts v]) - (1))> then\n        set [talking v] to [0]\n        set [pause v] to [0]\n        if <(item (person) of [talkers.talkingstage v]) = [2]> then\n            broadcast (Start boss walk v)\n        end\n        if <not <(item (person) of [talkers.talkingstage v]) = [2]>> then\n            set [player movement? v] to [1]\n        end\n        if <(item # of (join [_] ((item (person) of [talkers.talkingstage v]) + (2))) in [talker0 texts v]) > [0]> then\n            replace item (person) of [talkers.talkingstage v] with ((1) + (item (person) of [talkers.talkingstage v]))\n        end\n        broadcast (delete all clones v)\n        replace item (10) of [talkers.touching v] with [false]\n    else\n        Create text: (item (((Text.currentStage) + ((item # of (join [_] (item (person) of [talkers.talkingstage v])) in [talker0 texts v]) + (1))) - (1)) of [talker0 texts v])\n    end\nend\nif <(person) = [1]> then\n    if <(((Text.currentStage) + ((item # of (join [_] (item (person) of [talkers.talkingstage v])) in [talker1 texts v]) + (1))) - (1)) > ((item # of (join [_] ((item (person) of [talkers.talkingstage v]) + (1))) in [talker1 texts v]) - (1))> then\n        set [talking v] to [0]\n        set [pause v] to [0]\n        if <(item # of (join [_] ((item (person) of [talkers.talkingstage v]) + (2))) in [talker1 texts v]) > [0]> then\n            replace item (person) of [talkers.talkingstage v] with ((1) + (item (person) of [talkers.talkingstage v]))\n        end\n        broadcast (delete all clones v)\n    else\n        Create text: (item (((Text.currentStage) + ((item # of (join [_] (item (person) of [talkers.talkingstage v])) in [talker1 texts v]) + (1))) - (1)) of [talker1 texts v])\n    end\nend\nif <(person) = [2]> then\n    if <(((Text.currentStage) + ((item # of (join [_] (item (person) of [talkers.talkingstage v])) in [talker2 texts v]) + (1))) - (1)) > ((item # of (join [_] ((item (person) of [talkers.talkingstage v]) + (1))) in [talker2 texts v]) - (1))> then\n        set [talking v] to [0]\n        set [pause v] to [0]\n        if <(item # of (join [_] ((item (person) of [talkers.talkingstage v]) + (2))) in [talker2 texts v]) > [0]> then\n            replace item (person) of [talkers.talkingstage v] with ((1) + (item (person) of [talkers.talkingstage v]))\n        end\n        broadcast (delete all clones v)\n    else\n        Create text: (item (((Text.currentStage) + ((item # of (join [_] (item (person) of [talkers.talkingstage v])) in [talker2 texts v]) + (1))) - (1)) of [talker2 texts v])\n    end\nend\nif <(person) = [3]> then\n    if <(((Text.currentStage) + ((item # of (join [_] (item (person) of [talkers.talkingstage v])) in [talker3 texts v]) + (1))) - (1)) > ((item # of (join [_] ((item (person) of [talkers.talkingstage v]) + (1))) in [talker3 texts v]) - (1))> then\n        set [talking v] to [0]\n        set [pause v] to [0]\n        if <(item # of (join [_] ((item (person) of [talkers.talkingstage v]) + (2))) in [talker3 texts v]) > [0]> then\n            replace item (person) of [talkers.talkingstage v] with ((1) + (item (person) of [talkers.talkingstage v]))\n        end\n        broadcast (delete all clones v)\n    else\n        Create text: (item (((Text.currentStage) + ((item # of (join [_] (item (person) of [talkers.talkingstage v])) in [talker3 texts v]) + (1))) - (1)) of [talker3 texts v])\n    end\nend\nif <(person) = [4]> then\n    if <(((Text.currentStage) + ((item # of (join [_] (item (person) of [talkers.talkingstage v])) in [talker4 texts v]) + (1))) - (1)) > ((item # of (join [_] ((item (person) of [talkers.talkingstage v]) + (1))) in [talker4 texts v]) - (1))> then\n        set [talking v] to [0]\n        set [pause v] to [0]\n        if <(item (person) of [talkers.talkingstage v]) = [1]> then\n            broadcast (Start boss gate closing v)\n        end\n        if <(item (person) of [talkers.talkingstage v]) = [2]> then\n            broadcast (Start boss explosion v)\n        end\n        if <(item # of (join [_] ((item (person) of [talkers.talkingstage v]) + (2))) in [talker4 texts v]) > [0]> then\n            replace item (person) of [talkers.talkingstage v] with ((1) + (item (person) of [talkers.talkingstage v]))\n        end\n        replace item (4) of [talkers.touching v] with [false]\n        broadcast (delete all clones v)\n    else\n        Create text: (item (((Text.currentStage) + ((item # of (join [_] (item (person) of [talkers.talkingstage v])) in [talker4 texts v]) + (1))) - (1)) of [talker4 texts v])\n    end\nend\n\nwhen I receive [restart player stats v]\nreplace item (10) of [talkers.touching v] with [false]\nbroadcast (delete all clones v)\nhide\n\ndefine Find word from letter: (1) to letter: (2) in text: (text)\nset [_fwfl i v] to (1)\nset [_w v] to []\nrepeat (((2) - (1)) + (1))\n    set [_w v] to (join (_w) (letter (_Fwfl i) of (text)))\n    change [_fwfl i v] by (1)\nend\n\nwhen I receive [close gate v]\nwait (2) seconds\nset [talking v] to [1]\nset [text.currentstage v] to [1]\nTalk person: [10]\nreplace item (10) of [talkers.touching v] with [true]\nwait (0.5) seconds\nset [pause v] to [1]\n\nwhen I receive [start boss battle v]\nwait (1) seconds\nset [talking v] to [1]\nset [text.currentstage v] to [1]\nTalk person: [10]\nreplace item (10) of [talkers.touching v] with [true]\n\nwhen I receive [start boss talking v]\nset [pause v] to [1]\nset [talking v] to [1]\nset [text.currentstage v] to [1]\nTalk person: [4]\n\nwhen I receive [update visuals v]\ngo to [front v] layer\n\nwhen I receive [clicked boss button v]\nwait (1) seconds\nset [pause v] to [1]\nset [talking v] to [1]\nset [text.currentstage v] to [1]\nTalk person: [4]\nreplace item (4) of [talkers.touching v] with [true]\n\n@Deathscreen\n\nwhen I receive [death v]\nset [pause v] to [1]\nset [dead v] to [1]\nwait (0.5) seconds\nswitch costume to (costume1 v)\ncreate clone of (_myself_ v)\nnext costume\ncreate clone of (_myself_ v)\nnext costume\ncreate clone of (_myself_ v)\n\nwhen I receive [respawn v]\nset [dead v] to [0]\nset [pause v] to [0]\nset [ghost v] effect to (0)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nset [ghost v] effect to (100)\ndelete this clone\n\nwhen flag clicked\nhide\nforever\n    if <(Player.y) < [-200]> then\n        broadcast (Death v)\n        wait until <not <(Player.y) < [-200]>>\n    end\nend\n\nwhen I start as a clone\nset [ghost v] effect to (100)\nforever\n    show\n    go to [front v] layer\n    if <(costume [number v]) = [1]> then\n        go to x: (0) y: (0)\n    end\n    if <(costume [number v]) = [2]> then\n        go to x: (0) y: ((25) + (([sin v] of ((timer) * (100)) ) * (4)))\n        set size to (85) %\n    end\n    if <(costume [number v]) = [3]> then\n        go to x: (0) y: (-75)\n        set size to (50) %\n    end\nend\n\nwhen I start as a clone\nset [fading v] to [1]\nset [ghost v] effect to (100)\nrepeat (25)\n    change [ghost v] effect by (-4)\nend\nset [ghost v] effect to (0)\nset [fading v] to [0]\n\nwhen [z v] key pressed\nif <<(costume [number v]) = [1]> and <(Fading) = [0]>> then\n    broadcast (Respawn v)\nend\n\n@Sound\n\nwhen I receive [sound.talker1 v]\nstart sound [talker1 v]\n\nwhen I receive [sound.dooropen v]\nstart sound [door.open v]\n\nwhen I receive [sound.doorclose v]\nstart sound [door.close v]\n\nwhen I receive [death v]\nstart sound [Roblox Death Sound - OOF Sound Effect v]\n\nwhen I receive [sound.talker2 v]\nstart sound [talker2 v]\n\nwhen I receive [activate checkpoint v]\nstart sound [Coin v]\n\nwhen I receive [close gate v]\nstart sound [Sound Ideas - Door, Metal, Cell - Close, Jail, Cell, Castle v]\n\nwhen I receive [sound.talker10 v]\nstart sound [talker0 v]\n\nwhen I receive [sound.talker3 v]\nstart sound [talker3 v]\n\nwhen I receive [sound.talker4 v]\nstart sound [talker4 v]\n\nwhen I receive [start boss walk v]\nstart sound [Walking on Metal Sound Effects v]\n\nwhen I receive [sound.boss short walk v]\nstart sound [Walking on Metal Sound Effects2 v]\n\nwhen I receive [close boss gate v]\nstart sound [Sound Ideas - Door, Metal, Cell - Close, Jail, Cell, Castle v]\n\nwhen I receive [sound.button click v]\nstart sound [Suction Cup v]\n\nwhen I receive [start boss explosion v]\nstart sound [EXPLOSION SOUND EFFECT v]\n\n@Controls\n\nwhen flag clicked\nhide\nforever\n    go to x: (0) y: (-75)\nend\n\nwhen I receive [startgame v]\nshow\nwait until <[keys v] contains [true]?>\nhide\n\n@Thumbnail\n\nwhen flag clicked\nhide\n\nwhen I receive [show thumbnail v]\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\n\nwhen I receive [update visuals v]\ngo to [front v] layer\n\n@Home\n\nwhen flag clicked\nset [end v] to [0]\nhide\n\nwhen I receive [startgame v]\nforever\n    hide\n    go to [front v] layer\n    go [backward v] (3) layers\n    if <(Player.x) > [8400]> then\n        show\n    end\nend\n\nwhen [z v] key pressed\nif <<(Player.x) > [8400]> and <(End) = [0]>> then\n    set [end v] to [1]\n    set [pause v] to [1]\n    broadcast (End v)\nend\n\n@End\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    show\n    go to [front v] layer\n    go to x: (0) y: (0)\nend\n\nwhen I receive [end v]\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\n\n@End credits\n\nwhen flag clicked\nset [ghost v] effect to (100)\nhide\nforever\n    go to [front v] layer\n    go to x: (0) y: (0)\nend\n\nwhen I receive [end v]\nshow\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\n\n
up or space, left and right keys to move. s key to swing sword.\n\nlink  https://scratch.mit.edu/projects/953046105