Stock Up - A Mobile Platformer

Instructions: [Arrow Keys] or [WASD] - Move\n[P] - Skip Level

@Stage\n\nwhen flag clicked\nswitch backdrop to (intro v)\nclear graphic effects\n\nwhen I receive [nature time v]\nswitch backdrop to (backdrop2 v)\nrepeat (10)\n    stop all sounds\nend\nforever\n    play sound [Sounds of the Boreal Forest.mp3 v] until done\nend\n\nwhen I receive [done v]\nchange [brightness v] effect by (-1)\n\nwhen I receive [before start v]\nswitch backdrop to (backdrop1 v)\nrepeat (10)\n    play sound [\[Hardcore\] - NJB - Running in the 90s \(Hardcore Rave Edit\) \[Free Download\].mp3 v] until done\nend\n\n@guy\n\ndefine quick\nrepeat (6)\n    if <touching (lvls v)?> then\n        change y by (1)\n    end\nend\n\ndefine xcoll\nrepeat until <not <touching (lvls v)?>>\n    if <([abs v] of (x) ) = (x)> then\n        change x by (-1)\n    else\n        change x by (1)\n    end\nend\n\ndefine ycoll\nrepeat until <not <touching (lvls v)?>>\n    if <(y) > [0]> then\n        change y by (-1)\n    else\n        change y by (1)\n    end\nend\n\nwhen I start as a clone\nswitch costume to (costume2 v)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I receive [ded v]\ngo to x: (-220) y: (-80)\npoint in direction (90)\nset [y v] to [0]\nset [x v] to [0]\n\nwhen flag clicked\nhide\n\nwhen I receive [before start v]\nforever\n    if <<key (p v) pressed?> and <not <([costume # v] of [lvls v]) = [20]>>> then\n        broadcast (done v)\n        start sound [Win v]\n        go to x: (-220) y: (-80)\n        point in direction (90)\n        set [y v] to [0]\n        set [x v] to [0]\n        wait until <not <key (p v) pressed?>>\n    end\nend\n\nwhen I receive [before start v]\nshow\nclear graphic effects\ngo to x: (-220) y: (-80)\npoint in direction (90)\nset rotation style [left-right v]\nset [y v] to [0]\nset [x v] to [0]\nforever\n    change [y v] by (-1)\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        point in direction (90)\n        switch costume to (guy v)\n        change [x v] by (1.5)\n    else\n        if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n            point in direction (-90)\n            switch costume to (guy v)\n            change [x v] by (-1.5)\n        else\n            point in direction (90)\n            switch costume to (costume1 v)\n        end\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <touching (lvls v)?> then\n        quick\n        if <touching (lvls v)?> then\n            change y by (-6)\n            xcoll\n            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n                set [y v] to [13]\n                if <([abs v] of (x) ) = (x)> then\n                    set [x v] to [-8]\n                else\n                    set [x v] to [8]\n                end\n            else\n                set [x v] to [0]\n            end\n        end\n    end\n    change y by (y)\n    if <touching (lvls v)?> then\n        ycoll\n        if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> and <(y) < [0]>> then\n            set [y v] to [13]\n        else\n            set [y v] to [0]\n        end\n    end\n    if <(x position) > [240]> then\n        broadcast (done v)\n        start sound [Win v]\n        go to x: (-220) y: (-80)\n        point in direction (90)\n        set [y v] to [0]\n        set [x v] to [0]\n    end\n    if <touching (bad stuff v)?> then\n        go to x: (-220) y: (-80)\n        broadcast (ded v)\n        point in direction (90)\n        set [y v] to [0]\n        set [x v] to [0]\n    end\n    create clone of (_myself_ v)\nend\n\n@materials\n\nwhen flag clicked\nhide\n\ndefine insert item at: (x) (y) costume (costume)\ngo to x: (x) y: (y)\nswitch costume to (costume)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nset [turnzzz v] to [0]\nif <<(size) = [100]> and <not <(costume [number v]) = [7]>>> then\n    show\n    set size to (99) %\n    create clone of (_myself_ v)\n    set size to (100) %\n    forever\n        set rotation style [all around v]\n        point in direction ((90) + (([sin v] of ((turnzzz) * (15)) ) * (5)))\n        change y by ([sin v] of ((turnzzz) * (10)) )\n        if <<touching (guy v)?> and <touching color (#000000)?>> then\n            start sound [Coin v]\n            delete this clone\n        end\n    end\nend\n\nwhen I start as a clone\nif <(size) = [99]> then\n    switch costume to (shine v)\n    point in direction (90)\n    show\n    forever\n        set rotation style [all around v]\n        turn right (3) degrees\n        if <(distance to [guy v]) < [51]> then\n            delete this clone\n        end\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [7]> then\n    set rotation style [left-right v]\n    switch costume to (cop v)\n    show\n    forever\n        repeat (25)\n            point in direction (90)\n            change x by (2)\n        end\n        wait (1) seconds\n        repeat (25)\n            point in direction (-90)\n            change x by (-2)\n        end\n        wait (1) seconds\n    end\nend\n\nwhen I receive [ded v]\ndelete\nif <([costume # v] of [lvls v]) = [3]> then\n    insert item at: [0] [0] costume [1]\nend\nif <([costume # v] of [lvls v]) = [4]> then\n    insert item at: [-120] [140] costume [4]\n    insert item at: [185] [140] costume [5]\nend\nif <([costume # v] of [lvls v]) = [5]> then\n    insert item at: [-10] [140] costume [3]\nend\nif <([costume # v] of [lvls v]) = [6]> then\n    insert item at: [-10] [-91] costume [7]\nend\nif <([costume # v] of [lvls v]) = [7]> then\n    insert item at: [-80] [50] costume [1]\n    insert item at: [60] [120] costume [1]\nend\nif <([costume # v] of [lvls v]) = [8]> then\n    insert item at: [-50] [-91] costume [7]\n    insert item at: [150] [-91] costume [7]\n    insert item at: [50] [80] costume [7]\nend\nif <([costume # v] of [lvls v]) = [10]> then\n    insert item at: [0] [-50] costume [4]\nend\nif <([costume # v] of [lvls v]) = [11]> then\n    insert item at: [-125] [140] costume [1]\n    insert item at: [30] [-70] costume [1]\n    insert item at: [190] [140] costume [4]\nend\nif <([costume # v] of [lvls v]) = [12]> then\n    insert item at: [-120] [140] costume [3]\n    insert item at: [90] [100] costume [5]\nend\nif <([costume # v] of [lvls v]) = [13]> then\n    insert item at: [-100] [140] costume [2]\n    insert item at: [120] [40] costume [3]\nend\nif <([costume # v] of [lvls v]) = [14]> then\n    insert item at: [-105] [60] costume [1]\n    insert item at: [50] [130] costume [1]\nend\nif <([costume # v] of [lvls v]) = [15]> then\n    insert item at: [-50] [-60] costume [2]\n    insert item at: [95] [-60] costume [2]\nend\nif <([costume # v] of [lvls v]) = [16]> then\n    insert item at: [60] [40] costume [1]\n    insert item at: [-80] [120] costume [1]\nend\nif <([costume # v] of [lvls v]) = [17]> then\n    insert item at: [10] [40] costume [3]\nend\n\nwhen I receive [done v]\ndelete this clone\n\nwhen I start as a clone\nif <(costume [number v]) = [7]> then\n    wait (0.1) seconds\n    forever\n        if <touching (guy v)?> then\n            broadcast (ded v)\n        end\n    end\nend\n\ndefine delete\ndelete this clone\n\nwhen I receive [before start v]\nset size to (100) %\npoint in direction (90)\nhide\nwait (1) seconds\nwait until <([costume # v] of [lvls v]) = [3]>\ninsert item at: [0] [0] costume [1]\nwait until <([costume # v] of [lvls v]) = [4]>\ninsert item at: [-120] [140] costume [4]\ninsert item at: [185] [140] costume [5]\nwait until <([costume # v] of [lvls v]) = [5]>\ninsert item at: [-10] [140] costume [3]\nwait until <([costume # v] of [lvls v]) = [6]>\ninsert item at: [-10] [-91] costume [7]\nwait until <([costume # v] of [lvls v]) = [7]>\ninsert item at: [-80] [50] costume [1]\ninsert item at: [60] [120] costume [1]\nwait until <([costume # v] of [lvls v]) = [8]>\ninsert item at: [-50] [-91] costume [7]\ninsert item at: [150] [-91] costume [7]\ninsert item at: [50] [80] costume [7]\nwait until <([costume # v] of [lvls v]) = [9]>\nbroadcast (nature time v)\nwait until <([costume # v] of [lvls v]) = [10]>\ninsert item at: [0] [-50] costume [4]\nwait until <([costume # v] of [lvls v]) = [11]>\ninsert item at: [-125] [140] costume [1]\ninsert item at: [30] [-70] costume [1]\ninsert item at: [190] [140] costume [4]\nwait until <([costume # v] of [lvls v]) = [12]>\ninsert item at: [-120] [140] costume [3]\ninsert item at: [90] [100] costume [5]\nwait until <([costume # v] of [lvls v]) = [13]>\ninsert item at: [-100] [140] costume [2]\ninsert item at: [120] [40] costume [3]\nwait until <([costume # v] of [lvls v]) = [14]>\ninsert item at: [-105] [60] costume [1]\ninsert item at: [50] [130] costume [1]\nwait until <([costume # v] of [lvls v]) = [15]>\ninsert item at: [-50] [-60] costume [2]\ninsert item at: [95] [-60] costume [2]\nwait until <([costume # v] of [lvls v]) = [16]>\ninsert item at: [60] [40] costume [1]\ninsert item at: [-80] [120] costume [1]\nwait until <([costume # v] of [lvls v]) = [17]>\ninsert item at: [10] [40] costume [3]\nwait until <([costume # v] of [lvls v]) = [20]>\nplay sound [YOU WON! v] until done\n\nwhen I receive [before start v]\nforever\n    change [turnzzz v] by (1)\nend\n\n@lvls\n\nwhen flag clicked\nhide\n\nwhen I receive [done v]\nnext costume\n\nwhen I receive [before start v]\nshow\ngo to [back v] layer\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\n\n@bad stuff\n\nwhen flag clicked\nhide\n\nwhen I receive [done v]\nnext costume\n\nwhen I receive [before start v]\nshow\ngo to [back v] layer\nswitch costume to (costume1 v)\n\n@words\n\nwhen flag clicked\nhide\n\nwhen I receive [done v]\nnext costume\n\nwhen I receive [before start v]\nswitch costume to (costume1 v)\ngo to [front v] layer\ngo to x: (0) y: (0)\nshow\n\n@tumb\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    set [ghost v] effect to (100)\n    go to [front v] layer\n    show\nend\n\n@Intro\n\nwhen I start as a clone\nif <(size) = [70]> then\n    show\n    go to x: (0) y: (-110)\n    set [ghost v] effect to (100)\n    set size to (100) %\n    go to [front v] layer\n    switch costume to (corpcooga v)\n    repeat (5)\n        change [ghost v] effect by (-20)\n    end\n    wait (0.5) seconds\n    repeat (10)\n        wait (0.01) seconds\n        change [ghost v] effect by (10)\n    end\nend\n\nwhen flag clicked\nwait until <mouse down?>\nwait until <not <mouse down?>>\nstop all sounds\nstart sound [Teleport v]\nhide\nbroadcast (before start v)\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen flag clicked\nset volume to (100) %\nstart sound [Intro music v]\nshow\ngo to [front v] layer\ngo to x: (-240) y: (0)\npoint in direction (-150)\nswitch costume to (op v)\nset [ghost v] effect to (100)\nset [vel v] to [30]\nset size to (30) %\nrepeat until <(x position) = [0]>\n    change x by (vel)\n    turn right (vel) degrees\n    change [ghost v] effect by ((vel) * (-0.5))\n    change size by ((vel) / (6))\n    change [vel v] by (-2)\nend\nset size to (71) %\ncreate clone of (_myself_ v)\nset size to (70) %\ncreate clone of (_myself_ v)\nrepeat (15)\n    set [bounce v] to (((bounce) * (0.7)) + ((80.5) - (size)))\n    change size by (bounce)\nend\nset size to (80) %\nwait (0.2) seconds\npoint in direction (90)\nset [sine v] to [0]\nrepeat (15)\n    point in direction ((90) + (([tan v] of ((sine) * (8)) ) * (10)))\nend\npoint in direction (90)\nset [size vel v] to [18]\nrepeat until <(size vel) < [2]>\n    change [size vel v] by (-2)\n    change size by (size vel)\n    turn left ((size vel) * (4)) degrees\nend\nset [sine v] to [0]\nrepeat until <(x position) < [0]>\n    set x to (([tan v] of ((sine) * (8)) ) * (20))\n    turn right (([tan v] of ((sine) * (8)) ) * (20)) degrees\nend\nrepeat until <(x position) > [0]>\n    set x to (([tan v] of ((sine) * (8)) ) * (20))\n    turn right (((90) - (direction)) / (3)) degrees\nend\nrepeat until <(size vel) < [-17]>\n    change [size vel v] by (-2)\n    change size by ((size vel) / (1.25))\n    turn left ((size vel) * (4)) degrees\nend\npoint in direction (90)\nset x to (0)\nwait (0.5) seconds\ncreate clone of (_myself_ v)\nwait (0.9) seconds\nhide\nwait (1) seconds\nstop [other scripts in sprite v]\nbroadcast (before start v)\n\nwhen I start as a clone\nif <(size) = [80]> then\n    set [sizevel v] to [30]\n    go to x: (0) y: (0)\n    switch costume to (costume1 v)\n    set size to (30) %\n    show\n    go to [front v] layer\n    repeat (30)\n        switch costume to (hax v)\n        change size by (sizevel)\n        change [sizevel v] by (-1)\n        switch costume to (costume1 v)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(size) = [71]> then\n    set size to (100) %\n    go to [front v] layer\n    switch costume to (poof-0 v)\n    repeat (13)\n        wait (0.005) seconds\n        next costume\n    end\n    delete this clone\nend\n\nwhen flag clicked\nforever\n    change [sine v] by (1)\nend\n\nwhen I start as a clone\nforever\n    if <mouse down?> then\n        delete this clone\n    end\nend\n\n