VEct0rIzED - A Platformer 


@Stage\n\nwhen flag clicked\nset [deaths v] to [0]\nset [deathsonlevel6 v] to [0]\nset [player_touched_cloud? v] to [0]\n\n@V\n\nwhen flag clicked\nswitch costume to (costume1 v)\nclear graphic effects\ngo to [front v] layer\ngo to x: (0) y: (0)\nset size to (0) %\nbroadcast (message1 v)\ngo [backward v] (1) layers\n\nwhen I receive [message1 v]\nhide\nwait (0.7) seconds\nshow\nrepeat (20)\n    change size by (((150) - (size)) / (5))\nend\nwait (0.3) seconds\nrepeat (20)\n    change size by (((75) - (size)) / (3))\nend\nrepeat (10)\n    change x by (((-80) - (x position)) / (3))\nend\nwait (2) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nbroadcast (begin v)\n\nwhen I receive [lightning v]\nplay sound [lightning.mp3 v] until done\n\nwhen I receive [rain v]\nrepeat until <(raining?) = [0]>\n    play sound [rain.mp3 v] until done\nend\n\nwhen I receive [stoprain v]\nstop [other scripts in sprite v]\nbroadcast (restart sounds v)\n\nwhen flag clicked\nforever\n    set volume to ((100) * (sounds_on?)) %\nend\n\nwhen I receive [restart sounds v]\nforever\n    set volume to ((100) * (sounds_on?)) %\nend\n\n@player\n\nwhen I receive [begin v]\ngo to x: (-222) y: (180)\nswitch costume to (costume1 v)\ngo to [front v] layer\nset size to (20) %\ngo [backward v] (5) layers\nshow\nset [y vel v] to [0]\nset [x vel v] to [0]\nforever\n    if <<(settings_open?) = [0]> or <(achieve_open?) = [0]>> then\n        Physics\n    else\n        hide\n    end\n    if <(level) = (levelCount)> then\n        switch costume to (costume2 v)\n    end\nend\n\nwhen flag clicked\nhide\n\ndefine Physics\nshow\nchange y by (y vel)\nif <touching (ground v)?> then\n    repeat ([abs v] of (y vel) )\n        if <touching (ground v)?> then\n            change y by (((y vel) / ([abs v] of (y vel) )) * (-1))\n        end\n    end\n    if <touching (ground v)?> then\n        change y by (y vel)\n    end\n    if <<(y vel) < [0.01]> and <key (up arrow v) pressed?>> then\n        set [y vel v] to [13]\n    else\n        set [y vel v] to [0]\n    end\nelse\n    change [y vel v] by (-1)\nend\nif <key (right arrow v) pressed?> then\n    change [x vel v] by (1.4)\nend\nif <key (left arrow v) pressed?> then\n    change [x vel v] by (-1.4)\nend\nchange x by (x vel)\nif <touching (ground v)?> then\n    set [old_y v] to (y position)\n    repeat (([abs v] of (x vel) ) + (1))\n        if <touching (ground v)?> then\n            change y by (1)\n        end\n    end\n    if <touching (ground v)?> then\n        set y to (old_y)\n        repeat ([ceiling v] of ([abs v] of (x vel) ) )\n            if <touching (ground v)?> then\n                change x by (((x vel) / ([abs v] of (x vel) )) * (-1))\n            end\n        end\n        if <touching (ground v)?> then\n            change x by (([ceiling v] of ([abs v] of (x vel) ) ) * ((x vel) / ([abs v] of (x vel) )))\n        end\n        set [x vel v] to [0]\n    end\nend\nset [x vel v] to ((x vel) * (0.8))\nif <(x position) > [222]> then\n    go to x: (-222) y: (0)\n    set [y vel v] to [0]\n    change [level v] by (1)\nend\nif <(y position) < [-169]> then\n    go to x: (-222) y: (0)\n    set [y vel v] to [0]\n    change [deaths v] by (1)\n    if <(level) = [6]> then\n        change [deathsonlevel6 v] by (1)\n    end\nend\n\nshow\nchange y by (y vel)\nif <touching (ground v)?> then\n    repeat ([abs v] of (y vel) )\n        if <touching (ground v)?> then\n            change y by (((y vel) / ([abs v] of (y vel) )) * (-1))\n        end\n    end\n    if <touching (ground v)?> then\n        change y by (y vel)\n    end\n    if <<(y vel) < [0.01]> and <key (up arrow v) pressed?>> then\n        set [y vel v] to [13]\n    else\n        set [y vel v] to [0]\n    end\nelse\n    change [y vel v] by (-1)\nend\nif <key (right arrow v) pressed?> then\n    change [x vel v] by (1.4)\nend\nif <key (left arrow v) pressed?> then\n    change [x vel v] by (-1.4)\nend\nchange x by (x vel)\nif <touching (ground v)?> then\n    set [old_y v] to (y position)\n    repeat (([abs v] of (x vel) ) + (1))\n        if <touching (ground v)?> then\n            change y by (1)\n        end\n    end\n    if <touching (ground v)?> then\n        set y to (old_y)\n        repeat ([ceiling v] of ([abs v] of (x vel) ) )\n            if <touching (ground v)?> then\n                change x by (((x vel) / ([abs v] of (x vel) )) * (-1))\n            end\n        end\n        if <touching (ground v)?> then\n            change x by (([ceiling v] of ([abs v] of (x vel) ) ) * ((x vel) / ([abs v] of (x vel) )))\n        end\n        set [x vel v] to [0]\n    end\nend\nset [x vel v] to ((x vel) * (0.8))\nif <(x position) > [222]> then\n    go to x: (-222) y: (0)\n    set [y vel v] to [0]\n    change [level v] by (1)\nend\nif <(y position) < [-169]> then\n    go to x: (-222) y: (0)\n    set [y vel v] to [0]\n    change [deaths v] by (1)\n    if <(level) = [6]> then\n        change [deathsonlevel6 v] by (1)\n    end\nend\n\n@ground\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [level v] to [1]\nhide\ngo [backward v] (3) layers\n\nwhen I receive [begin v]\nshow\nforever\n    switch costume to (level)\nend\n\n@clouds\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\nwhen I start as a clone\nswitch costume to (pick random (1) to (2))\nset size to (pick random (50) to (200)) %\nshow\ngo to x: (240) y: (pick random (100) to (160))\nrepeat until <(x position) < [-240]>\n    change x by (-3)\n    if <touching (player v)?> then\n        set [player_touched_cloud? v] to [1]\n    end\nend\ndelete this clone\n\nwhen I receive [begin v]\nforever\n    if <(clouds_on?) = [1]> then\n        wait (pick random (1.5) to (4)) seconds\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I receive [rain v]\nrepeat (10)\n    change [brightness v] effect by (-2)\nend\n\nwhen I receive [stoprain v]\nrepeat (10)\n    change [brightness v] effect by (2)\nend\n\n@sun/moon\n\nwhen flag clicked\nset size to (80) %\nswitch costume to (costume1 v)\nhide\ngo [backward v] (1) layers\n\nwhen I receive [begin v]\nforever\n    show\n    go to x: (-240) y: (170)\n    repeat until <(x position) > [240]>\n        change x by (0.1)\n    end\n    hide\n    wait (1) seconds\n    next costume\nend\n\nwhen I receive [rain v]\nrepeat (10)\n    change [brightness v] effect by (-5)\nend\n\nwhen I receive [stoprain v]\nrepeat (10)\n    change [brightness v] effect by (5)\nend\n\n@background\n\nwhen flag clicked\ngo [backward v] (500) layers\ngo to x: (0) y: (0)\nswitch costume to (costume2 v)\nset [brightness v] to [0]\n\nwhen I receive [lightning v]\nset [old_bright v] to (brightness)\nset [brightness v] to [90]\nwait (0.2) seconds\nset [brightness v] to (old_bright)\n\nwhen I receive [begin v]\nshow\nforever\n    repeat (4800)\n        change [brightness v] by (-0.02083)\n    end\n    repeat (4800)\n        change [brightness v] by (0.02083)\n    end\nend\n\nwhen I receive [begin v]\nforever\n    set [brightness v] effect to (brightness)\nend\n\n@rain\n\nwhen I receive [rain v]\nrepeat until <(raining?) = [0]>\n    broadcast (lightning v)\n    wait (pick random (6) to (8)) seconds\nend\n\nwhen I start as a clone\nshow\ngo to x: (pick random (-240) to (240)) y: (180)\nrepeat (30)\n    change y by (-15)\nend\ndelete this clone\n\nwhen flag clicked\nhide\ngo to [front v] layer\n\nwhen I receive [begin v]\nforever\n    set [raining? v] to [0]\n    wait (pick random (9) to (11)) seconds\n    broadcast (rain v)\n    set [raining? v] to [1]\n    repeat (pick random (600) to (2000))\n        create clone of (_myself_ v)\n    end\n    broadcast (stoprain v)\nend\n\n@Raleway\n\nwhen flag clicked\nset size to (117) %\nswitch costume to (raleway b v)\ngo to x: (-45) y: (0)\nhide\nwait (2.1) seconds\nshow\nrepeat (10)\n    change x by (((70) - (x position)) / (3))\nend\ncreate clone of (_myself_ v)\nwait (2) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen I start as a clone\nset size to (80) %\nswitch costume to (raleway b2 v)\ngo to x: (0) y: (-100)\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\n@thumb\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nswitch costume to (stage v)\nshow\nforever\n    go to [front v] layer\nend\n\n@settings\n\nwhen flag clicked\nset [settings_open? v] to [0]\ngo to x: (200) y: (150)\nhide\ngo [backward v] (1) layers\n\nwhen I receive [begin v]\nswitch costume to (costume1 v)\nshow\n\nwhen this sprite clicked\nset [settings_open? v] to ((1) - (settings_open?))\nif <([costume # v] of [settings v]) = [1]> then\n    broadcast (open settings v)\n    go to x: (150) y: (150)\nelse\n    broadcast (close settings v)\n    go to x: (200) y: (150)\nend\nnext costume\n\n@settings blur\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo [backward v] (2) layers\nset [ghost v] effect to (45)\nhide\n\nwhen I receive [close settings v]\nhide\n\nwhen I receive [open settings v]\nshow\n\nwhen I receive [close achieve v]\nhide\n\nwhen I receive [open achieve v]\nshow\n\n@options\n\nwhen flag clicked\nhide\ngo [backward v] (1) layers\n\nwhen I receive [close settings v]\nhide\n\nwhen I receive [open settings v]\ngo to x: (-100) y: (0)\nshow\nswitch costume to (options1 v)\nrepeat (2)\n    create clone of (_myself_ v)\n    change y by (-50)\n    next costume\nend\n\nwhen I start as a clone\nshow\nwait until <(settings_open?) = [0]>\ndelete this clone\n\n@toggle1\n\nwhen flag clicked\nset [sounds_on? v] to [1]\nset [clouds_on? v] to [1]\nhide\ngo to [front v] layer\ngo [backward v] (1) layers\n\nwhen I receive [close settings v]\nhide\n\nwhen I receive [open settings v]\ngo to x: (10) y: (0)\nshow\nrepeat until <(settings_open?) = [0]>\n    switch costume to ((2) - (sounds_on?))\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        set [sounds_on? v] to ((1) - (sounds_on?))\n        wait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n    end\nend\n\n@toggle2\n\nwhen flag clicked\nset [sounds_on? v] to [1]\nset [clouds_on? v] to [1]\ngo to [front v] layer\ngo [backward v] (1) layers\nhide\n\nwhen I receive [close settings v]\nhide\n\nwhen I receive [open settings v]\ngo to x: (10) y: (-63)\nshow\nrepeat until <(settings_open?) = [0]>\n    switch costume to ((2) - (clouds_on?))\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        set [clouds_on? v] to ((1) - (clouds_on?))\n        wait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n    end\nend\n\n@toggle3\n\nwhen flag clicked\nset [sounds_on? v] to [1]\nset [clouds_on? v] to [1]\nhide\ngo to [front v] layer\ngo [backward v] (1) layers\n\nwhen I receive [close settings v]\nhide\n\nwhen I receive [open settings v]\ngo to x: (10) y: (-116)\nshow\nrepeat until <(settings_open?) = [0]>\n    switch costume to ((2) - (music_on?))\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        set [music_on? v] to ((1) - (music_on?))\n        wait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n    end\nend\n\n@achievements\n\nwhen flag clicked\nset [levelcount v] to [13]\ndelete (all) of [achieved v]\nhide\nrepeat (6)\n    add [0] to [achieved v]\nend\n\ndefine None\nset size to (100) %\nclear graphic effects\nif <(item (achieve_num) of [achieved v]) = [0]> then\n    go to x: (0) y: (78)\n    switch costume to (achieve_num)\n    show\n    repeat (13)\n        change y by (-6)\n    end\n    wait (1) seconds\n    repeat (13)\n        change y by (6)\n    end\n    hide\n    replace item (achieve_num) of [achieved v] with [1]\nend\n\nwhen flag clicked\ngo to x: (0) y: (78)\nwait (1) seconds\nforever\n    if <<(deathsOnLevel6) = [0]> and <(level) = [7]>> then\n        show achievement (4)\n    else\n        if <(level) = [2]> then\n            show achievement (2)\n        else\n            if <(level) = [6]> then\n                show achievement (3)\n            else\n                if <(player_touched_cloud?) = [1]> then\n                    show achievement (1)\n                else\n                end\n            end\n        end\n    end\n    if <(level) = (levelCount)> then\n        show achievement (6)\n        if <(deaths) = [0]> then\n            show achievement (5)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    play sound [Vexento - Inspire.mp3 v] until done\nend\n\nwhen flag clicked\nset [music_on? v] to [1]\nforever\n    set volume to ((100) * (music_on?)) %\nend\n\n@end\n\nwhen flag clicked\nshow\ngo [backward v] (3) layers\nforever\n    set [ghost v] effect to ((100) * <not <(level) = (levelCount)>>)\n    set [brightness v] effect to (100)\nend\n\n@trees\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume2 v)\ngo [backward v] (1002) layers\nset [brightness v] to [0]\n\nwhen I receive [begin v]\nshow\n\nwhen I receive [begin v]\nforever\n    switch costume to (level)\nend\n\n@see achievements\n\nwhen flag clicked\nset [achieve_open? v] to [0]\ngo to x: (-200) y: (150)\nhide\ngo [backward v] (1) layers\n\nwhen this sprite clicked\nset [achieve_open? v] to ((1) - (achieve_open?))\nif <(achieve_open?) = [1]> then\n    broadcast (open achieve v)\n    go to x: (-200) y: (150)\nelse\n    broadcast (close achieve v)\n    go to x: (-200) y: (150)\nend\nnext costume\n\nwhen I receive [begin v]\nswitch costume to (costume1 v)\nshow\n\n@achievements2\n\nwhen I receive [open achieve v]\nswitch costume to (costume1 v)\nset [clone_id v] to [1]\ngo to x: (0) y: (0)\nrepeat (6)\n    set [ghost v] effect to ((50) * ((1) - (item (clone_id) of [achieved v])))\n    create clone of (_myself_ v)\n    next costume\n    change y by (-43)\n    change [clone_id v] by (1)\nend\n\nwhen I start as a clone\nshow\nset size to (46) %\ngo to [front v] layer\nwait until <(achieve_open?) = [0]>\ndelete this clone\n\n@Achieve title\n\nwhen flag clicked\ngo to x: (0) y: (100)\ngo [backward v] (1) layers\nhide\n\nwhen I receive [open achieve v]\nswitch costume to (raleway b v)\nshow\n\nwhen I receive [close achieve v]\nhide\n\nwhen I receive [open settings v]\nswitch costume to (raleway b2 v)\nshow\n\nwhen I receive [close settings v]\nhide\n\n