Erupted || A Platformer

Instructions: ☆ ☆ ☆ INSTRUCTIONS ☆ ☆ ☆\n• Use arrow keys to move.\n• Don't touch the spikes.\n• Use a bounce pad to jump higher.\n• Jump on top of enemies to kill them. \nCheck my other account @--Cynic--\n(I'm no longer working on this account)

@Stage\n\nwhen flag clicked\nforever\n    set volume to (20) %\n    play sound [Water v] until done\nend\n\n@Intro\n\nwhen flag clicked\nswitch costume to (background v)\ncreate clone of (_myself_ v)\nswitch costume to (text v)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    forever\n        go to x: (0) y: (0)\n        point in direction (90)\n        set size to (100) %\n    end\nend\n\nwhen I start as a clone\nshow\n\nwhen I start as a clone\nif <(costume [number v]) = [2]> then\n    go to x: (0) y: (0)\n    repeat (55)\n        go to [front v] layer\n        change size by (1)\n    end\n    set size to (100) %\n    wait (4.5) seconds\n    broadcast (finished v)\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [3]> then\n    go to x: (0) y: (0)\n    set size to (pick random (35) to (125)) %\n    set [color v] effect to (pick random (-180) to (-60))\n    point in direction (pick random (-90) to (90))\n    glide (2) secs to (random position v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [4]> then\n    go to x: (0) y: (0)\n    set size to (pick random (35) to (125)) %\n    set [color v] effect to (pick random (-60) to (60))\n    point in direction (pick random (-90) to (90))\n    glide (2) secs to (random position v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [5]> then\n    go to x: (0) y: (0)\n    set size to (pick random (35) to (125)) %\n    set [color v] effect to (pick random (60) to (180))\n    point in direction (pick random (-90) to (90))\n    glide (2) secs to (random position v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\n\nwhen flag clicked\nwait (1.8) seconds\nreset timer\nforever\n    repeat until <(timer) > [2]>\n        switch costume to (particle1 v)\n        create clone of (_myself_ v)\n        switch costume to (particle2 v)\n        create clone of (_myself_ v)\n        switch costume to (particle3 v)\n    end\nend\n\nwhen flag clicked\nplay sound [mixkit-shot-light-energy-flowing-2589 v] until done\nset volume to (10) %\nrepeat (9)\n    change volume by (10)\nend\n\nwhen I receive [finished v]\nbroadcast (Start v)\ndelete this clone\n\n@Player\n\nwhen I start as a clone\nclear graphic effects\nrepeat (5)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I receive [next level v]\nbroadcast (Restart v)\n\nwhen I receive [restart v]\nset [x vel v] to [0]\nset [y vel v] to [0]\ngo to x: (-216) y: (40)\n\nwhen flag clicked\nforever\n    if <key (left arrow v) pressed?> then\n        point in direction (-90)\n    end\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n    end\nend\n\nwhen I receive [copleted! v]\nhide\n\nwhen flag clicked\nset [timer state v] to [stop]\nhide variable [timer v]\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nset [timer state v] to [timer]\nshow variable [timer v]\nset [timer v] to [0]\nforever\n    change [timer v] by (.1)\n    wait (.1) seconds\n    if <not <(timer state) = [timer]>> then\n        stop [this script v]\n    end\nend\n\nwhen I receive [start v]\nshow\nset [level v] to [1]\nbroadcast (Next Level v)\nforever\n    if <key (left arrow v) pressed?> then\n        change [x vel v] by (-1)\n    end\n    if <key (right arrow v) pressed?> then\n        change [x vel v] by (1)\n    end\n    set [x vel v] to ((x vel) * (0.9))\n    change x by (x vel)\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (-4)\n        change x by ((x vel) * (-1))\n        if <key (up arrow v) pressed?> then\n            if <(x vel) > [0]> then\n                set [x vel v] to [-10]\n            else\n                set [x vel v] to [-10]\n            end\n            set [y vel v] to [15]\n        else\n            set [x vel v] to [0]\n        end\n    end\n    if <touching (water v)?> then\n        change [y vel v] by (-0.5)\n    else\n        change [y vel v] by (-1)\n    end\n    change y by (y vel)\n    if <touching (level v)?> then\n        change y by ((y vel) - ((y vel) * (2)))\n        set [y vel v] to [0]\n    end\n    change y by (-1)\n    if <touching (water v)?> then\n        start sound [Splash v]\n        if <key (up arrow v) pressed?> then\n            set [y vel v] to [2]\n        end\n    else\n        if <<touching (level v)?> and <key (up arrow v) pressed?>> then\n            set [y vel v] to [15]\n        end\n    end\n    change y by (1)\n    create clone of (_myself_ v)\n    if <(x position) > [239]> then\n        change [level v] by (1)\n        broadcast (Next Level v) and wait\n    end\n    if <touching (spikes v)?> then\n        broadcast (Restart v)\n    end\n    if <touching (bounce pads v)?> then\n        start sound [Basketball Bounce v]\n        set [y vel v] to [19]\n    end\nend\n\n@Glow\n\nwhen flag clicked\nshow\ngo [backward v] (50) layers\nforever\n    go to (player v)\nend\n\n@Level\n\nwhen flag clicked\nset [level v] to [1]\nforever\n    if <(LEVEL) = [11]> then\n        broadcast (Copleted! v)\n    end\nend\n\nwhen I receive [copleted! v]\nset [timer state v] to [stop]\nstop [other scripts in sprite v]\n\nwhen flag clicked\nshow\ngo to [back v] layer\nforever\n    switch costume to (LEVEL)\nend\n\n@Spikes\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    switch costume to (LEVEL)\nend\n\n@Bounce Pads\n\ndefine Clone at x: (x) y: (y)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [restart v]\nif  then\n    delete this clone\nend\nif <(LEVEL) = [3]> then\n    Clone at x: [-134] y: [-118]\nend\nif <(LEVEL) = [6]> then\n    Clone at x: [-130] y: [-118]\nend\n\nwhen I start as a clone\nforever\n    show\n    if <touching (player v)?> then\n        switch costume to (crouch v)\n        wait (0.1) seconds\n    else\n        switch costume to (idle v)\n    end\nend\n\n@Water\n\nwhen flag clicked\nforever\n    set [tide v] to [0]\n    repeat (10)\n        change [tide v] by (1)\n    end\n    repeat (20)\n        change [tide v] by (-1)\n    end\n    repeat (10)\n        change [tide v] by (1)\n    end\nend\n\nwhen flag clicked\nset [ghost v] effect to (20)\ngo to [back v] layer\nforever\n    set y to (tide)\n    switch costume to (LEVEL)\nend\n\n@Enemy\n\ndefine Clone at x: (x) y: (y)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    show\n    point towards (player v)\n    if <([x position v] of [player v]) < (x position)> then\n        change [x vel v] by (-0.5)\n    end\n    if <(x position) < ([x position v] of [player v])> then\n        change [x vel v] by (0.5)\n    end\n    set [x vel v] to ((x vel) * (0.9))\n    change x by (x vel)\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (-4)\n        change x by ((x vel) * (-1))\n        if <(([y position v] of [player v]) - (50)) > (y position)> then\n            if <(x vel) > [0]> then\n                set [x vel v] to [-10]\n            else\n                set [x vel v] to [-10]\n            end\n            set [y vel v] to [15]\n        else\n            set [x vel v] to [0]\n        end\n    end\n    if <touching (water v)?> then\n        change [y vel v] by (-0.5)\n    else\n        change [y vel v] by (-1)\n    end\n    change y by (y vel)\n    if <touching (level v)?> then\n        change y by ((y vel) - ((y vel) * (2)))\n        set [y vel v] to [0]\n    end\n    change y by (-1)\n    if <touching (water v)?> then\n        if <(([y position v] of [player v]) - (50)) > (y position)> then\n            set [y vel v] to [2]\n        end\n    else\n        if <<touching (level v)?> and <(([y position v] of [player v]) - (50)) > (y position)>> then\n            set [y vel v] to [15]\n        end\n    end\n    change y by (1)\n    if <touching (spikes v)?> then\n        delete this clone\n    end\n    if <touching (bounce pads v)?> then\n        set [y vel v] to [19]\n    end\n    if <touching (player v)?> then\n        change y by (-1)\n        if <<touching (level v)?> and <(([y position v] of [player v]) - (5)) > (y position)>> then\n            delete this clone\n        else\n            broadcast (Restart v)\n        end\n        change y by (1)\n    end\nend\n\nwhen I receive [restart v]\nif  then\n    delete this clone\nend\nif <(LEVEL) = [4]> then\n    Clone at x: [185] y: [20]\nend\nif <(LEVEL) = [7]> then\n    Clone at x: [185] y: [20]\nend\nif <(LEVEL) = [7]> then\n    Clone at x: [110] y: [77]\nend\n\n@Text Renderer\n\ndefine type (text) at x: (x) y: (y)\nswitch costume to ( v)\ngo to x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\nset [# v] to [0]\nrepeat (length of (text))\n    change [# v] by (1)\n    set [asset v] to (letter (#) of (text))\n    create clone of (_myself_ v)\nend\nwait (2) seconds\nbroadcast (Clear v)\n\ndefine clone setup\nswitch costume to (asset)\nrepeat (#)\n    change x by (15)\n    if <(x position) > [175]> then\n        set x to (x)\n        change y by (-18)\n    end\nend\n\nwhen I start as a clone\nclone setup\n\nwhen I receive [clear v]\ndelete this clone\n\nwhen flag clicked\nforever\n    if <(LEVEL) = [1]> then\n        type [phew! nothing yet.] at x: [-130] y: [150]\n        wait until <(LEVEL) = [2]>\n        type [wow! are those spikes.] at x: [-160] y: [150]\n        wait until <(LEVEL) = [3]>\n        type [i always wanted to use a bounce pad.] at x: [-170] y: [150]\n        wait until <(LEVEL) = [4]>\n        type [who is that! will he kill me.] at x: [-150] y: [150]\n        wait until <(LEVEL) = [5]>\n        type [how do i "wall jump".] at x: [-150] y: [150]\n        wait until <(LEVEL) = [6]>\n        type [so many obstacles!] at x: [-150] y: [150]\n        wait until <(LEVEL) = [7]>\n        type [why are there two killers!] at x: [-220] y: [150]\n        wait until <(LEVEL) = [8]>\n        type [are those spikes under the water.] at x: [-220] y: [150]\n        wait until <(LEVEL) = [9]>\n        type [is this a maze!] at x: [-120] y: [150]\n        wait until <(LEVEL) = [10]>\n        type [well this is easy!] at x: [-140] y: [150]\n    end\nend\n\n@notifier\n\nwhen flag clicked\ngo to x: (0) y: (50)\ngo to [front v] layer\nhide\nwait (pick random (8) to (15)) seconds\nshow\nrepeat until <(y position) < [6]>\n    change y by (((5) - (y position)) / (6))\nend\nwait (3.5) seconds\nrepeat until <(y position) > [49.5]>\n    change y by (((y position) + (5)) / (5))\nend\nhide\nforever\n    wait (pick random (14) to (26)) seconds\n    show\n    repeat until <(y position) < [6]>\n        change y by (((5) - (y position)) / (6))\n    end\n    wait (3.5) seconds\n    repeat until <(y position) > [49.5]>\n        change y by (((y position) + (5)) / (5))\n    end\n    hide\nend\n\nwhen I receive [tick v]\n\n@Thumbnail\n\nwhen flag clicked\nhide\n\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\nhide variable [timer v]\n\n@Completed\n\nwhen I receive [copleted! v]\nshow\nplay sound [Win v] until done\nstop [all v]\n\nwhen flag clicked\nhide\n\n