Levels a Platformer
@Stage\n\nwhen flag clicked\nset volume to (50) %\nstart sound [F-777 - Deadlocked \[FULL SONG\] v]\nswitch backdrop to (menu v)\n\nwhen I receive [play game v]\nswitch backdrop to (game v)\n\nwhen I receive [back to menu v]\nswitch backdrop to (menu v)\n\n@nothing\n\n@Player\n\nwhen I receive [play game v]\nset [x v] to [0]\nset [y v] to [0]\ngo to x: (-200) y: (-100)\nshow\nforever\n    go to [front v] layer\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [x v] by (1)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [x v] by (-1)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <touching (ground v)?> then\n        change y by (1)\n        if <touching (ground v)?> then\n            change y by (1)\n            if <touching (ground v)?> then\n                change y by (1)\n                if <touching (ground v)?> then\n                    change y by (1)\n                    if <touching (ground v)?> then\n                        change y by (-4)\n                        change x by ((0) - (x))\n                        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                            set [y v] to [14]\n                            if <(x) > [0]> then\n                                set [x v] to [-10]\n                            else\n                                set [x v] to [10]\n                            end\n                        else\n                            set [x v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y v] by (-1)\n    change y by (y)\n    if <touching (ground v)?> then\n        change y by ((0) - (y))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <touching (ground v)?>> then\n        start sound [Boing v]\n        set [y v] to [14]\n    end\n    change y by (1)\n    if <(x position) > [240]> then\n        Check to see if level is complete\n    end\n    if <touching (spikes v)?> then\n        go to x: (-200) y: (-100)\n        set [x v] to [0]\n        set [y v] to [0]\n    end\n    if <(y position) < [-175]> then\n        go to x: (-200) y: (-100)\n        set [x v] to [0]\n        set [y v] to [0]\n    end\n    if <touching (jump pad v)?> then\n        if <key (down arrow v) pressed?> then\n            set [y v] to [10]\n        else\n            if <key (up arrow v) pressed?> then\n                set [y v] to [24]\n            else\n                set [y v] to [21]\n            end\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [teleport v]\ngo to x: (xPosPortalPurple) y: (yPosPortalPurple)\n\nwhen [s v] key pressed\nCheck to see if level is complete\n\ndefine Check to see if level is complete\nif <(item (Level) of [max stages v]) = (Stage)> then\n    if <(letter (7) of (item (1) of [locked levels v])) = ((Level) + (1))> then\n        delete (1) of [locked levels v]\n    end\n    hide\n    broadcast (Delete player trail v) and wait\n    set [level v] to []\n    set [stage v] to []\n    broadcast (Level Complete v) and wait\n    broadcast (Back to Menu v)\n    stop [this script v]\nelse\n    hide\n    broadcast (Delete player trail v) and wait\n    set [x v] to [0]\n    set [y v] to [0]\n    change [stage v] by (1)\n    go to x: (-200) y: (-100)\n    show\nend\n\nwhen I receive [play game v]\nforever\n    create clone of (_myself_ v)\n    wait (0.001) seconds\nend\n\nwhen I start as a clone\nrepeat (33)\n    change size by (-3)\n    change [ghost v] effect by (3)\nend\ndelete this clone\n\nwhen I receive [back to menu v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [delete player trail v]\ndelete this clone\n\n@Ground\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [play game v]\nswitch costume to (join [Level ] (join (Level) [ 1]))\nshow\nforever\n    switch costume to (join [Level ] (join (Level) (join [ ] (Stage))))\nend\n\nwhen I receive [back to menu v]\nhide\n\n@Spikes\n\nwhen I receive [play game v]\nswitch costume to (join [Level ] (join (Level) [ 1]))\nshow\nforever\n    switch costume to (join [Level ] (join (Level) (join [ ] (Stage))))\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [back to menu v]\nhide\n\n@Menu Screen\n\ndefine Fancy to size (size)\nchange size by (((size) - (size)) / (10))\n\ndefine Clone Info x: (x) y: (y) ID: (id) size: (size) interactable (?) class (class)\ngo to x: (x) y: (y)\nset size to (size) %\nset [interactive v] to (?)\nset [clone id v] to (id)\nset [class v] to (class)\nset [size v] to (size)\nset [y v] to (y)\nswitch costume to (id)\ncreate clone of (_myself_ v)\nset [clone id v] to []\n\nwhen flag clicked\nhide\nclear graphic effects\nset [level v] to []\nSetup lists and variables\nClone Info x: [0] y: [100] ID: [Title] size: [75] interactable [No] class []\nClone Info x: [0] y: [0] ID: [Play] size: [100] interactable [Yes] class []\nClone Info x: [0] y: [-100] ID: [How to play] size: [100] interactable [Yes] class []\n\nwhen I start as a clone\nshow\nforever\n    if <<(Interactive) = [Yes]> and <touching (mouse-pointer v)?>> then\n        Fancy to size ((Size) + (25))\n    else\n        Fancy to size (Size)\n    end\n    if <<<(y position) < [-100]> or <(y position) > [100]>> and <(Class) = [Play]>> then\n        set [ghost v] effect to ((([abs v] of (y position) ) - (100)) * (1.5))\n    else\n        set [ghost v] effect to (0)\n    end\n    if <(Class) = [Play]> then\n        set y to ((y) - (MenuY))\n    end\n    if <[locked levels v] contains (Clone ID)?> then\n        switch costume to (locked v)\n    else\n        if <[stars v] contains (Clone ID)?> then\n            switch costume to (join (Clone ID) [ STAR])\n        else\n            switch costume to (Clone ID)\n        end\n    end\nend\n\nwhen I receive [play v]\nrepeat (1)\n    delete this clone\nend\nLevel Screen\n\nwhen this sprite clicked\nif <not <(costume [name v]) = [Locked]>> then\n    broadcast (Clone ID)\n    if <(Class) = [Play]> then\n        broadcast (Play Game v)\n        set [level v] to (letter (7) of (costume [name v]))\n        set [stage v] to [1]\n    end\n    delete this clone\nend\n\nwhen [up arrow v] key pressed\nif <<<(Clone ID) = []> and <not <(MenuY) = [0]>>> and <(Level) = []>> then\n    change [menuy v] by (15)\nend\n\nwhen [down arrow v] key pressed\nif <<<(Clone ID) = []> and <(Level) = []>> and <not <(MenuY) = [-210]>>> then\n    change [menuy v] by (-15)\nend\n\nwhen I receive [play game v]\ndelete this clone\n\ndefine Setup lists and variables\nset [menuy v] to [0]\ndelete all of [locked levels v]\ndelete all of [stars v]\nadd [Level 2] to [locked levels v]\nadd [Level 3] to [locked levels v]\nadd [Level 4] to [locked levels v]\nadd [Level 5] to [locked levels v]\ndelete all of [max stages v]\nrepeat (5)\n    add [4] to [max stages v]\nend\n\nwhen I receive [back to menu v]\nLevel Screen\n\nwhen I receive [how to play v]\nrepeat (1)\n    delete this clone\nend\nClone Info x: [0] y: [0] ID: [Info Screen] size: [100] interactable [No] class []\nClone Info x: [0] y: [-150] ID: [Back] size: [50] interactable [Yes] class []\n\nwhen I receive [back v]\nrepeat (1)\n    delete this clone\nend\nClone Info x: [0] y: [100] ID: [Title] size: [75] interactable [No] class []\nClone Info x: [0] y: [0] ID: [Play] size: [100] interactable [Yes] class []\nClone Info x: [0] y: [-100] ID: [How to play] size: [100] interactable [Yes] class []\n\nwhen I receive [back 2 v]\nrepeat (1)\n    delete this clone\nend\nClone Info x: [0] y: [100] ID: [Title] size: [75] interactable [No] class []\nClone Info x: [0] y: [0] ID: [Play] size: [100] interactable [Yes] class []\nClone Info x: [0] y: [-100] ID: [How to play] size: [100] interactable [Yes] class []\n\ndefine Level Screen\nClone Info x: [0] y: [100] ID: [Level 1] size: [100] interactable [Yes] class [Play]\nClone Info x: [0] y: [0] ID: [Level 2] size: [100] interactable [Yes] class [Play]\nClone Info x: [0] y: [-100] ID: [Level 3] size: [100] interactable [Yes] class [Play]\nClone Info x: [0] y: [-200] ID: [Level 4] size: [100] interactable [Yes] class [Play]\nClone Info x: [0] y: [-300] ID: [Level 5] size: [100] interactable [Yes] class [Play]\nClone Info x: [-200] y: [135] ID: [Back 2] size: [65] interactable [Yes] class []\n\n@Jump Pad\n\nwhen flag clicked\nhide\nset [level v] to []\nCreate Pad at [-80] [-120] on level [3] [1]\nCreate Pad at [-110] [-120] on level [3] [2]\nCreate Pad at [-70] [-120] on level [3] [2]\nCreate Pad at [-30] [-120] on level [3] [2]\nCreate Pad at [10] [-120] on level [3] [2]\nCreate Pad at [50] [-120] on level [3] [2]\nCreate Pad at [90] [-120] on level [3] [2]\nCreate Pad at [130] [-120] on level [3] [2]\nCreate Pad at [-150] [-120] on level [3] [2]\nCreate Pad at [170] [-120] on level [3] [2]\nCreate Pad at [210] [-120] on level [3] [2]\nCreate Pad at [-220] [-120] on level [3] [3]\nCreate Pad at [-100] [-120] on level [3] [3]\nCreate Pad at [20] [-120] on level [3] [3]\nCreate Pad at [140] [-120] on level [3] [3]\nCreate Pad at [-200] [-120] on level [3] [4]\nCreate Pad at [-72] [-120] on level [3] [4]\nCreate Pad at [73] [-120] on level [3] [4]\nCreate Pad at [32] [-120] on level [4] [1]\nCreate Pad at [-64] [47] on level [4] [1]\nCreate Pad at [-180] [-120] on level [4] [4]\nCreate Pad at [-60] [-120] on level [4] [4]\nCreate Pad at [60] [-120] on level [4] [4]\nCreate Pad at [-135] [-55] on level [5] [1]\nCreate Pad at [-3] [-50] on level [5] [3]\n\ndefine Create Pad at (x) (y) on level (level) (stage)\nwait until <<(Level) = (level)> and <(Stage) = (stage)>>\nset size to (50) %\nset [clonelevel v] to (stage)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nswitch costume to (pad1 v)\ngo to [front v] layer\nforever\n    if <touching (player v)?> then\n        repeat (3)\n            next costume\n            wait (0.001) seconds\n        end\n        repeat (3)\n            switch costume to ((costume [number v]) - (1))\n            wait (0.001) seconds\n        end\n    end\nend\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I receive [end v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <not <(Stage) = (CloneLevel)>> then\n        delete this clone\n    end\nend\n\n@Level Complete\n\nwhen flag clicked\nhide\n\ndefine Create Clones\nset [clone id v] to [L_C 1]\ncreate clone of (_myself_ v)\nset [clone id v] to [L_C 2]\ncreate clone of (_myself_ v)\nset [clone id v] to [Sprite]\n\nwhen I receive [level complete v]\nCreate Clones\nwait (4.5) seconds\n\nwhen I start as a clone\nswitch costume to (dot v)\ngo to x: (0) y: ((300) - (((letter (5) of (Clone ID)) mod (2)) * (600)))\nswitch costume to (Clone ID)\nshow\ngo to [front v] layer\nrepeat (50)\n    change y by ((((0.429897) - ((((letter (5) of (Clone ID)) + (1)) mod (2)) * ((0.429897) * (2)))) - (y position)) / (10))\nend\nwait (1) seconds\nrepeat (10)\n    change x by ((((50) - (((letter (5) of (Clone ID)) mod (2)) * (100))) - (x position)) / (10))\nend\nrepeat (50)\n    change x by ((((460) - ((((letter (5) of (Clone ID)) + (1)) mod (2)) * (920))) - (x position)) / (10))\nend\nrepeat (50)\n    change y by ((((180) - (((letter (5) of (Clone ID)) mod (2)) * (360))) - (y position)) / (10))\n    change [ghost v] effect by (3)\nend\ndelete this clone\n\n@Portals\n\nwhen flag clicked\nhide\nset [level v] to []\nClear\nCreate Portal at [-200] [75] on level [4] [1] and second [160] [135]\nClear\nCreate Portal at [200] [-100] on level [4] [2] and second [-200] [-25]\nCreate Portal at [200] [-25] on level [4] [2] and second [-200] [50]\nCreate Portal at [200] [50] on level [4] [2] and second [-200] [125]\nClear\nCreate Portal at [-125] [-100] on level [4] [3] and second [-125] [140]\nCreate Portal at [0] [-100] on level [4] [3] and second [0] [140]\nCreate Portal at [125] [-100] on level [4] [3] and second [125] [140]\nClear\nCreate Portal at [-180] [155] on level [4] [4] and second [175] [20]\nCreate Portal at [-60] [155] on level [4] [4] and second [175] [-90]\nCreate Portal at [60] [155] on level [4] [4] and second [175] [135]\nClear\nCreate Portal at [200] [-100] on level [5] [1] and second [205] [150]\nCreate Portal at [125] [95] on level [5] [1] and second [125] [160]\nCreate Portal at [210] [35] on level [5] [1] and second [-215] [150]\nClear\nCreate Portal at [-205] [150] on level [5] [2] and second [-100] [-100]\nCreate Portal at [-100] [150] on level [5] [2] and second [5] [-105]\nCreate Portal at [5] [150] on level [5] [2] and second [110] [-105]\nCreate Portal at [110] [150] on level [5] [2] and second [210] [150]\nClear\nCreate Portal at [-90] [-105] on level [5] [3] and second [-210] [155]\nCreate Portal at [-145] [155] on level [5] [3] and second [-90] [30]\nCreate Portal at [-90] [-40] on level [5] [3] and second [35] [-100]\nCreate Portal at [-25] [-100] on level [5] [3] and second [-80] [100]\nCreate Portal at [-80] [155] on level [5] [3] and second [205] [-100]\nCreate Portal at [100] [-100] on level [5] [3] and second [60] [150]\nCreate Portal at [60] [100] on level [5] [3] and second [215] [150]\nCreate Portal at [210] [90] on level [5] [3] and second [65] [30]\nCreate Portal at [125] [-35] on level [5] [3] and second [130] [30]\n\ndefine Create Portal at (x) (y) on level (level) (stage) and second (x2) (2)\nwait until <<(Level) = (level)> and <(Stage) = (stage)>>\nset [clone id v] to [Main]\nset size to (75) %\nset [clonelevel v] to (stage)\ngo to x: (x) y: (y)\nswitch costume to (green v)\ncreate clone of (_myself_ v)\ngo to x: (x2) y: (2)\nswitch costume to (purple v)\nset [xposportalpurple v] to (x2)\nset [yposportalpurple v] to (2)\nadd (x2) to [purpleportalxpos v]\nadd (2) to [purpleportalypos v]\ncreate clone of (_myself_ v)\nset [clone id v] to [Second]\nset size to (75) %\nset [clonelevel v] to (stage)\ngo to x: (x) y: (y)\nswitch costume to (green v)\ncreate clone of (_myself_ v)\ngo to x: (x2) y: (2)\nswitch costume to (purple v)\ncreate clone of (_myself_ v)\nchange [i v] by (1)\n\nwhen I start as a clone\nshow\nforever\n    if <(Clone ID) = [Main]> then\n        turn right (3) degrees\n    else\n        turn left (3) degrees\n    end\nend\n\nwhen I start as a clone\nforever\n    if <not <(Stage) = (CloneLevel)>> then\n        delete this clone\n    end\nend\n\ndefine Clear\nset [oldlevel v] to (Stage)\nwait until <not <(Stage) = (OldLevel)>>\nset [i v] to [1]\ndelete all of [purpleportalxpos v]\ndelete all of [purpleportalypos v]\n\nwhen I start as a clone\nforever\n    if <<touching (player v)?> and <(costume [number v]) = [1]>> then\n        set [xposportalpurple v] to (item (i) of [purpleportalxpos v])\n        set [yposportalpurple v] to (item (i) of [purpleportalypos v])\n        broadcast (Teleport v)\n    end\nend\n\nchange [stage v] by (3)\n\ndelete all of [locked levels v]\n\n@Stars\n\nwhen flag clicked\nhide\nset [i v] to [1]\nset [stage v] to []\nswitch costume to (star v)\nrepeat (length of [starlevel v])\n    repeat until <(item (i) of [starlevel v]) = (join (Level) (join [ ] (Stage)))>\n    go to x: (item (i) of [starx v]) y: (item (i) of [stary v])\n    show\n    repeat until <not <(item (i) of [starlevel v]) = (join (Level) (join [ ] (Stage)))>>\n        turn right (3) degrees\n        if <touching (player v)?> then\n            switch costume to (grey v)\n            point in direction (90)\n            add (join [Level ] (Level)) to [stars v]\n            repeat until <not <(item (i) of [starlevel v]) = (join (Level) (join [ ] (Stage)))>>\n            end\n        end\n    end\n    hide\n    switch costume to (star v)\n    change [i v] by (1)\nend\n\n@splash\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\n
Use fullscreen or it might lag\n\nFull Instructions:\n-Use the arrow keys or WASD to move\n-Each level is 4 stages\n-Avoid red spikes\n-Purple trampolines are bouncy\n-Go into the green portal and you will come out the purple one\n-Press the up arrow on a trampoline to jump higher\n-Press the down arrow on a trampoline to jump lower\n-Try to collect all of the stars\n-Scroll in the menu to see all of the levels.\n-s to skip a stage\n\nFor level 5 I just spammed portals everywhere XD