Scared - A platformer #all #platformer #games

Instructions: Scared - A platformer\n\nInstructions\n-Use arrow keys or WASD!\n-Avoid jumping off cliffs!\n-Avoid lava!\n-Avoid Spikes!\n-Trampolines make you jump higher!\n-If the levels are too hard, use 'v' key to teleport you to the next level!\n-Hope you enjoy!\n\nTags\n#all\n#platformer\n#games

@Stage\n\nwhen [m v] key pressed\nshow variable [mouse v]\nset [mouse v] to (join [X, ] (join (mouse x) (join [ Y, ] (mouse y))))\nwait until <not <key (m v) pressed?>>\nwait until <key (m v) pressed?>\nhide variable [mouse v]\n\n@Blank\n\n@Player\n\nwhen flag clicked\nbroadcast (Reset v) and wait\nbroadcast (Start v) and wait\n\nwhen I receive [reset v]\nReset\n\ndefine Reset\nset [operation v] to []\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [level # v] to [1]\nset [lock v] to [0]\nset [spawn x v] to [-210]\nset [spawn y v] to [50]\nset [bounce extra height v] to [35]\ngo to x: (SPAWN X) y: (SPAWN Y)\npoint in direction (90)\ngo to [front v] layer\nshow\n\ndefine Spawn\ngo to x: (SPAWN X) y: (SPAWN Y)\n\nwhen I receive [start v]\nforever\n    repeat until <(OPERATION) > []>\n        Loop\n    end\n    if <(OPERATION) = [dead]> then\n        dead animation\n    end\nend\n\ndefine Loop\nMove in x: [1.25] y: [15]\ndie check\nnext level\n\ndefine Move in x: (x) y: (y)\nextra\ngo to [front v] layer\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [speed x v] by (x)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [speed x v] by ((0) - (x))\nend\nchange x by (speed x)\nif <touching (level v)?> then\n    change x by ((speed x) * (-1))\n    set [speed x v] to [0]\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        if <(speed x) > [0]> then\n            set [speed x v] to [-10]\n        else\n            set [speed x v] to [10]\n        end\n        set [speed y v] to [15]\n    else\n        set [speed x v] to [0]\n    end\nelse\n    set [speed x v] to ((speed x) * (0.8))\nend\nchange y by (speed y)\nif <touching (level v)?> then\n    change y by ((speed y) * (-1))\n    set [speed y v] to [0]\n    if <(LOCK) = [0]> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [speed y v] to (y)\n            set [lock v] to [1]\n        end\n    end\nelse\n    set [lock v] to [0]\n    change [speed y v] by (-1)\n    if <(speed y) < [-22]> then\n        set [speed y v] to [-22]\n    end\nend\nif <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n    switch costume to (playercrouch v)\nelse\n    switch costume to (player v)\nend\nif <<touching (level v)?> and <not <<key (down arrow v) pressed?> or <key (s v) pressed?>>>> then\n    switch costume to (playercrouch v)\nend\n\ndefine die check\nif <<touching (danger v)?> or <(y position) < [-180]>> then\n    set [operation v] to [dead]\nend\n\ndefine dead animation\nset [speed x v] to [0]\nset [speed y v] to [0]\nstart sound [Wilhelm Scream v]\nset [operation v] to []\nrepeat (7)\n    change y by (1)\n    change x by (-2)\n    turn left (4) degrees\nend\nrepeat (7)\n    turn left (3) degrees\n    change y by (-3)\n    change [ghost v] effect by (20)\nend\nSpawn\npoint in direction (90)\nset [ghost v] effect to (0)\n\ndefine next level\nif <(x position) > [240]> then\n    Spawn\n    change [level # v] by (1)\n    broadcast (next level v)\nend\n\ndefine extra\nif <touching (bounce v)?> then\n    set [speed y v] to (BOUNCE EXTRA HEIGHT)\nend\n\nwhen [v v] key pressed\nSpawn\nchange [level # v] by (1)\nwait until <not <key (v v) pressed?>>\n\n@Level\n\nwhen I receive [start v]\nforever\n    switch costume to (LEVEL #)\n    go to x: (0) y: (0)\nend\n\n@Bounce\n\nwhen I receive [start v]\nhide variable [mouse v]\nset [locked 1 v] to [0]\nset [locked 2 v] to [0]\nforever\n    levels\nend\n\ndefine nothin'\nhide\n\ndefine go to x: (x) y: (y)\nhide\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\nif <touching (player v)?> then\n    switch costume to (bounced v)\n    wait (0.075) seconds\n    switch costume to (non-bounce v)\nelse\n    switch costume to (non-bounce v)\nend\n\nwhen I start as a clone\nshow\nforever\n    if <touching (player v)?> then\n        switch costume to (bounced v)\n        wait (0.075) seconds\n        switch costume to (non-bounce v)\n    else\n        switch costume to (non-bounce v)\n    end\nend\n\nwhen I receive [next level v]\ndelete this clone\n\ndefine levels\nif <(LEVEL #) = [1]> then\n    nothin'\nelse\n    if <(LEVEL #) = [2]> then\n        nothin'\n    else\n        if <(LEVEL #) = [3]> then\n            nothin'\n        else\n            if <(LEVEL #) = [4]> then\n                nothin'\n            else\n                if <(LEVEL #) = [5]> then\n                    if <(locked 1) = [0]> then\n                        set [locked 1 v] to [1]\n                        go to x: [-95] y: [-18]\n                    end\n                else\n                    if <(LEVEL #) = [6]> then\n                        if <(locked 2) = [0]> then\n                            set [locked 2 v] to [1]\n                            go to x: [-95] y: [-18]\n                            go to x: [95] y: [-18]\n                        end\n                    else\n                        if <(LEVEL #) = [7]> then\n                            nothin'\n                        else\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\n@Danger\n\nwhen I receive [start v]\nforever\n    switch costume to (LEVEL #)\n    go to x: (0) y: (0)\n    go to [front v] layer\n    go [backward v] (1) layers\nend\n\n@Words\n\nwhen I receive [start v]\nforever\n    switch costume to (LEVEL #)\n    go to x: (0) y: (0)\n    go to [front v] layer\n    go [backward v] (2) layers\nend\n\n@Music\n\nwhen flag clicked\nbroadcast (Music v)\nforever\n    Music\nend\n\nwhen I receive [music v]\nforever\n    play sound [Musickkk v] until done\nend\n\nwhen I receive [reset v]\nReset\n\ndefine Music\ngo to x: (210) y: (-151)\nchange size by (((100) - (size)) / (2))\nif <touching (mouse-pointer v)?> then\n    go to [front v] layer\n    change size by (10)\n    set [brightness v] effect to (10)\n    if <mouse down?> then\n        if <(volume) = [100]> then\n            set volume to (0) %\n            switch costume to (music off v)\n            wait until <not <mouse down?>>\n            stop [this script v]\n        else\n            set volume to (100) %\n            switch costume to (music on v)\n            wait until <not <mouse down?>>\n            stop [this script v]\n        end\n        wait until <not <mouse down?>>\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\ndefine Reset\nswitch costume to (music on v)\ngo to x: (210) y: (-151)\npoint in direction (90)\nset size to (100) %\ngo to [front v] layer\nshow\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    reset timer\n    hide\nend\n\nwhen [timer v] > (0.01)\nbroadcast (Hide all v)\nswitch costume to (thumbnail v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\ngo to [front v] layer\nset size to (50) %\nrepeat (10)\n    change [ghost v] effect by (-10)\n    change size by (5)\nend\nforever\n    play sound [Musickkk v] until done\nend\n\n