Glow - A Platformer
@Stage\n\nwhen I receive [introisdone v]\nwait (3) seconds\nset [level v] to [1]\n\nwhen I receive [100%volume v]\nrepeat (10)\n    change volume by (10)\nend\n\nwhen I receive [mute v]\nrepeat (10)\n    change volume by (-10)\nend\n\nwhen I receive [introisdone v]\nset [real time v] to [0]\nforever\n    change [real time v] by (0.1)\n    wait (0.03) seconds\nend\n\nwhen flag clicked\nset [level v] to [1]\n\nwhen flag clicked\nreset timer\nset volume to (100) %\nwait (13) seconds\nforever\n    play sound [GloriousMorning v] until done\n    play sound [GloriousMorning\(2\) v] until done\nend\n\n@Intro\n\nwhen flag clicked\nset [cloneid v] to [0]\nswitch costume to (costume1 v)\nset volume to (100) %\npoint in direction (90)\nclear graphic effects\nshow\nstart sound [Teminite & Panda Eyes - Highscore v]\nstart sound [sound1 v]\npoint in direction (-179)\nset [rqz v] to [0]\ngo to x: (0) y: (0)\nset size to (800) %\nswitch costume to (theoraclepro v)\nrepeat (30)\n    change size by (((99.3) - (size)) / (5))\n    turn right (((90) - (direction)) / (5)) degrees\n    create clone of (_myself_ v)\n    go to [front v] layer\nend\nset [cloneid v] to [1]\nwait (3) seconds\nset size to (100) %\nrepeat (7)\n    set [intro1 v] to [70]\n    set [intro2 v] to (pick random (70) to (110))\n    set [intro3 v] to (pick random (-1) to (1))\n    repeat (17)\n        create clone of (_myself_ v)\n        set [brightness v] effect to (Intro1)\n        set [intro1 v] to ((Intro1) * (0.7))\n        set size to ((90) + (Intro1)) %\n        point in direction ((Intro2) + (((Intro1) / (4)) * (Intro3)))\n    end\nend\npoint in direction (90)\nwait (1) seconds\nup and down\nwait (1) seconds\nbroadcast (introisdone v)\nhide\n\ndefine up and down\nset [rqz v] to [0]\nset [cloneid v] to [0]\nwait (0.5) seconds\nstart sound [sound2 v]\nrepeat (10)\n    change volume by (-6)\n    change y by ((5) - ((y position) * (0.2)))\n    change [ghost v] effect by (2.5)\n    create clone of (_myself_ v)\nend\nrepeat (30)\n    change volume by (-1.5)\n    change y by (((5) - ((y position) * (0.2))) * (-1))\n    change [ghost v] effect by (3)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nrepeat (10)\n    change [brightness v] effect by (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nhide\n\n@Glow\n\nwhen I receive [play v]\nshow\ngo to [front v] layer\nset [ghost v] effect to (25)\nset [level v] to [1]\nforever\n    set size to ((90) + (([cos v] of ((Glow) * (300)) ) * (4))) %\n    go to (cube v)\n    go [backward v] (5) layers\nend\n\nwhen flag clicked\nhide\nset [time v] to [0]\nforever\n    change [time v] by (0.1)\n    change [glow v] by (0.05)\nend\n\nwhen I receive [introisdone v]\nhide\n\n@Cube\n\nwhen flag clicked\nhide\nforever\n    clear graphic effects\n    clear sound effects\nend\n\nwhen I receive [play v]\ngo to x: (-196) y: (-50)\nshow\nset [deaths v] to [0]\nset [level v] to [1]\nset [x v] to [0]\nset [y v] to [0]\nrepeat until <(level) = [17]>\n    go to [front v] layer\n    show\n    change [y v] by (-1)\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [x v] by (-1)\n    end\n    if <<key (right arrow v) pressed?> or <key (d 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 (5)\n    end\n    if <touching (ground v)?> then\n        change y by (-4)\n        change x by ((x) * (-1))\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [y v] to [10]\n            if <([abs v] of (x) ) = (x)> then\n                set [x v] to [-7]\n            else\n                set [x v] to [7]\n            end\n        else\n            set [x v] to [0]\n        end\n    end\n    change y by (y)\n    if <touching (ground v)?> then\n        change y by ((y) - ((y) * (2)))\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        set [y v] to [10]\n    end\n    change y by (1)\n    if <<(x position) = [240]> or <(x position) > [235]>> then\n        go to x: (-195) y: (-50)\n        change [level v] by (1)\n    end\n    if <(y position) < [-170]> then\n        go to x: (-195) y: (-50)\n        change [deaths v] by (1)\n    end\nend\nhide\n\nwhen I start as a clone\nswitch costume to (hitbox v)\nset rotation style [all around v]\nrepeat (20)\n    change size by (-5)\n    turn right (15) degrees\nend\ndelete this clone\n\ndefine Ground? <>\nrepeat until <not <touching (ground v)?>>\n    if <up?> then\n        change y by (-1)\n    else\n        change y by (1)\n    end\n    set [y v] to [0]\nend\n\nwhen I receive [play v]\nrepeat until <(level) = [17]>\n    create clone of (_myself_ v)\n    wait (0.5) seconds\nend\n\nset [y v] to [0]\n\nchange [y v] by (1)\n\nset [y v] to [0]\nrepeat until <not <touching (ground v)?>>\n    if <(y) > [0]> then\n        change y by (-1)\n    else\n    end\nend\n\nGround? <(y) > [0]>\n\n@Ground\n\nwhen I receive [play v]\nshow\ngo to x: (0) y: (0)\nset [level v] to [1]\ngo to [front v] layer\nforever\n    switch costume to (level)\n    if <(level) = [17]> then\n        broadcast (introisdone v)\n        hide\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nhide\n\n@Bubbles\n\nwhen flag clicked\nhide\nforever\n    create clone of (_myself_ v)\n    wait (5) seconds\nend\n\nwhen I start as a clone\ngo [backward v] (5) layers\npoint in direction (pick random (0) to (360))\ngo to (random position v)\nswitch costume to (pick random (1) to (3))\nset size to (pick random (300) to (500)) %\nset [ghost v] effect to (100)\nshow\nrepeat (30)\n    change [ghost v] effect by (-1)\nend\nwait (0.1) seconds\nrepeat (30)\n    change [ghost v] effect by (1)\nend\ndelete this clone\n\n@Light Beam\n\nwhen flag clicked\nhide\nforever\n    create clone of (_myself_ v)\n    wait (8) seconds\nend\n\nwhen I start as a clone\ngo [backward v] (3) layers\nswitch costume to (pick random (1) to (3))\ngo to x: (pick random (-200) to (240)) y: (0)\nset size to (pick random (150) to (300)) %\nset [ghost v] effect to (100)\nshow\nrepeat (20)\n    change [ghost v] effect by (-0.3)\n    if <(costume [number v]) = [1]> then\n        move (-1) steps\n    end\n    if <(costume [number v]) = [2]> then\n        move (-1.5) steps\n    end\n    if <(costume [number v]) = [3]> then\n        move (-2.5) steps\n    end\nend\nrepeat until <(x position) < [-240]>\n    if <(costume [number v]) = [1]> then\n        move (-1) steps\n    end\n    if <(costume [number v]) = [2]> then\n        move (-1.5) steps\n    end\n    if <(costume [number v]) = [3]> then\n        move (-2.5) steps\n    end\nend\nrepeat (20)\n    change [ghost v] effect by (2)\n    if <(costume [number v]) = [1]> then\n        move (-1) steps\n    end\n    if <(costume [number v]) = [2]> then\n        move (-1.5) steps\n    end\n    if <(costume [number v]) = [3]> then\n        move (-2.5) steps\n    end\nend\ndelete this clone\n\n@Button\n\ndefine None\nrepeat until <<(round (x position)) = (round (x))> and <(round (y position)) = (round (y))>>\n    change x by (((round (x)) - (round (x position))) / (speed))\n    change y by (((round (y)) - (round (y position))) / (speed))\n    go to [front v] layer\nend\ngo to x: (x) y: (y)\n\nchange size by (((100) - (size)) / (2))\n\nwhen flag clicked\n\nwhen I receive [play v]\nhide\nstop [other scripts in sprite v]\n\nset [npcy v] to [0]\n\ngo to (menu v)\n\nswitch costume to (costume6 v)\n\nstop [other scripts in sprite v]\n\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [introisdone v]\nset size to (100) %\ngo to x: (290) y: (-94)\ngo to [front v] layer\nshow\nSmooth Glide x: (-125) y: (-94) speed: (10)\nforever\n    go to [front v] layer\n    if <touching (mouse-pointer v)?> then\n        change size by (((120) - (size)) / (2))\n        if <mouse down?> then\n            broadcast (Play v)\n        end\n    else\n        change size by (((100) - (size)) / (2))\n    end\nend\n\nwhen flag clicked\nhide\n\ngo to x: (-127) y: (-94)\n\n@Text Engine\n\nwhen I receive [delete char txt v]\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I receive [play v]\nreset timer\nset [brightness v] effect to (100)\nstop [other scripts in sprite v]\nbroadcast (delete char txt v)\nrepeat until <(level) = [17]>\n    print (timer) size (200) spacing (13) y (160) delete clone? [1] x: (0) alignment? [m]\n    print (join (join [deaths:] []) (deaths)) size (200) spacing (13) y (141) delete clone? [0] x: (0) alignment? [m]\nend\nif <(☁ Least Deaths) > (deaths)> then\n    set [☁ least deaths v] to (deaths)\nend\nif <(☁ highscore time) > (timer)> then\n    set [☁ highscore time v] to (timer)\nend\n\ndefine None\nif <(string2) = [1]> then\n    broadcast (delete char txt v)\nend\nset [i v] to [0]\nset [brightness v] effect to (0)\nset size to (number1) %\nif <(string3) = [m]> then\n    go to x: (((((length of (string1)) * (((number2) * (0.9)) * (-0.5))) - (((number2) * (0.9)) / (2))) - (0)) + (x)) y: (number4)\nend\nif <(string3) = [l]> then\n    go to x: (x) y: (number4)\nend\nif <(string3) = [r]> then\n    go to x: ((x) - (((length of (string1)) - (1)) * (number2))) y: (number4)\nend\nrepeat (length of (string1))\n    change [i v] by (1)\n    switch costume to (letter (i) of (string1))\n    change x by ((number2) * (0.9))\n    create clone of (_myself_ v)\nend\n\nwhen I receive [introisdone v]\nbroadcast (delete char txt v)\nprint (join (join [highscore] (join [] [time:])) (round (☁ highscore time))) size (200) spacing (13) y (160) delete clone? [0] x: (-220) alignment? [l]\nprint (join (join [least] (join [] [deaths:])) (☁ Least Deaths)) size (200) spacing (13) y (160) delete clone? [0] x: (0) alignment? [l]\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (0)\nset [brightness v] effect to (100)\nforever\n    go to [front v] layer\nend\n\n@sound\n\nwhen flag clicked\nhide\ngo to x: (225) y: (165)\n\nwhen I receive [introisdone v]\nshow\nforever\n    switch costume to (sound v)\n    go to [front v] layer\n    go to x: (225) y: (165)\n    show\n    set [ghost v] effect to (100)\n    repeat (50)\n        change [ghost v] effect by (-2)\n    end\n    forever\n        go to [front v] layer\n        if <touching (mouse-pointer v)?> then\n            set [brightness v] effect to (20)\n        else\n            set [brightness v] effect to (0)\n        end\n        if <<mouse down?> and <touching (mouse-pointer v)?>> then\n            wait until <not <mouse down?>>\n            next costume\n            if <(costume [number v]) = [1]> then\n                broadcast (100%Volume v)\n            end\n            if <(costume [number v]) = [2]> then\n                broadcast (mute v)\n            end\n        end\n    end\nend\n\n@Confetti\n\ndefine Clone\nrepeat (20)\n    create clone of (_myself_ v)\n    create clone of (_myself_ v)\nend\nwait (1.9) seconds\nrepeat (50)\n    create clone of (_myself_ v)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\ngo to x: (((pick random (0) to (1)) * (480)) - (240)) y: (-180)\nswitch costume to (pick random (1) to (10))\nset [speed y v] to (pick random (10) to (30))\nif <(x position) > [0]> then\n    set [speed x v] to (pick random (-5) to (-20))\nelse\n    set [speed x v] to (pick random (5) to (20))\nend\nrepeat until <not <touching (_edge_ v)?>>\n    change [speed y v] by (-1)\n    set [speed x v] to ((Speed X) * (1))\n    change x by (Speed X)\n    change y by (Speed Y)\n    point in direction (pick random (1) to (90))\nend\nrepeat until <touching (_edge_ v)?>\n    change [speed y v] by (-1)\n    set [speed x v] to ((Speed X) * (1))\n    change x by (Speed X)\n    change y by (Speed Y)\n    point in direction (pick random (1) to (90))\nend\ndelete this clone\n\nwhen I receive [introisdone v]\nhide\nforever\n    if <(level) = [17]> then\n        repeat until <not <(level) = [17]>>\n            Clone\n            wait (0.5) seconds\n        end\n        stop [this script v]\n    end\nend\n\n@Thumbnail\n\nwhen flag clicked\nhide\n\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\n\n