Snowhere | A Platformer

Instructions: \n\n\n\n\n\n

@Stage\n\nwhen flag clicked\nswitch backdrop to (load v) and wait\nwait (2.5) seconds\nswitch backdrop to (fullscreen! v) and wait\nwait (2) seconds\nswitch backdrop to (tumbnail v) and wait\n\nwhen flag clicked\nset [level: v] to [1]\n\nwhen I receive [next terrain... v]\nchange [level: v] by (1)\n\nwhen I receive [hide game over v]\nwait (0.2) seconds\nswitch backdrop to (winning screen v) and wait\n\nwhen flag clicked\nset [switch to thumbnail v] to []\n\nwhen I receive [hide game over v]\nforever\n    if <(Switch to thumbnail) = [go]> then\n        set [ghost v] effect to (100)\n        switch backdrop to (tumbnail v)\n        repeat (10)\n            wait (0.2) seconds\n            change [ghost v] effect by (-10)\n        end\n        stop [this script v]\n    end\nend\n\nwhen backdrop switches to [winning screen v]\nrepeat until <(Switch to thumbnail) = [go]>\n    if <key (space v) pressed?> then\n        set [switch to thumbnail v] to [go]\n    end\nend\n\nwhen I receive [go v]\nswitch backdrop to (background v) and wait\n\nwhen I receive [go v]\nset volume to (0) %\nwait (2.5) seconds\nset volume to (100) %\nforever\n    play sound [Vexento - Snowflakes v] until done\nend\n\nwhen flag clicked\nswitch backdrop to (load v) and wait\nwait (2.5) seconds\nswitch backdrop to (fullscreen! v) and wait\nwait (2) seconds\nswitch backdrop to (tumbnail v) and wait\n\n@Ground\n\nwhen I receive [go v]\nshow\n\nwhen flag clicked\nhide\ngo to x: (5) y: (-20)\nswitch costume to (costume1 v)\n\nwhen I receive [next terrain... v]\nnext costume\n\nwhen flag clicked\nforever\n    if <(Level:) = [9]> then\n        broadcast (Turn Level 9 v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level:) = [8]> then\n        broadcast (Turn level 8 v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level:) = [12]> then\n        broadcast (Turn level 12 v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level:) = [13]> then\n        broadcast (hide game over v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [hide game over v]\nhide\n\n@Mr. Sphere\n\nwhen flag clicked\nforever\n    run and jump\nend\n\nwhen flag clicked\nhide\ngo to x: (-218) y: (-100)\n\nrepeat until <(I recived go) = [1]>\nend\n\nwhen I receive [go v]\nshow\nwait (0.5) seconds\ngo to x: (-216) y: (3)\n\nwhen I receive [go v]\nforever\n    if <touching (snow v)?> then\n        broadcast (Next Terrain... v)\n    end\nend\n\nwhen I receive [next terrain... v]\ngo to x: (-218) y: (-100)\n\nwhen flag clicked\nforever\n    if <(y position) < [-175]> then\n        go to x: (-218) y: (-100)\n    end\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    if <key (r v) pressed?> then\n        go to x: (-218) y: (-100)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<touching (spikes 1 v)?> or <<touching (spikes 2 v)?> or <<touching (spikes 3 v)?> or <<touching (spikes 4 v)?> or <<touching (spikes 5 v)?> or <<touching (spikes 6 v)?> or <<touching (spikes 7 v)?> or <touching (lava v)?>>>>>>>> then\n        go to x: (-218) y: (-100)\n    end\nend\n\nwhen I receive [hide game over v]\nhide\n\ndefine run and jump\nset rotation style [left-right v]\nchange y by (y vel)\nforever\n    if <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 <<not <(y vel) > [0]>> and <key (up arrow v) pressed?>> then\n            set [y vel v] to [15]\n        else\n            set [y vel v] to [0]\n        end\n    else\n        change [y vel v] by (-1)\n    end\n    if <key (right arrow v) pressed?> then\n        switch costume to (right v)\n        change [x vel v] by (1)\n    end\n    if <key (left arrow v) pressed?> then\n        switch costume to (left v)\n        change [x vel v] by (-1)\n    end\n    change x by (x vel)\n    if <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\n    end\n    set [x vel v] to ((x vel) * (0.8))\nend\n\n@Rain\n\nwhen I start as a clone\nshow\ngo to x: (pick random (240) to (-240)) y: (180)\nforever\n    change y by (pick random (-1) to (-5))\nend\n\nwhen I start as a clone\nforever\n    if <(y position) < [-180]> then\n        delete this clone\n    end\nend\n\nwhen flag clicked\nset [rain lag v] to [0]\nforever\n    if <key (l v) pressed?> then\n        broadcast (No Rain v)\n    end\nend\n\nwhen I receive [no rain v]\nset [rain lag v] to [1]\n\nwhen flag clicked\nforever\n    if <(Rain lag) = [3]> then\n        set [rain lag v] to [0]\n    end\nend\n\nwhen I receive [rain v]\nrepeat until <(Rain lag) = [1]>\n    next costume\n    create clone of (_myself_ v)\n    wait (0.2) seconds\nend\n\nwhen flag clicked\nforever\n    if <(Rain lag) = [2]> then\n        broadcast (Rain v)\n    end\nend\n\nwhen I receive [hide game over v]\nhide\n\nwhen I receive [hide game over v]\nset [rain lag v] to [1]\n\nwhen flag clicked\nwait (4.6) seconds\n\nwhen I receive [go v]\nrepeat until <(Rain lag) = [1]>\n    next costume\n    create clone of (_myself_ v)\n    wait (0.2) seconds\nend\n\n@Play\n\nwhen this sprite clicked\nset [i recived go v] to [1]\nbroadcast (go v)\n\nwhen flag clicked\nset [i recived go v] to [0]\nforever\n    wait (1) seconds\n    next costume\nend\n\nwhen I receive [go v]\nhide\n\nwhen flag clicked\nhide\nwait (4.5) seconds\nshow\n\nwhen flag clicked\ngo to x: (3) y: (-131)\n\n@Snow\n\nwhen flag clicked\nhide\n\nwhen I receive [go v]\nshow\n\nwhen flag clicked\ngo to x: (218) y: (-88)\n\nwhen flag clicked\nforever\n    if <(Level:) = [8]> then\n        go to x: (-75) y: (151)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level:) = [9]> then\n        go to x: (216) y: (146)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level:) = [10]> then\n        go to x: (13) y: (90)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level:) = [11]> then\n        go to x: (206) y: (-97)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level:) = [12]> then\n        go to x: (-195) y: (86)\n    end\nend\n\nwhen I receive [hide game over v]\nhide\n\n@Bad things\n\nwhen flag clicked\nforever\n    if <(Level:) = [5]> then\n        switch costume to (costume1 v)\n        show\n    end\nend\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\n\nwhen flag clicked\nforever\n    if <(Level:) = [7]> then\n        go to x: (-22) y: (-138)\n        switch costume to (costume2 v)\n        show\n    end\nend\n\nwhen flag clicked\ngo to x: (-65) y: (-123)\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <(Level:) = [6]> then\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level:) = [8]> then\n        go to x: (-19) y: (-148)\n        switch costume to (costume3 v)\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level:) = [9]> then\n        hide\n    end\nend\n\nwhen I receive [hide game over v]\nhide\n\n@Spikes 1\n\nwhen flag clicked\nforever\n    if <(Level:) = [7 ]> then\n        show\n    end\nend\n\nwhen flag clicked\nhide\ngo to x: (134) y: (-128)\n\nwhen flag clicked\nforever\n    if <(Level:) = [8]> then\n        go to x: (140) y: (-136)\n    end\nend\n\nwhen flag clicked\npoint in direction (90)\n\nwhen flag clicked\nforever\n    if <(Level:) = [9]> then\n        go to x: (-89) y: (-89)\n    end\nend\n\nwhen I receive [turn level 9 v]\nturn left (38) degrees\n\nwhen flag clicked\nforever\n    if <(Level:) = [10]> then\n        hide\n    end\nend\n\nwhen I receive [hide game over v]\nhide\n\n@Loading bar\n\nwhen flag clicked\nshow\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen flag clicked\nwait (0.1) seconds\nrepeat (5)\n    wait (0.3) seconds\n    next costume\nend\nwait (0.3) seconds\nforever\n    hide\nend\n\n@Spikes 2\n\nwhen flag clicked\nforever\n    if <(Level:) = [8]> then\n        show\n    end\nend\n\nwhen flag clicked\nhide\ngo to x: (-55) y: (-37)\n\nwhen flag clicked\npoint in direction (90)\n\nwhen I receive [turn level 9 v]\nturn left (38) degrees\n\nwhen flag clicked\nforever\n    if <(Level:) = [9]> then\n        go to x: (-27) y: (-41)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level:) = [10]> then\n        hide\n    end\nend\n\nwhen I receive [hide game over v]\nhide\n\n@Spikes 3\n\nwhen flag clicked\nforever\n    if <(Level:) = [8]> then\n        show\n    end\nend\n\nwhen flag clicked\nhide\ngo to x: (-51) y: (11)\n\nwhen flag clicked\npoint in direction (90)\n\nwhen I receive [turn level 9 v]\nturn left (38) degrees\n\nwhen flag clicked\nforever\n    if <(Level:) = [9]> then\n        go to x: (32) y: (3)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level:) = [10]> then\n        hide\n    end\nend\n\nwhen I receive [hide game over v]\nhide\n\n@Spikes 4\n\nwhen flag clicked\nforever\n    if <(Level:) = [8]> then\n        show\n    end\nend\n\nwhen flag clicked\nhide\ngo to x: (131) y: (79)\n\nwhen flag clicked\npoint in direction (90)\n\nwhen I receive [turn level 8 v]\nturn left (11) degrees\n\nwhen I receive [turn level 9 v]\nturn left (27) degrees\n\nwhen flag clicked\nforever\n    if <(Level:) = [9]> then\n        go to x: (92) y: (50)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level:) = [10]> then\n        hide\n    end\nend\n\nwhen I receive [hide game over v]\nhide\n\n@Spikes 5\n\nwhen flag clicked\nforever\n    if <(Level:) = [8]> then\n        show\n    end\nend\n\nwhen flag clicked\nhide\ngo to x: (110) y: (124)\n\nwhen flag clicked\npoint in direction (90)\nswitch costume to (costume1 v)\n\nwhen flag clicked\nforever\n    if <(Level:) = [9]> then\n        go to x: (151) y: (94)\n    end\nend\n\nwhen I receive [turn level 9 v]\nturn left (36) degrees\n\nwhen flag clicked\nforever\n    if <(Level:) = [10]> then\n        hide\n    end\nend\n\nwhen I receive [turn level 12 v]\nturn right (66) degrees\n\nwhen I receive [hide game over v]\nhide\n\n@Spikes 6\n\nwhen flag clicked\nforever\n    if <(Level:) = [8]> then\n        show\n    end\nend\n\nwhen flag clicked\nhide\ngo to x: (-23) y: (-73)\n\nwhen flag clicked\nswitch costume to (costume1 v)\npoint in direction (-90)\n\nwhen flag clicked\nforever\n    if <(Level:) = [9]> then\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level:) = [10]> then\n        switch costume to (costume2 v)\n        go to x: (-4) y: (54)\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level:) = [11]> then\n        go to x: (59) y: (-3)\n        switch costume to (costume3 v)\n    end\nend\n\nwhen I receive [turn level 12 v]\nturn right (30) degrees\n\nwhen I receive [hide game over v]\nhide\n\nwhen flag clicked\nforever\n    if <(Level:) = [12]> then\n        hide\n    end\nend\n\n@Spikes 7\n\nwhen flag clicked\nhide\ngo to x: (-185) y: (-2)\n\nwhen flag clicked\npoint in direction (-90)\n\nwhen flag clicked\nforever\n    if <(Level:) = [9]> then\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level:) = [8]> then\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level:) = [11]> then\n        switch costume to (costume2 v)\n        go to x: (-17) y: (-139)\n        show\n    end\nend\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen flag clicked\nforever\n    if <(Level:) = [12]> then\n        show\n        switch costume to (costume3 v)\n        go to x: (-21) y: (62)\n    end\nend\n\nwhen I receive [hide game over v]\nhide\n\ngo to x: (-23) y: (68)\n\n@Lava\n\nwhen flag clicked\ngo to x: (-96) y: (9)\nforever\n    if <(Level:) = [11]> then\n        show\n    end\nend\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\n\nwhen flag clicked\nforever\n    if <(Level:) = [12]> then\n        go to x: (81) y: (21)\n        switch costume to (costume2 v)\n    end\nend\n\nwhen I receive [hide game over v]\nhide\n\n