Green {abandoned platformer}


@Stage\n\nchange [brightness v] effect by (25)\n\nchange [brightness v] effect by (-25)\n\nwhen flag clicked\nforever\n    play sound [BeepBox-Song3-4 v] until done\nend\n\n@Sprite1\n\nwhen flag clicked\nset [level v] to [1]\nReset Level\nforever\n    if <(play) = [1]> then\n        switch costume to (hitbox v)\n        Controls - Jump, Crouch\n        Gravity\n        Check Hit Ceiling / Floor <(speed y) > [0]>\n        if <(y position) < [-183]> then\n            Reset Level\n        end\n        if <(wall jump) > [0]> then\n            change [wall jump v] by (-1)\n        else\n            Controls - Left and Right\n        end\n        if <(speed x) < [-0.5]> then\n            Walk (-90) (speed x) max steep (([ceiling v] of ([abs v] of ((speed x) * (1.3)) ) ) + (1))\n        else\n            if <(speed x) > [0.5]> then\n                Walk (90) (speed x) max steep (([ceiling v] of ([abs v] of ((speed x) * (1.3)) ) ) + (1))\n            else\n                set [frame v] to [0]\n            end\n        end\n        Set Costume\n        broadcast (tick v) and wait\n    else\n    end\nend\n\ndefine Controls - Jump, Crouch\nif <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n    if <<(jump key) = [0]> and <(falling?) < [3]>> then\n        set [speed y v] to [12]\n        set [falling? v] to [6]\n        set [jump key v] to [1]\n    end\nelse\n    set [jump key v] to [0]\nend\nif <<key (s v) pressed?> or <key (down arrow v) pressed?>> then\n    set [in platforrm v] to [2]\nend\n\ndefine None\npoint in direction (direction)\nchange x by (speed)\nchange [frame v] by (([abs v] of (speed) ) / (8))\nset [slope v] to [0]\nGet Touching <(in platforrm) = [1]>\nrepeat until <<(slope) = (max steep)> or <(touch) = [0]>>\n    change y by (1)\n    change [slope v] by (1)\n    Get Touching <(in platforrm) = [1]>\nend\nif <(slope) = (max steep)> then\n    change x by ((0) - (speed))\n    change y by ((0) - (slope))\n    if <<(touch) = [1]> and <(in platforrm) = [1]>> then\n        set [in platforrm v] to [2]\n        Walk (direction) (speed) max steep (max steep)\n        if <(speed x) = [0]> then\n            set [in platforrm v] to [1]\n        end\n    else\n        if <<<<key (w v) pressed?> or <key (up arrow v) pressed?>> and <([abs v] of (speed) ) > [3.5]>> and <(touch) > [1]>> then\n            set [speed x v] to ((-1.2) * (speed))\n            set [speed y v] to [11]\n            set [frame v] to [6]\n            set [wall jump v] to [15]\n        else\n            set [speed x v] to [0]\n        end\n    end\nend\n\ndefine Check Hit Ceiling / Floor <>\nGet Touching <not >\nif <(touch) = [0]> then\n    set [in platforrm v] to [1]\nelse\n    if <<up?> and <(touch) = [1]>> then\n        set [in platform? v] to [2]\n    end\nend\nrepeat until <(touch) < (in platforrm)>\n    if <up?> then\n        change y by (-1)\n    else\n        change y by (1)\n        set [falling? v] to [0]\n    end\n    Get Touching <not <up?>>\n    set [speed y v] to [0]\nend\n\ndefine Controls - Left and Right\nset [speed x v] to ((speed x) * (0.7))\nif <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n    change [speed x v] by (-1.5)\nend\nif <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n    change [speed x v] by (1.5)\nend\n\ndefine Reset Level\nset rotation style [left-right v]\ngo to x: (-230) y: (-124)\nreset timer\nshow\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [falling? v] to [10]\nset [in platforrm v] to [1]\nset [frame v] to [0]\nset [wall jump v] to [0]\nset [scrollx v] to [0]\nbroadcast (Setup v) and wait\n\ndefine Gravity\nif <<(speed y) < [4]> or <<key (w v) pressed?> or <key (up arrow v) pressed?>>> then\n    change [speed y v] by (-1)\nelse\n    change [speed y v] by (-2)\nend\nchange y by (speed y)\nchange [falling? v] by (1)\n\ndefine Get Touching <>\nif <touching (sprite2 v)?> then\n    set [touch v] to [9]\nelse\n    if <<check platform?> and <touching (platforms v)?>> then\n        set [touch v] to [1]\n    else\n        set [touch v] to [0]\n    end\nend\n\nset x to (0)\nset y to (0)\n\ndefine Set Costume\nif <(falling?) < [6]> then\n    if <(frame) = [0]> then\n        switch costume to (stand v)\n    else\n        switch costume to ([floor v] of ((10) + ((frame) mod (8))) )\n    end\nelse\n    if <(speed y) > [0]> then\n        switch costume to (jump v)\n    else\n        switch costume to (fall v)\n    end\nend\n\ndefine Check Hit Ceiling / Floor <>\nGet Touching <not >\nif <(touch) = [0]> then\n    set [in platforrm v] to [1]\nelse\n    if <<up?> and <(touch) = [1]>> then\n        set [in platform? v] to [2]\n    end\nend\nrepeat until <(touch) < (in platforrm)>\n    if <up?> then\n        change y by (-1)\n    else\n        change y by (1)\n        set [falling? v] to [0]\n    end\n    Get Touching <not <up?>>\n    set [speed y v] to [0]\nend\n\ndefine next level\nset rotation style [left-right v]\ngo to x: (-230) y: (-124)\nreset timer\nshow\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [falling? v] to [10]\nset [in platforrm v] to [1]\nset [frame v] to [0]\nset [wall jump v] to [0]\nset [scrollx v] to [0]\nchange [level v] by (1)\nbroadcast (Setup v) and wait\n\nwhen I receive [next level v]\nnext level\n\n@Sprite2\n\nset x to (0)\nset y to (0)\n\nwhen I receive [next level v]\nswitch costume to (level)\n\nswitch costume to (level)\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\n@background\n\nwhen I receive [next level v]\n\n@buttons\n\nwhen flag clicked\nhide\n\nshow\n\n@gem\n\ngo to x: (215) y: (-125)\n\nwhen I receive [tick v]\nif <touching (sprite1 v)?> then\n    broadcast (next level v)\nend\n\n@Sprite3\n\nwhen I receive [next level v]\nswitch costume to (level)\nstop [other scripts in sprite v]\nif <[disappearing floors v] contains (level)?> then\n    show\n    broadcast (a kind of magic♪ v)\nelse\n    hide\nend\n\nif <(magic ♪) = [1]> then\nelse\nend\n\nforever\n    set [ghost v] effect to (99)\n    wait until <(magic ♪) = [0]>\n    set [ghost v] effect to (0)\nend\n\n@words\n\nwhen I start as a clone\nshow\n\ndefine None\nset size to ((size) * (100)) %\nif <((length of (text)) mod (2)) = [0]> then\n    go to x: ((0) - ((((length of (text)) / (2)) - ((0.5) * (size))) * (16))) y: (y)\nelse\n    go to x: ((0) - (((((length of (text)) - (1)) / (2)) * (16)) * (size))) y: (y)\nend\nset [letter v] to [1]\nrepeat (length of (text))\n    switch costume to (letter (letter) of (text))\n    create clone of (_myself_ v)\n    change x by ((16) * (size))\n    change [letter v] by (1)\nend\n\n@le monster\n\nwhen flag clicked\nhide\n\n