Dungeon | a platformer

Instructions: w,a,s,d or arrow keys to move. Spacebar to jump. Press e to slash your sword. Press q to splash a speed potion (x4 speed for 4 seconds). Have fun, like and fav for more levels.\n\nThat is pretty much all of the instructions of the game. If you have any doubts or suggestions, make sure to tell them to me in the comments. Make sure to follow too!

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop2 v)\n\nwhen I receive [shut down v]\nswitch backdrop to (malfunction screen v)\n\n@Kyoot\n\nwhen flag clicked\nbroadcast (Reset v)\nclear graphic effects\nswitch backdrop to (backdrop1 \(1\) v)\nswitch costume to (normal v)\nshow\ngo to x: (-205.21) y: (-118)\nset size to (50) %\nset [level v] to [1]\nset [x movement v] to [0]\nset [y movement v] to [0]\n\nbroadcast (Reset v) and wait\n\nbroadcast (Next Level v) and wait\n\nwhen I receive [reset v]\nswitch costume to (normal v)\nset [x movement v] to [0]\nset [y movement v] to [0]\ngo to x: (-209) y: (-70)\n\nwhen I receive [next level v]\nbroadcast (Reset v)\n\nwhen I start as a clone\nclear graphic effects\nrepeat (10)\n    change [ghost v] effect by (20)\nend\ndelete this clone\n\ndefine reset\ngo to x: (-209) y: (-70)\n\nwhen I receive [reset v]\nreset\n\nwhen flag clicked\nset volume to (65) %\nplay sound [Alan Walker, AuRa, Tomine Harket - Darkside v] until done\n\nwhen flag clicked\ngo to x: (-209) y: (-70)\nset [level v] to [1]\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        switch costume to (right v)\n        change [x movement v] by (1)\n        broadcast (make sword right v)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        switch costume to (left v)\n        change [x movement v] by (-1)\n    end\n    if <(backdrop [number v]) = [1]> then\n        set [x movement v] to ((X Movement) * (0.9))\n    end\n    change x by (X Movement)\n    if <touching (platform v)?> then\n        if <touching (platform v)?> then\n            change y by (1)\n            if <touching (platform v)?> then\n                change y by (1)\n                if <touching (platform v)?> then\n                    change y by (1)\n                    if <touching (platform v)?> then\n                        change y by (1)\n                        if <touching (platform v)?> then\n                            change y by (1)\n                            if <touching (platform v)?> then\n                                change y by (1)\n                                if <touching (platform v)?> then\n                                    change y by (1)\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    if <touching (platform v)?> then\n        change x by ((X Movement) * (-1))\n        change y by (-4)\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            if <(X Movement) > [0]> then\n                set [x movement v] to [-5]\n            else\n                set [x movement v] to [5]\n            end\n            set [y movement v] to [15]\n        else\n            set [y movement v] to [0]\n        end\n    end\n    change [y movement v] by (-1)\n    change y by (Y Movement)\n    if <touching (platform v)?> then\n        change y by ((Y Movement) * (-1))\n        set [y movement v] to [0]\n    end\n    change y by (-1)\n    if <touching (platform v)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [y movement v] to [15]\n        end\n        if <(x position) > [239]> then\n            broadcast (Next Level v)\n            change [level v] by (1)\n        end\n        if <touching (spikes v)?> then\n            reset\n        end\n    end\n    if <touching (yellow button v)?> then\n        broadcast (yellow open v) and wait\n    end\n    create clone of (_myself_ v)\n    create clone of (_myself_ v)\n    if <touching (falling spikes v)?> then\n        reset\n    end\n    if <(y position) < [-160]> then\n        reset\n    end\n    if <touching (ballsta arrow v)?> then\n        reset\n    end\n    if <touching (ballsta arrow2 v)?> then\n        reset\n    end\n    if <touching (ghost 1 v)?> then\n        reset\n    end\n    if <touching (knight1 v)?> then\n        reset\n    end\n    if <touching (door v)?> then\n        reset\n    end\nend\n\nwhen I receive [make sword right v]\nbroadcast (sword = right v)\n\nwhen flag clicked\nif <not <(username) = [dashingcaca08]>> then\nend\n\nbroadcast (shut down v)\n\nwhen I receive [shut down v]\nhide\n\nwhen I receive [speed x2 v]\nforever\n    set [x movement v] to ((X Movement) * (0.95))\n    wait (4) seconds\n    switch backdrop to (backdrop2 v)\n    stop [this script v]\nend\n\n@Platform\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\ngo to x: (0) y: (30)\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [7]> then\n        broadcast (Ghost 1 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [8]> then\n        broadcast (Ghost 1 end v)\n    end\nend\n\nwhen I receive [next level v]\nif <(costume [number v]) = [11]> then\n    broadcast (Shield activate v)\nend\n\nwhen I receive [shut down v]\nhide\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [12]> then\n        broadcast (Ghost2 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [13]> then\n        broadcast (Ghost2 end v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [19]> then\n        broadcast (knight1 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [20]> then\n        broadcast (knight1 end v)\n    end\nend\n\n@Yellow Button\n\nwhen flag clicked\nswitch costume to (costume1 v)\nshow\n\nwhen I receive [next level v]\nnext costume\nshow\n\nwhen I receive [yellow door is open v]\nhide\n\nwhen I receive [shut down v]\nhide\n\n@Door\n\nwhen flag clicked\nswitch costume to (costume1 v)\nshow\n\nwhen I receive [next level v]\nnext costume\nshow\n\nwhen I receive [yellow open v]\nhide\nbroadcast (yellow door is open v)\n\nwhen I receive [shut down v]\nhide\n\n@Spikes\n\nwhen flag clicked\nshow\nforever\n    if <touching (kyoot v)?> then\n        broadcast (Reset v)\n    end\nend\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [shut down v]\nhide\n\n@Skip Button\n\nwhen flag clicked\ngo to x: (333) y: (-137)\nhide\n\nwhen this sprite clicked\nbroadcast (Next Level v)\n\nwhen I receive [dev mode v]\nwait (0.0000000000000001) seconds\nshow\n\ngo to [front v] layer\n\nwhen I receive [shut down v]\nhide\n\n@Ballsta\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to x: (0) y: (146)\nshow\nforever\n    point towards (kyoot v)\nend\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [shut down v]\nhide\n\n@Ballsta Arrow\n\nwhen flag clicked\nrepeat (10)\n    set size to (50) %\nend\nswitch costume to (costume2 v)\ngo to x: (0) y: (150)\nshow\nforever\n    if <(size) = [50]> then\n        point towards (kyoot v)\n    end\nend\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\nforever\n    wait (0.5) seconds\n    broadcast (Straight Arrow v)\n    glide (1) secs to (kyoot v)\n    go to x: (0) y: (150)\nend\n\npoint in direction (180)\n\nwhen I receive [straight arrow v]\nset size to (49) %\nwait (1) seconds\nset size to (50) %\nstop [this script v]\n\nwhen flag clicked\nforever\n    if <touching (shield v)?> then\n        Arrow Reset\n    end\nend\n\ndefine Arrow Reset\ngo to x: (0) y: (150)\n\nstop [this script v]\n\nwhen I receive [shut down v]\nhide\n\n@Just Cuz\n\nwhen flag clicked\nif <(username) = [dashingcaca08]> then\n    broadcast (Dev mode v)\nend\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\n@ghost 1\n\nwhen flag clicked\nhide\n\nwhen I receive [ghost 1 v]\nshow\n\nwhen flag clicked\ngo to x: (189) y: (-83)\nforever\n    broadcast (Ghost 1 left v)\n    glide (2) secs to x: (-147) y: (-83)\n    broadcast (Ghost 1 right v)\n    glide (2) secs to x: (189) y: (-83)\nend\n\nwhen I receive [ghost 1 left v]\nrepeat (4)\n    switch costume to (ghost left v)\n    wait (0.1) seconds\n    switch costume to (ghost2 left v)\n    wait (0.1) seconds\n    switch costume to (ghost3 left v)\n    wait (0.1) seconds\n    switch costume to (ghost4 left v)\n    wait (0.1) seconds\nend\n\nwhen I receive [ghost 1 right v]\nrepeat (4)\n    switch costume to (ghost right v)\n    wait (0.1) seconds\n    switch costume to (ghost2 right v)\n    wait (0.1) seconds\n    switch costume to (ghost3 right v)\n    wait (0.1) seconds\n    switch costume to (ghost4 right v)\n    wait (0.1) seconds\nend\n\nwhen I receive [ghost 1 end v]\nhide\n\nwhen I receive [shut down v]\nhide\n\nwhen flag clicked\nforever\n    if <touching (sword v)?> then\n        forever\n            hide\n            stop [other scripts in sprite v]\n        end\n    end\nend\n\n@Ballsta2\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\ngo to x: (0) y: (146)\nshow\nforever\n    point towards (kyoot v)\nend\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [shut down v]\nhide\n\nwhen flag clicked\nforever\n    set size to (25) %\nend\n\n@Ballsta Arrow2\n\nwhen flag clicked\nset size to (25) %\nswitch costume to (costume2 v)\ngo to x: (0) y: (150)\nshow\nforever\n    if <(size) = [25]> then\n        point towards (kyoot v)\n    end\nend\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\nforever\n    wait (0.5) seconds\n    broadcast (Straight Arrow v)\n    glide (1) secs to (kyoot v)\n    go to x: (0) y: (150)\n    point in direction (180)\nend\n\nwhen I receive [straight arrow v]\nset size to (24) %\nwait (1) seconds\nset size to (25) %\nstop [this script v]\n\nwhen I receive [shut down v]\nhide\n\n@shield\n\nwhen flag clicked\nhide\n\nwhen I receive [shield activate v]\nhide\n\ndefine Shield Reset\ngo to x: (-285) y: (32)\n\nshow\n\nwhen I receive [shut down v]\nhide\n\nwhen flag clicked\n\nhide\n\ngo to (kyoot v)\nshow\nforever\n    glide (0.0001) secs to (kyoot v)\nend\n\n@sword\n\nwhen flag clicked\nhide\nset size to (80) %\n\nwhen I receive [sword strike v]\n\nwhen flag clicked\nforever\n    if <<key (e v) pressed?> = [true]> then\n        if <(costume [name v]) = [1]> then\n            point in direction (90)\n            show\n            switch costume to (1 v)\n            wait (0.1) seconds\n            switch costume to (2 v)\n            wait (0.1) seconds\n            switch costume to (3 v)\n            wait (0.1) seconds\n            switch costume to (4 v)\n            wait (0.1) seconds\n            switch costume to (5 v)\n            wait (0.1) seconds\n            switch costume to (6 v)\n            wait (0.1) seconds\n            switch costume to (7 v)\n            wait (0.1) seconds\n            switch costume to (8 v)\n            wait (0.1) seconds\n            switch costume to (9 v)\n            wait (0.1) seconds\n            switch costume to (10 v)\n            wait (0.1) seconds\n            switch costume to (11 v)\n            wait (0.1) seconds\n            hide\n        else\n            point in direction (0)\n            show\n            switch costume to (1 v)\n            wait (0.1) seconds\n            switch costume to (2 v)\n            wait (0.1) seconds\n            switch costume to (3 v)\n            wait (0.1) seconds\n            switch costume to (4 v)\n            wait (0.1) seconds\n            switch costume to (5 v)\n            wait (0.1) seconds\n            switch costume to (6 v)\n            wait (0.1) seconds\n            switch costume to (7 v)\n            wait (0.1) seconds\n            switch costume to (8 v)\n            wait (0.1) seconds\n            switch costume to (9 v)\n            wait (0.1) seconds\n            switch costume to (10 v)\n            wait (0.1) seconds\n            switch costume to (11 v)\n            wait (0.1) seconds\n            hide\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    glide (0.000001) secs to (kyoot v)\nend\n\nwhen I receive [sword = right v]\nswitch costume to (1 v)\nstop [this script v]\n\nwhen I receive [shut down v]\nhide\n\nbroadcast (Sword Strike v)\n\n\n\nwhen I receive [sword = left v]\nswitch costume to (2 v)\nstop [this script v]\n\nwhen flag clicked\nforever\n    if <touching (ghost 2 v)?> then\n        forever\n            broadcast (Ghost2 end v)\n        end\n    end\nend\n\n@ghost 2\n\nwhen flag clicked\nhide\n\nwhen I receive [ghost2 v]\nrepeat until <<touching (sword v)?> = [true]>\n    show\nend\n\nwhen flag clicked\ngo to x: (125) y: (53)\nrepeat until <<touching (sword v)?> = [true]>\n    broadcast (Ghost 1 left v)\n    glide (2) secs to x: (-206) y: (53)\n    broadcast (Ghost 1 right v)\n    glide (2) secs to x: (125) y: (53)\nend\n\nwhen I receive [ghost 1 left v]\nrepeat (4)\n    switch costume to (ghost left v)\n    wait (0.1) seconds\n    switch costume to (ghost2 left v)\n    wait (0.1) seconds\n    switch costume to (ghost3 left v)\n    wait (0.1) seconds\n    switch costume to (ghost4 left v)\n    wait (0.1) seconds\nend\n\nwhen I receive [ghost 1 right v]\nrepeat (4)\n    switch costume to (ghost right v)\n    wait (0.1) seconds\n    switch costume to (ghost2 right v)\n    wait (0.1) seconds\n    switch costume to (ghost3 right v)\n    wait (0.1) seconds\n    switch costume to (ghost4 right v)\n    wait (0.1) seconds\nend\n\nwhen I receive [ghost2 end v]\nforever\n    hide\nend\n\nwhen I receive [shut down v]\nhide\n\nwhen flag clicked\nforever\n    if <touching (sword v)?> then\n        forever\n            hide\n            broadcast (Ghost2 end v)\n            stop [other scripts in sprite v]\n        end\n    end\nend\n\n@Magic Splash\n\nwhen flag clicked\nswitch costume to (un paauuuse v)\nshow\nforever\n    glide (0.0001) secs to (kyoot v)\nend\n\nwhen [q v] key pressed\nif <(costume [number v]) = [16]> then\n    switch costume to (1 v)\n    repeat (14)\n        wait (0.0001) seconds\n        next costume\n    end\n    switch backdrop to (backdrop3 v)\n    broadcast (Speed x2 v)\n    broadcast (Potion Pause v)\nend\n\nwhen I receive [potion pause v]\nswitch costume to (paauuuse v)\nwait (35) seconds\nswitch costume to (un paauuuse v)\n\n@knight1\n\nwhen flag clicked\nhide\n\nwhen flag clicked\ngo to x: (128) y: (-55)\nforever\n    broadcast (knight 1 left v)\n    glide (1.5) secs to x: (-103) y: (-55)\n    broadcast (knight 1 right v)\n    glide (1.5) secs to x: (128) y: (-55)\nend\n\nwhen I receive [knight 1 left v]\nswitch costume to (left1 v)\nrepeat (15)\n    wait (0.1) seconds\n    next costume\nend\n\nwhen I receive [knight 1 right v]\nswitch costume to (1 v)\nrepeat (15)\n    wait (0.1) seconds\n    next costume\nend\n\nwhen I receive [knight1 end v]\nhide\n\nwhen I receive [shut down v]\nhide\n\nwhen I receive [knight1 v]\nshow\n\n