Platformer V 1.3       #games  #all

Instructions: Easy Mode: https://scratch.mit.edu/projects/470985635/\nMy High Score: 167.014 seconds (0 deaths(somehow))\nImportant Note: When remixing please give credit and change some things inside or else it will be reported.\nIf you enjoyed playing this, please leave a love and a fav, I really appreciate it!\nFollow me for more great platformers!\n#games\n#platformers\n#all

@Stage\n\n@PLAYER\n\nwhen flag clicked\nhide variable [mouse v]\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\nwhen I receive [green flag v]\nhide variable [☁ high score v]\nhide variable [☁ high score that shows v]\nshow variable [the player's score that shows v]\nhide variable [your score v]\nhide variable [☁ high score v]\nhide variable [player's score v]\nhide variable [the high score that shows v]\nhide\ngo to [front v] layer\n\nwhen I receive [play game v]\nset [level v] to [1]\nreset timer\nforever\n    broadcast (Reset game v)\n    broadcast (Setup v)\n    Game On\n    repeat until <(Exit) > []>\n        Tick\n        broadcast (Tick v) and wait\n    end\n    if <(Exit) = [win]> then\n        Game - Win\n    else\n        Game - Die\n    end\nend\n\ndefine Game On\nset [x v] to [0]\nset [y v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset size to (100) %\nset [ghost v] effect to (0)\nshow\n\ndefine Tick\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    Change Player x by: [-9]\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    Change Player x by: [9]\nend\nif <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n    if <(In air) < [6]> then\n        set [sy v] to [17]\n    end\nend\nif <key (space v) pressed?> then\n    if <<not <(Level) = [5]>> and <(In air) < [6]>> then\n        set [sy v] to [9]\n    end\nend\nchange [sy v] by (-2.1)\nChange Player Y by: (sy)\nTest if dead\nset [scroll x v] to (x)\nif <(Scroll X) < [0]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by (round (((y) - (Scroll Y)) / (8)))\nif <(Scroll Y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\nif <(y) < [-180]> then\n    set [exit v] to [DIE]\nend\n\ndefine Change Player Y by: (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nchange [in air v] by (1)\nrepeat until <not <touching (platformz v)?>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\n\ndefine Position\ngo to x: ((x) - (Scroll X)) y: ((y) - (Scroll Y))\n\ndefine Change Player x by: (sx)\nchange [x v] by (sx)\nPosition\nif <touching (platformz v)?> then\n    repeat (11)\n        change [y v] by (1)\n        Position\n        if <not <touching (platformz v)?>> then\n    end\n    change [y v] by (-11)\n    repeat until <not <touching (platformz v)?>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Game - Die\nset [exit v] to []\nrepeat (3)\n    hide\n    wait (0.2) seconds\n    change [ghost v] effect by (15)\n    show\nend\nset [ghost v] effect to (0)\nhide\nwait (1) seconds\n\ndefine Test if dead\nif <touching (dangerous stuff v)?> then\n    set [exit v] to [DIE]\nend\n\ndefine Game - Win\nrepeat (50)\n    point towards (portal v)\n    turn right (65) degrees\n    move ((distance to [portal v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (2)\nend\nhide\nchange [level v] by (1)\nwait (1) seconds\n\nchange size by (220)\n\nwhen I receive [play game v]\nrepeat until <(Level) = [6]>\n    set [your score v] to (join (username) (join [: ] (timer)))\n    set [the player's score that shows v] to (join [Your Time: ] (timer))\n    set [player's score v] to (timer)\nend\nif <(☁ High Score) > (player's score)> then\n    set [☁ high score v] to (player's score)\n    set [☁ high score that shows v] to (join [High Score: ] (join (username) (join [ - ] (☁ High Score))))\n    show variable [☁ high score that shows v]\nelse\n    show variable [☁ high score that shows v]\n    set [☁ high score that shows v] to (join [High Score: ] (☁ High Score))\nend\n\n@PLATFORMZ\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (Scroll X)) ((y) - (Scroll Y))\n\nwhen I receive [setup v]\nhide\nif <(Level) = [1]> then\n    set [x v] to [0]\n    set [y v] to [0]\n    switch costume to (lv 1.1 v)\n    Clone at x: [500] y: [0]\n    Clone at x: [500] y: [0]\n    Clone at x: [400] y: [0]\nelse\n    if <(Level) = [2]> then\n        set [x v] to [0]\n        set [y v] to [0]\n        switch costume to (lv 2.1 v)\n        Clone at x: [450] y: [330]\n        Clone at x: [1000] y: [30]\n        Clone at x: [900] y: [40]\n    else\n        if <(Level) = [3]> then\n            set [x v] to [0]\n            set [y v] to [0]\n            switch costume to (lv 3.1 v)\n            Clone at x: [1350] y: [0]\n            Clone at x: [-650] y: [0]\n            Clone at x: [600] y: [100]\n            Clone at x: [700] y: [200]\n        else\n            if <(Level) = [4]> then\n                set [x v] to [0]\n                set [y v] to [0]\n                switch costume to (lv 4.1 v)\n                Clone at x: [200] y: [550]\n                Clone at x: [360] y: [400]\n                Clone at x: [280] y: [330]\n                Clone at x: [400] y: [0]\n            else\n                if <(Level) = [5]> then\n                    set [x v] to [0]\n                    set [y v] to [0]\n                    switch costume to (lv 5.1 v)\n                    Clone at x: [555] y: [110]\n                    Clone at x: [-350] y: [200]\n                    Clone at x: [600] y: [190]\n                    Clone at x: [-450] y: [200]\n                    Clone at x: [800] y: [0]\n                    Clone at x: [-800] y: [400]\n                    Clone at x: [150] y: [400]\n                else\n                    if <(Level) = [level]> then\n                        set [x v] to [0]\n                        set [y v] to [0]\n                        switch costume to (win v)\n                    else\n                        if <(Level) = [6]> then\n                            set [x v] to [0]\n                            set [y v] to [0]\n                            switch costume to (win v)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset game v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\n@DANGEROUS STUFF\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (Scroll X)) ((y) - (Scroll Y))\n\nwhen I receive [setup v]\nhide\nif <(Level) = [1]> then\n    set [x v] to [0]\n    set [y v] to [0]\n    switch costume to (lv 1.1 v)\n    Clone at x: [500] y: [0]\n    Clone at x: [500] y: [0]\n    Clone at x: [400] y: [0]\nelse\n    if <(Level) = [2]> then\n        set [x v] to [0]\n        set [y v] to [0]\n        switch costume to (lv 2.1 v)\n        Clone at x: [450] y: [330]\n        Clone at x: [1000] y: [30]\n        Clone at x: [900] y: [40]\n    else\n        if <(Level) = [3]> then\n            set [x v] to [0]\n            set [y v] to [0]\n            switch costume to (lv 3.1 v)\n            Clone at x: [1350] y: [0]\n            Clone at x: [-650] y: [0]\n            Clone at x: [600] y: [100]\n            Clone at x: [700] y: [200]\n        else\n            if <(Level) = [4]> then\n                set [x v] to [0]\n                set [y v] to [0]\n                switch costume to (lv 4.1 v)\n                Clone at x: [200] y: [550]\n                Clone at x: [360] y: [400]\n                Clone at x: [280] y: [330]\n                Clone at x: [400] y: [0]\n            else\n                if <(Level) = [5]> then\n                    set [x v] to [0]\n                    set [y v] to [0]\n                    switch costume to (lv 5.1 v)\n                    Clone at x: [555] y: [110]\n                    Clone at x: [-350] y: [200]\n                    Clone at x: [600] y: [190]\n                    Clone at x: [-450] y: [200]\n                    Clone at x: [800] y: [0]\n                end\n            end\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset game v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\n@Collectables\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nset [collectables collected v] to (join (Collectablees collected) (join [/] (Collected Max)))\nPosition ((x) - (Scroll X)) ((y) - (Scroll Y))\nif <touching (player v)?> then\n    change [collectablees collected v] by (1)\n    if <(Collectablees collected) = (Collected Max)> then\n        broadcast (Open Portal v)\n    end\n    delete this clone\nend\n\nwhen I receive [setup v]\nhide\nset [collectables collected v] to [0]\nset [collectablees collected v] to [0]\nset [collected max v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(Level) = [1]> then\n    switch costume to (collectable v)\n    Clone at x: [138] y: [56]\n    Clone at x: [-20] y: [108]\n    Clone at x: [-191] y: [125]\n    Clone at x: [382] y: [-68]\n    Clone at x: [679] y: [4]\n    Clone at x: [952] y: [85]\n    Clone at x: [1125] y: [85]\n    Clone at x: [1560] y: [-58]\n    Clone at x: [1516] y: [-29]\n    Clone at x: [1473] y: [-58]\nelse\n    if <(Level) = [2]> then\n        switch costume to (collectable v)\n        Clone at x: [79] y: [-39]\n        Clone at x: [-174] y: [14]\n        Clone at x: [-94] y: [169]\n        Clone at x: [400] y: [176]\n        Clone at x: [92] y: [234]\n        Clone at x: [660] y: [260]\n        Clone at x: [1343] y: [351]\n        Clone at x: [1130] y: [466]\n        Clone at x: [2086] y: [425]\n        Clone at x: [2030] y: [481]\n    else\n        if <(Level) = [3]> then\n            switch costume to (collectable v)\n            Clone at x: [-188] y: [-20]\n            Clone at x: [-86] y: [-20]\n            Clone at x: [258] y: [-59]\n            Clone at x: [310] y: [-23]\n            Clone at x: [378] y: [-57]\n            Clone at x: [675] y: [131]\n            Clone at x: [2276] y: [303]\n            Clone at x: [896] y: [134]\n            Clone at x: [1380] y: [304]\n        else\n            if <(Level) = [4]> then\n                switch costume to (collectable v)\n                Clone at x: [923] y: [1819]\n                Clone at x: [1186] y: [1719]\n                Clone at x: [1228] y: [1491]\n                Clone at x: [1143] y: [1308]\n                Clone at x: [-91] y: [561]\n                Clone at x: [551] y: [499]\n                Clone at x: [243] y: [200]\n                Clone at x: [-210] y: [232]\n                Clone at x: [-210] y: [173]\n                Clone at x: [433] y: [551]\n                Clone at x: [111] y: [659]\n                Clone at x: [838] y: [1486]\n                Clone at x: [1086] y: [1130]\n            else\n                if <(Level) = [5]> then\n                    switch costume to (collectable v)\n                    Clone at x: [-168] y: [22]\n                    Clone at x: [-101] y: [22]\n                    Clone at x: [-33] y: [22]\n                end\n            end\n        end\n    end\nend\nset [x v] to [-99999]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset game v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\nchange [collected max v] by (1)\ncreate clone of (_myself_ v)\n\nwhen [m v] key pressed\nset [mouse v] to (join ((mouse x) + (Scroll X)) (join [, ] ((mouse y) + (Scroll Y))))\nshow variable [mouse v]\n\n@Portal\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (Scroll X)) ((y) - (Scroll Y))\nif <<(costume [number v]) = [1]> and <touching (player v)?>> then\n    set [exit v] to [win]\nend\n\nwhen I receive [setup v]\nhide\nset [collectables collected v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(Level) = [1]> then\n    switch costume to (closed v)\n    Clone at x: [1819] y: [97]\nelse\n    if <(Level) = [2]> then\n        switch costume to (closed v)\n        Clone at x: [2747] y: [406]\n    else\n        if <(Level) = [3]> then\n            switch costume to (closed v)\n            Clone at x: [2578] y: [220]\n        else\n            if <(Level) = [4]> then\n                switch costume to (closed v)\n                Clone at x: [1692] y: [1526]\n            else\n                if <(Level) = [5]> then\n                    switch costume to (closed v)\n                    Clone at x: [592] y: [1959]\n                else\n                    if <(Level) = [6]> then\n                        switch costume to (closed v)\n                        Clone at x: [99999] y: [99999]\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset game v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\n\nwhen [m v] key pressed\nset [mouse v] to (join ((mouse x) + (Scroll X)) (join [, ] ((mouse y) + (Scroll Y))))\nshow variable [mouse v]\n\nwhen I receive [open portal v]\nswitch costume to (open v)\n\n@Sprite1\n\nwhen flag clicked\nhide\n\nshow\n\n@Cloudz\n\nwhen flag clicked\ngo to [back v] layer\n\n