Platformer [WIP]

Instructions: Movement Keys: Up, Left, Right\nColor Keys: B=Blue, Y=Yellow, G=Green, P=Purple\nMute Music: M\nStop/Start Trail: T\n\n***Note: Some Keys Need To Be Unlocked!***

@Stage\n\nwhen flag clicked\nswitch backdrop to (basic v)\n\n@Ball\n\nwhen flag clicked\nset [gravity v] to [-3]\nforever\n    if <key (left arrow v) pressed?> then\n        set [x velocity v] to [-4]\n    else\n        if <key (right arrow v) pressed?> then\n            set [x velocity v] to [4]\n        else\n            set [x velocity v] to [0]\n        end\n    end\n    if <not <touching (ground v)?>> then\n        change y by (Gravity)\n    end\n    change x by (X Velocity)\nend\n\nwhen flag clicked\nset [jump unlocked v] to [0]\nwait until <(Jump Unlocked) = [1]>\nforever\n    if <key (up arrow v) pressed?> then\n        if <(Sounds Unlocked) = [1]> then\n            start sound [Finger Snap v]\n        end\n        repeat (10)\n            change y by (15)\n        end\n        repeat until <touching (ground v)?>\n            change y by (Gravity)\n        end\n    end\nend\n\nwhen flag clicked\nset [deaths v] to [0]\ngo to x: (-160) y: (-85)\nset [level v] to [0]\nforever\n    if <(x position) = [241]> then\n        change [level v] by (1)\n        go to x: (-160) y: (-85)\n        if <(Sounds Unlocked) = [1]> then\n            start sound [Connect v]\n        end\n    end\nend\n\nwhen flag clicked\nhide variable [deaths v]\nforever\n    if <touching color (#ff0000)?> then\n        if <(Sounds Unlocked) = [1]> then\n            start sound [Disconnect v]\n        end\n        change [deaths v] by (1)\n        go to x: (-160) y: (-85)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching color (#eeff00)?> then\n        if <(Sounds Unlocked) = [1]> then\n            start sound [Finger Snap v]\n        end\n        repeat (15)\n            change y by (15)\n        end\n    end\n    if <touching color (#ffec00)?> then\n        if <(Sounds Unlocked) = [1]> then\n            start sound [Finger Snap v]\n        end\n        repeat (15)\n            change y by (15)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(y position) = [-181]> then\n        if <(Sounds Unlocked) = [1]> then\n            start sound [Disconnect v]\n        end\n        change [deaths v] by (1)\n        go to x: (-160) y: (-85)\n    end\nend\n\nwhen flag clicked\nswitch costume to (ball-a v)\nforever\n    wait until <<(Level) = [8]> or <<(Level) = [37]> or <(Level) = [43]>>>\n    if <(x position) = [-242]> then\n        go to x: (178) y: (-57)\n    end\nend\n\nwhen I receive [colors unlocked v]\nset [rainbow unlocked v] to [0]\nforever\n    if <key (y v) pressed?> then\n        switch costume to (ball-a v)\n    end\n    if <key (b v) pressed?> then\n        switch costume to (ball-b v)\n    end\n    if <key (g v) pressed?> then\n        switch costume to (ball-d v)\n    end\n    if <key (p v) pressed?> then\n        switch costume to (ball-e v)\n    end\n    if <<(Rainbow Unlocked) = [1]> and <key (r v) pressed?>> then\n        repeat until <<<key (g v) pressed?> or <key (b v) pressed?>> or <<key (y v) pressed?> or <key (p v) pressed?>>>\n            next costume\n            wait (0.2) seconds\n        end\n    end\nend\n\nwhen flag clicked\nhide variable [time v]\nset [time v] to [0]\nforever\n    change [time v] by (1)\n    wait (1) seconds\nend\n\nwhen flag clicked\nforever\n    if <touching (eggnemy v)?> then\n        start sound [Disconnect v]\n        go to x: (-160) y: (-85)\n        change [deaths v] by (1)\n    end\nend\n\nwhen I receive [trail unlocked v]\nset [trail on v] to [1]\nforever\n    if <(Trail On) = [1]> then\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I start as a clone\nstop [other scripts in sprite v]\nrepeat (10)\n    change size by (-6)\nend\ndelete this clone\n\nwhen I receive [trail unlocked v]\nforever\n    if <key (t v) pressed?> then\n        if <(Trail On) = [0]> then\n            set [trail on v] to [1]\n        else\n            if <(Trail On) = [1]> then\n                set [trail on v] to [0]\n            end\n        end\n        wait (0.5) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    wait until <(Level) = [29]>\n    if <key (s v) pressed?> then\n        change [level v] by (1)\n        go to x: (-160) y: (-85)\n        if <(Sounds Unlocked) = [1]> then\n            start sound [Connect v]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    wait until <(Level) = [34]>\n    if <key (u v) pressed?> then\n        change [level v] by (1)\n        go to x: (-160) y: (-85)\n        if <(Sounds Unlocked) = [1]> then\n            start sound [Connect v]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    wait until <(Level) = [42]>\n    if <key (c v) pressed?> then\n        change [level v] by (1)\n        go to x: (-160) y: (-85)\n        if <(Sounds Unlocked) = [1]> then\n            start sound [Connect v]\n        end\n    end\nend\n\n@Ground\n\nwhen flag clicked\nswitch costume to (basic v)\nwait until <(Level) = [3]>\nswitch costume to (cliff v)\nwait until <(Level) = [4]>\nswitch costume to (basic v)\nwait until <(Level) = [6]>\nswitch costume to (gap v)\nwait until <(Level) = [7]>\nswitch costume to (basic v)\nwait until <(Level) = [8]>\nswitch costume to (gap v)\nwait until <(Level) = [9]>\nswitch costume to (cage v)\nwait until <(Level) = [10]>\nswitch costume to (cliff v)\nwait until <(Level) = [11]>\nswitch costume to (basic v)\nwait until <(Level) = [12]>\nswitch costume to (gap v)\nwait until <(Level) = [13]>\nswitch costume to (basic v)\nwait until <(Level) = [14]>\nswitch costume to (volcano v)\nwait until <(Level) = [15]>\nswitch costume to (spider man v)\nwait until <(Level) = [16]>\nswitch costume to (wall jumps v)\nwait until <(Level) = [17]>\nswitch costume to (basic v)\nwait until <(Level) = [18]>\nswitch costume to (fake death v)\nwait until <(Level) = [20]>\nswitch costume to (volcano v)\nwait until <(Level) = [21]>\nswitch costume to (cage v)\nwait until <(Level) = [22]>\nswitch costume to (basic v)\nwait until <(Level) = [24]>\nswitch costume to (gap v)\nwait until <(Level) = [25]>\nswitch costume to (spider man v)\nswitch backdrop to (t jump v)\nwait until <(Level) = [26]>\nswitch costume to (basic v)\nswitch backdrop to (basic v)\nwait until <(Level) = [27]>\nswitch costume to (gap hard v)\nwait until <(Level) = [28]>\nswitch costume to (basic v)\nwait until <(Level) = [29]>\nswitch costume to (gap v)\nswitch backdrop to (2 spikes v)\nwait until <(Level) = [30]>\nswitch costume to (basic v)\nwait until <(Level) = [31]>\nswitch costume to (fake death v)\nswitch backdrop to (secret ladder v)\nwait until <(Level) = [32]>\nswitch costume to (volcano v)\nswitch backdrop to (spring parkour v)\nwait until <(Level) = [33]>\nswitch costume to (wall jumps v)\nwait until <(Level) = [34]>\nswitch costume to (fake death v)\nwait until <(Level) = [35]>\nswitch costume to (basic v)\nswitch backdrop to (basic v)\nwait until <(Level) = [36]>\nswitch costume to (wall jumps v)\nswitch backdrop to (spring parkour v)\nwait until <(Level) = [37]>\nswitch costume to (gap hard v)\nswitch backdrop to (ceiling/spikes v)\nwait until <(Level) = [38]>\nswitch costume to (volcano v)\nswitch backdrop to (combo jumps v)\nwait until <(Level) = [39]>\nswitch costume to (basic v)\nswitch backdrop to (basic v)\nwait until <(Level) = [41]>\nswitch costume to (gap v)\nwait until <(Level) = [42]>\nswitch costume to (spider man v)\nswitch backdrop to (ceiling/spikes v)\nwait until <(Level) = [43]>\nswitch costume to (wall jumps v)\nswitch backdrop to (t jump v)\nwait until <(Level) = [44]>\nswitch costume to (big gap v)\nswitch backdrop to (basic v)\nwait until <(Level) = [45]>\nswitch backdrop to (2 spikes v)\nwait until <(Level) = [46]>\nswitch costume to (big gap v)\nswitch backdrop to (spring parkour v)\nwait until <(Level) = [47]>\nswitch costume to (basic v)\nswitch backdrop to (spring avoidance v)\n\nwhen [m v] key pressed\nset volume to (70) %\nwait until <(Music Unlocked) = [1]>\nif <(Muted) = [0]> then\n    set [muted v] to [1]\n    set volume to (0) %\n    stop [this script v]\nend\nif <(Muted) = [1]> then\n    set [muted v] to [0]\n    stop [this script v]\nend\n\nwhen flag clicked\nset volume to (70) %\nset [sounds unlocked v] to [0]\nset [muted v] to [0]\nset [music unlocked v] to [0]\nwait until <(Music Unlocked) = [1]>\nforever\n    wait until <(Muted) = [0]>\n    play sound [Video Game 1 v] until done\nend\n\n@Text\n\nwhen flag clicked\nswitch costume to (start v)\nwait until <(Level) = [1]>\nswitch costume to (level 2 v)\n\nwhen I receive [jump unlocked v]\nswitch costume to (jump unlocked v)\nwait until <(Level) = [2]>\nswitch costume to (red hurts v)\nswitch backdrop to (2 spikes v)\nwait until <(Level) = [3]>\nswitch costume to (that's a big jump! v)\nswitch backdrop to (basic v)\nwait until <(Level) = [4]>\nswitch costume to (level 4 v)\nwait until <(Level) = [5]>\nswitch costume to (level 5 v)\nswitch backdrop to (jump pads v)\nwait until <(Level) = [6]>\nswitch costume to (level 6 v)\nswitch backdrop to (basic v)\nwait until <(Level) = [7]>\nswitch costume to (present v)\n\nwhen I receive [music unlocked v]\nswitch costume to (music v)\nwait until <(Level) = [8]>\nswitch costume to (level 8 v)\nswitch backdrop to (2 spikes v)\nwait until <(Level) = [9]>\nswitch costume to (level 9 v)\nswitch backdrop to (basic v)\nwait until <(Level) = [10]>\nswitch costume to (level 10 v)\nswitch backdrop to (secret ladder v)\nwait until <(Level) = [11]>\nswitch costume to (present level 11 v)\nswitch backdrop to (basic v)\n\nwhen I receive [colors unlocked v]\nswitch costume to (colors unlocked v)\nwait until <(Level) = [12]>\nswitch costume to (new color combo v)\nswitch backdrop to (combo jumps v)\nwait until <(Level) = [13]>\nswitch costume to (13! v)\nswitch backdrop to (basic v)\n\nwhen I receive [sounds unlocked v]\nswitch costume to (sounds unlocked v)\nwait until <(Level) = [14]>\nswitch costume to (level 14 v)\nwait until <(Level) = [15]>\nswitch costume to (tarantula guy v)\nswitch backdrop to (2 spikes v)\nwait until <(Level) = [16]>\nswitch backdrop to (basic v)\nswitch costume to (level 16 v)\nwait until <(Level) = [17]>\nswitch backdrop to (basic v)\nswitch costume to (another upgrade v)\n\nwhen I receive [trackers unlocked v]\nswitch costume to (trackers unlocked v)\nwait until <(Level) = [18]>\nswitch costume to (ez v)\nwait until <(Level) = [19]>\nswitch costume to (harder v)\nswitch backdrop to (2 spikes v)\nwait until <(Level) = [20]>\nswitch backdrop to (combo jumps v)\nswitch costume to (getting harder v)\nwait until <(Level) = [21]>\nswitch backdrop to (t jump v)\nswitch costume to (fun v)\nwait until <(Level) = [22]>\nswitch costume to (another flag... v)\nswitch backdrop to (basic v)\n\nwhen I receive [eggnemies unlocked v]\nswitch costume to (eggnemies..? v)\nwait until <(Level) = [23]>\nswitch costume to (there's one v)\nwait until <(Level) = [24]>\nswitch costume to (another v)\nwait until <(Level) = [25]>\nswitch costume to (not any harder v)\nwait until <(Level) = [26]>\nswitch costume to (sorry v)\nwait until <(Level) = [27]>\nswitch costume to (deeper v)\nwait until <(Level) = [28]>\nswitch costume to (reward!? v)\nwait until <(Level) = [29]>\nswitch costume to (no tricks v)\nwait until <(Level) = [30]>\nswitch backdrop to (basic v)\nswitch costume to (wow... v)\nwait until <(Level) = [31]>\nswitch costume to (pretty easy v)\nwait until <(Level) = [32]>\nswitch costume to (hidden v)\nwait until <(Level) = [33]>\nswitch costume to (fine v)\nwait until <(Level) = [34]>\nswitch costume to (u know v)\nswitch backdrop to (ceiling/spikes v)\nwait until <(Level) = [35]>\nswitch costume to (stop skipping v)\n\nwhen I receive [trail unlocked v]\nswitch costume to (trail unlocked v)\n\nwhen I receive [rainbow unlocked v]\nswitch costume to (rainbow unlocked v)\nwait until <(Level) = [36]>\nswitch costume to (more eggs v)\nwait until <(Level) = [37]>\nswitch costume to (memories v)\nwait until <(Level) = [38]>\nswitch costume to (king of the hill v)\nwait until <(Level) = [39]>\nswitch costume to (present v)\n\nwhen I receive [moving blocks unlocked v]\nswitch costume to (moving blocks unlocked v)\nwait until <(Level) = [40]>\nswitch costume to (it's alive v)\nwait until <(Level) = [41]>\nswitch costume to (favorite v)\nwait until <(Level) = [42]>\nswitch costume to (can't you see v)\nwait until <(Level) = [43]>\nswitch costume to (not impossible v)\nwait until <(Level) = [44]>\nswitch costume to (fast v)\nwait until <(Level) = [45]>\nswitch costume to (getting harder v)\nwait until <(Level) = [46]>\nswitch costume to (again v)\nwait until <(Level) = [47]>\nswitch costume to (oh my v)\n\n@Green Flag\n\nwhen flag clicked\nwait until <(Level) = [0]>\nhide\nwait until <(Level) = [1]>\nshow\nwait until <touching (ball v)?>\nset [jump unlocked v] to [1]\nbroadcast (Jump Unlocked v)\nhide\nwait until <(Level) = [7]>\nshow\nwait until <touching (ball v)?>\nset [music unlocked v] to [1]\nbroadcast (Music Unlocked v)\nhide\nwait until <(Level) = [11]>\nshow\nwait until <touching (ball v)?>\nset [colors unlocked v] to [1]\nbroadcast (Colors Unlocked v)\nhide\nwait until <(Level) = [13]>\nshow\nwait until <touching (ball v)?>\nset [sounds unlocked v] to [1]\nstart sound [Win v]\nbroadcast (Sounds Unlocked v)\nhide\nwait until <(Level) = [17]>\nshow\nwait until <touching (ball v)?>\nshow variable [deaths v]\nshow variable [time v]\nstart sound [Win v]\nbroadcast (Trackers Unlocked v)\nhide\nwait until <(Level) = [22]>\nshow\nwait until <touching (ball v)?>\nstart sound [Win v]\nbroadcast (Eggnemies Unlocked v)\nhide\nwait until <(Level) = [30]>\nshow\nwait until <touching (ball v)?>\nstart sound [Win v]\nbroadcast (Trail Unlocked v)\nhide\nwait until <(Level) = [35]>\nshow\nwait until <touching (ball v)?>\nstart sound [Win v]\nset [rainbow unlocked v] to [1]\nbroadcast (Rainbow Unlocked v)\nhide\nwait until <(Level) = [39]>\nshow\nwait until <touching (ball v)?>\nstart sound [Win v]\nbroadcast (Moving Blocks Unlocked v)\nhide\n\n@Eggnemy\n\nwhen flag clicked\nhide\nwait until <(Level) = [0]>\ngo to x: (106) y: (-96)\nwait until <(Level) = [23]>\nshow\nrepeat until <(Level) = [24]>\n    point in direction (90)\n    if <(Level) = [24]> then\n        stop [this script v]\n    end\n    wait (1) seconds\n    if <(Level) = [24]> then\n        stop [this script v]\n    end\n    repeat (20)\n        change x by (-10)\n        wait (0.005) seconds\n        if <(Level) = [24]> then\n            stop [this script v]\n        end\n    end\n    point in direction (-90)\n    if <(Level) = [24]> then\n        stop [this script v]\n    end\n    wait (1) seconds\n    if <(Level) = [24]> then\n        stop [this script v]\n    end\n    repeat (20)\n        change x by (10)\n        wait (0.005) seconds\n        if <(Level) = [24]> then\n            stop [this script v]\n        end\n    end\nend\n\nwhen flag clicked\nhide\nwait until <(Level) = [24]>\ngo to x: (210) y: (-64)\nshow\nrepeat until <(Level) = [25]>\n    point in direction (90)\n    if <(Level) = [25]> then\n        stop [this script v]\n    end\n    wait (1) seconds\n    if <(Level) = [25]> then\n        stop [this script v]\n    end\n    repeat (8)\n        change x by (-10)\n        wait (0.005) seconds\n        if <(Level) = [25]> then\n            stop [this script v]\n        end\n    end\n    point in direction (-90)\n    if <(Level) = [25]> then\n        stop [this script v]\n    end\n    wait (1) seconds\n    if <(Level) = [25]> then\n        stop [this script v]\n    end\n    repeat (8)\n        change x by (10)\n        wait (0.005) seconds\n        if <(Level) = [25]> then\n            stop [this script v]\n        end\n    end\nend\n\nwhen flag clicked\nhide\nwait until <(Level) = [25]>\nhide\nwait until <(Level) = [36]>\npoint in direction (90)\ngo to x: (-121) y: (85)\nshow\nwait until <(Level) = [37]>\nhide\nwait until <(Level) = [38]>\ngo to x: (53) y: (73)\nshow\nrepeat until <(Level) = [39]>\n    point in direction (90)\n    if <(Level) = [39]> then\n        stop [this script v]\n    end\n    wait (1) seconds\n    if <(Level) = [39]> then\n        stop [this script v]\n    end\n    repeat (20)\n        change x by (-5)\n        wait (0.005) seconds\n        if <(Level) = [39]> then\n            stop [this script v]\n        end\n    end\n    point in direction (-90)\n    if <(Level) = [39]> then\n        stop [this script v]\n    end\n    wait (1) seconds\n    if <(Level) = [39]> then\n        stop [this script v]\n    end\n    repeat (20)\n        change x by (5)\n        wait (0.005) seconds\n        if <(Level) = [39]> then\n            stop [this script v]\n        end\n    end\nend\n\nwhen flag clicked\nwait until <(Level) = [39]>\nhide\ngo to x: (230) y: (-64)\nwait until <(Level) = [41]>\nshow\nrepeat until <(Level) = [42]>\n    point in direction (90)\n    if <(Level) = [42]> then\n        stop [this script v]\n    end\n    wait (1) seconds\n    if <(Level) = [42]> then\n        stop [this script v]\n    end\n    repeat (10)\n        change x by (-10)\n        wait (0.005) seconds\n        if <(Level) = [42]> then\n            stop [this script v]\n        end\n    end\n    point in direction (-90)\n    if <(Level) = [42]> then\n        stop [this script v]\n    end\n    wait (1) seconds\n    if <(Level) = [42]> then\n        stop [this script v]\n    end\n    repeat (10)\n        change x by (10)\n        wait (0.005) seconds\n        if <(Level) = [42]> then\n            stop [this script v]\n        end\n    end\nend\n\nwhen flag clicked\nwait until <(Level) = [42]>\nhide\n\nwait until <(Level) = [41]>\nshow\n\n@Moving Block 1\n\nwhen flag clicked\nwait until <(Level) = [0]>\nhide\ngo to x: (90) y: (-80)\nswitch costume to (red block v)\nwait until <(Level) = [40]>\nshow\nrepeat until <(Level) = [41]>\n    repeat (10)\n        change y by (10)\n        wait (0.005) seconds\n        if <(Level) = [41]> then\n            stop [this script v]\n        end\n    end\n    repeat (10)\n        change y by (-10)\n        wait (0.005) seconds\n        if <(Level) = [41]> then\n            stop [this script v]\n        end\n    end\nend\n\nwhen flag clicked\nwait until <(Level) = [41]>\nhide\nwait until <(Level) = [44]>\nswitch costume to (spring v)\ngo to x: (165) y: (-156)\nshow\nrepeat until <(Level) = [46]>\n    glide (0.5) secs to x: (20) y: (-156)\n    if <(Level) = [46]> then\n        stop [this script v]\n    end\n    glide (0.5) secs to x: (-115) y: (-156)\n    if <(Level) = [46]> then\n        stop [this script v]\n    end\n    glide (0.5) secs to x: (20) y: (-156)\n    if <(Level) = [46]> then\n        stop [this script v]\n    end\n    glide (0.5) secs to x: (165) y: (-156)\n    if <(Level) = [46]> then\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nwait until <(Level) = [46]>\nhide\n\n@Moving Block 2\n\nwhen flag clicked\nwait until <(Level) = [0]>\nhide\ngo to x: (-59) y: (20)\nswitch costume to (red block v)\nwait until <(Level) = [40]>\nshow\nrepeat until <(Level) = [41]>\n    repeat (10)\n        change y by (-10)\n        wait (0.005) seconds\n        if <(Level) = [41]> then\n            stop [this script v]\n        end\n    end\n    repeat (10)\n        change y by (10)\n        wait (0.005) seconds\n        if <(Level) = [41]> then\n            stop [this script v]\n        end\n    end\nend\n\nwhen flag clicked\nwait until <(Level) = [41]>\nhide\ngo to x: (0) y: (20)\nshow\nrepeat until <(Level) = [42]>\n    repeat (10)\n        change y by (-10)\n        wait (0.1) seconds\n        if <(Level) = [42]> then\n            stop [this script v]\n        end\n    end\n    repeat (10)\n        change y by (10)\n        wait (0.005) seconds\n        if <(Level) = [42]> then\n            stop [this script v]\n        end\n    end\nend\n\nwhen flag clicked\nwait until <(Level) = [42]>\nhide\n\n