Winter - a platformer
@Stage\n\nwhen flag clicked\nforever\n    switch backdrop to (LEVEL)\nend\n\nwhen backdrop switches to [backdrop9 v]\nbroadcast (level 9 v)\nstop [this script v]\n\nwhen I receive [new game v]\nwait (1) seconds\nforever\n    play sound [TheFatRat  v] until done\nend\n\n@blank\n\n@Player\n\nwhen flag clicked\nset [level v] to [1]\nset size to (100) %\nReset player variables\nreset\nforever\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        change [x v v] by (.9)\n    end\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        change [x v v] by (-.9)\n    end\n    set [x v v] to ((X v) * (0.9))\n    change x by (X v)\n    if <<<touching (sprite2 v)?> or <touching (sprite10 v)?>> or <touching (sprite18 v)?>> then\n        change y by (1)\n        if <<<touching (sprite2 v)?> or <touching (sprite10 v)?>> or <touching (sprite18 v)?>> then\n            change y by (1)\n            if <<<touching (sprite2 v)?> or <touching (sprite10 v)?>> or <touching (sprite18 v)?>> then\n                change y by (1)\n                if <<<touching (sprite2 v)?> or <touching (sprite10 v)?>> or <touching (sprite18 v)?>> then\n                    change y by (1)\n                    if <<<touching (sprite2 v)?> or <touching (sprite10 v)?>> or <touching (sprite18 v)?>> then\n                        change y by (1)\n                        if <<<touching (sprite2 v)?> or <touching (sprite10 v)?>> or <touching (sprite18 v)?>> then\n                            change x by ((X v) * (-1))\n                            change y by (-5)\n                            if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>>> then\n                                broadcast (jump v)\n                                if <(X v) > [0]> then\n                                    set [x v v] to [-5]\n                                else\n                                    set [x v v] to [5]\n                                end\n                                set [y v v] to [15]\n                            else\n                                set [x v v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y v v] by (-1)\n    change y by (Y v)\n    if <<<touching (sprite2 v)?> or <touching (sprite10 v)?>> or <touching (sprite18 v)?>> then\n        change y by ((Y v) * (-1))\n        set [y v v] to [0]\n    end\n    change y by (-1)\n    if <<<touching (sprite2 v)?> or <touching (sprite10 v)?>> or <touching (sprite18 v)?>> then\n        if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>>> then\n            set [y v v] to [12]\n        end\n    end\n    change y by (1)\n    if <<touching (sprite8 v)?> or <<touching (sprite21 v)?> or <<touching (sprite22 v)?> or <touching (sprite23 v)?>>>> then\n        broadcast (bounce v)\n        set [y v v] to [23]\n    end\n    if <touching (sprite7 v)?> then\n        set [y v v] to [-1]\n    end\nend\n\ndefine reset\nclear graphic effects\nset size to (100) %\nshow\ngo to x: (-200) y: (0)\npoint in direction (90)\nReset player variables\n\ndefine Reset player variables\nset [x v v] to [0]\nset [y v v] to [0]\n\nwhen flag clicked\nforever\n    switch costume to (costume11 \(1\) v)\nend\n\nwhen I start as a clone\nset size to (100) %\nswitch costume to (costume11 \(1\)2 v)\nrepeat (20)\n    change [ghost v] effect by (8)\n    change size by (-5)\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    if <(can get portal) = [yes]> then\n        create clone of (_myself_ v)\n        wait (0.02) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (portal v)?> then\n        if <(can get portal) = [yes]> then\n            broadcast (next v)\n            wait (2) seconds\n            change [level v] by (1)\n            go to x: (-217) y: (-37)\n        end\n    end\nend\n\nwhen flag clicked\nset [can get portal v] to [yes]\nforever\n    if <<(y position) < [-180]> or <<touching (sprite6 v)?> or <touching (sprite13 v)?>>> then\n        set [can get portal v] to [no]\n        glide (0.5) secs to x: (-217) y: (-37)\n        set [can get portal v] to [yes]\n    end\nend\n\nset [_colour v] to [0]\n\nwhen I receive [next2 v]\ngo to (portal v)\n\nwhen I receive [restart v]\nset [can get portal v] to [no]\nglide (0.5) secs to x: (-217) y: (-37)\nset [can get portal v] to [yes]\n\nwhen flag clicked\nforever\n\nif <<key (up arrow v) pressed?> and <not <touching (sprite6 v)?>>> then\n    play sound [Jump v] until done\n    wait until <<not <key (up arrow v) pressed?>> or <touching (sprite2 v)?>>\nend\n\nwhen flag clicked\nforever\n    if <touching (sprite7 v)?> then\n        play sound [Splash v] until done\n        wait until <not <touching (sprite7 v)?>>\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (sprite8 v)?> then\n        play sound [Jump v] until done\n        wait (0.1) seconds\n    end\nend\n\nwhen I receive [jump v]\nplay sound [Jump v] until done\n\nwhen I receive [new game v]\nshow\n\nwhen flag clicked\nhide\n\n@Sprite2\n\nwhen flag clicked\nforever\n    switch costume to (LEVEL)\nend\n\n@portal\n\nwhen flag clicked\nforever\n    if <(new game) = [yes]> then\n        create clone of (_myself_ v)\n        stop [this script v]\n    end\nend\n\nwhen I start as a clone\nforever\n    set [ghost v] effect to (50)\n    switch costume to (costume1 v)\n    turn left (3) degrees\n    go to x: (portal x) y: (portal y)\n    if <(LEVEL) = [12]> then\n        delete this clone\n    end\nend\n\nwhen I receive [next v]\nplay sound [Connect v] until done\n\nwhen flag clicked\nset [new game v] to []\nhide\nforever\n    set [ghost v] effect to (50)\n    switch costume to (costume1 v)\n    turn right (3) degrees\n    set [portal x v] to (x position)\n    set [portal y v] to (y position)\nend\n\nwhen I receive [new game v]\nset [new game v] to [yes]\nforever\n    if <(LEVEL) < [5]> then\n        show\n        go to x: (183) y: (-30)\n    else\n        if <(LEVEL) = [5]> then\n            go to x: (207) y: (133)\n        else\n            if <(LEVEL) = [6]> then\n                go to x: (187) y: (70)\n            else\n                if <(LEVEL) = [7]> then\n                    go to x: (200) y: (-35)\n                else\n                    if <(LEVEL) = [8]> then\n                        go to x: (205) y: (148)\n                    else\n                        if <(LEVEL) = [9]> then\n                            go to x: (205) y: (125)\n                        else\n                            if <(LEVEL) = [10]> then\n                                go to x: (-25) y: (130)\n                            else\n                                if <(LEVEL) = [11]> then\n                                    go to x: (195) y: (137)\n                                else\n                                    if <(LEVEL) = [12]> then\n                                        hide\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndelete this clone\n\n@Sprite4\n\nwhen flag clicked\nset [level v] to [1]\nhide\ngo to x: (-550) y: (0)\n\nwhen I receive [next v]\nshow\nglide (1) secs to x: (0) y: (0)\nwait (1) seconds\nglide (2) secs to x: (-550) y: (0)\nhide\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\n@Sprite5\n\nwhen flag clicked\nhide\nshow\nchange [ghost v] effect by (50)\nwait (0.01) seconds\ngo to [back v] layer\nswitch costume to (costume2 v)\nset size to (200) %\nswitch costume to (costume1 v)\nforever\n    go to [back v] layer\n    go to x: (0) y: (0)\n    repeat (90)\n        change y by (1)\n        change x by (-1.5)\n    end\nend\n\nwhen I start as a clone\npoint in direction (90)\nchange [ghost v] effect by (95)\ngo to [back v] layer\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\n@Sprite6\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    switch costume to (LEVEL)\n    go [backward v] (3) layers\nend\n\n@Sprite1\n\nwhen I start as a clone\ngo to x: (pick random (-235) to (235)) y: (180)\nset [ghost v] effect to (pick random (20) to (40))\nset size to (pick random (50) to (100)) %\nset [xvel v] to (pick random (-0.7) to (0.7))\nset [yvel v] to (pick random (-0.9) to (-1.8))\npoint in direction (pick random (-180) to (180))\ngo to [back v] layer\ngo [forward v] (0) layers\nshow\nrepeat until <<<(y position) < [-175]> or <([abs v] of (x position) ) > [235]>> or <<touching (water v)?> or <touching (level v)?>>>\n    change x by ((xvel) + ((0.0002) * ((1) * (size))))\n    change y by ((yvel) + ((0.0001) * ((1) * (size))))\nend\ncreate clone of (_myself_ v)\ndelete this clone\n\nwhen flag clicked\ngo to [back v] layer\ngo [forward v] (8) layers\nstop [other scripts in sprite v]\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nset [ghost v] effect to (0)\nerase all\nhide\nrepeat (250)\n    create clone of (_myself_ v)\nend\n\n@Sprite7\n\nwhen flag clicked\nforever\n    set [brightness v] effect to (0)\n    show\n    set [ghost v] effect to (50)\n    go to [front v] layer\n    go [backward v] (100) layers\n    switch costume to (LEVEL)\nend\n\ndefine effect (rise)\ngo to x: (-29) y: (90)\nrepeat (rise)\n    change y by (1)\nend\nrepeat (rise)\n    change y by (-1)\nend\n\nwhen flag clicked\nforever\n    effect (pick random (0) to (20))\nend\n\nwhen flag clicked\nrepeat (3)\n    create clone of (_myself_ v)\n    wait (0.2) seconds\nend\n\nwhen I start as a clone\nforever\n    effect (pick random (0) to (20))\n    switch costume to (LEVEL)\nend\n\nwait (1) seconds\n\n@Sprite8\n\nwhen flag clicked\nswitch costume to (costume6 v)\nforever\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    go [forward v] (2) layers\nend\n\nwhen flag clicked\nforever\n    if <(LEVEL) < [6]> then\n        hide\n    end\n    if <(LEVEL) = [6]> then\n        go to x: (-144) y: (-75)\n        show\n    end\n    if <(LEVEL) = [7]> then\n        hide\n    end\n    if <(LEVEL) = [8]> then\n        go to x: (198) y: (-157)\n        show\n    end\n    if <(LEVEL) = [9]> then\n        show\n        go to x: (57) y: (-85)\n    end\n    if <(LEVEL) = [10]> then\n        hide\n    end\n    if <(LEVEL) = [11]> then\n        show\n        go to x: (195) y: (-85)\n    end\n    if <(LEVEL) = [12]> then\n        show\n        go to x: (-160) y: (-90)\n    end\nend\n\nwhen I receive [bounce v]\nswitch costume to (costume6 v)\nrepeat (6)\n    next costume\nend\nrepeat (6)\n    switch costume to ((costume [number v]) - (1))\nend\n\nif <(LEVEL) = [10]> then\n\n@Sprite10\n\nwhen flag clicked\nforever\n    if <(LEVEL) < [7]> then\n        hide\n    end\n    if <(LEVEL) = [7]> then\n        show\n    end\n    if <(LEVEL) = [8]> then\n        show\n    end\n    if <(LEVEL) = [9]> then\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(LEVEL) = [7]> then\n        glide (1.5) secs to x: (-30) y: (-70)\n        glide (1.5) secs to x: (50) y: (-70)\n    end\n    if <(LEVEL) = [8]> then\n        go to x: (-59) y: (-160)\n        glide (8) secs to x: (-59) y: (40)\n        glide (8) secs to x: (-59) y: (-160)\n    end\nend\n\n@Sprite3\n\nwhen flag clicked\nforever\n    if <(LEVEL) < [9]> then\n        hide\n    end\n    if <(LEVEL) = [9]> then\n        go to x: (-163) y: (103)\n        show\n    end\n    if <(LEVEL) = [10]> then\n        hide\n    end\nend\n\nstop [this script v]\n\nwhen flag clicked\nforever\n    if <(LEVEL) = [9]> then\n        if <touching (player v)?> then\n            repeat (20)\n                change [ghost v] effect by (5)\n            end\n            broadcast (open v)\n            stop [this script v]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        play sound [Magic Spell v] until done\n        stop [this script v]\n    end\nend\n\n@Sprite18\n\nrepeat (19)\n    wait (0.02) seconds\n    switch costume to ((costume [number v]) - (1))\nend\n\nwhen I receive [open v]\nshow\nswitch costume to (costume1 v)\nrepeat (19)\n    next costume\n    wait (0.02) seconds\nend\nwait (2) seconds\nhide\n\nwhen flag clicked\nforever\n    if <(LEVEL) < [9]> then\n        hide\n    end\n    if <(LEVEL) = [9]> then\n        switch costume to (costume1 v)\n        point in direction (90)\n        go to x: (36) y: (20)\n        show\n        stop [this script v]\n    end\nend\n\nwhen I receive [open 2 v]\nshow\nswitch costume to (costume1 v)\nrepeat (19)\n    next costume\n    wait (0.02) seconds\nend\nwait (2) seconds\nhide\n\nwhen flag clicked\nforever\n    if <(LEVEL) < [9]> then\n        hide\n    end\n    if <(LEVEL) = [10]> then\n        switch costume to (costume1 v)\n        point in direction (90)\n        go to x: (-89) y: (11)\n        show\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(LEVEL) < [9]> then\n        hide\n    end\n    if <(LEVEL) = [11]> then\n        switch costume to (costume1 v)\n        go to x: (95) y: (90)\n        show\n        point in direction (180)\n        stop [this script v]\n    end\nend\n\nwhen I receive [open 3 v]\nshow\nswitch costume to (costume1 v)\nrepeat (19)\n    next costume\n    wait (0.02) seconds\nend\nwait (2) seconds\nhide\n\n@Sprite9\n\nwhen flag clicked\nforever\n    set size to (120) %\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (10)\n        set [ghost v] effect to (30)\n    else\n        set [brightness v] effect to (0)\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen flag clicked\nforever\n    go to x: (-110) y: (145)\n    point in direction (80)\n    repeat (20)\n        turn right (1) degrees\n    end\n    repeat (20)\n        turn left (1) degrees\n    end\nend\n\nwhen this sprite clicked\nstart sound [click v]\nbroadcast (next2 v)\n\nwhen flag clicked\ngo to [front v] layer\n\nwhen flag clicked\nhide\n\nwhen I receive [new game v]\nshow\n\nwhen I receive [new game v]\nforever\n    if <(LEVEL) = [12]> then\n        hide\n    else\n        show\n    end\nend\n\n@Sprite11\n\nwhen flag clicked\nclear graphic effects\ngo to [front v] layer\n\nwhen flag clicked\nforever\n    go to x: (-190) y: (145)\n    point in direction (80)\n    repeat (20)\n        turn right (1) degrees\n    end\n    repeat (20)\n        turn left (1) degrees\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (50)\n        set [brightness v] effect to (10)\n    else\n        set [brightness v] effect to (0)\n        set [ghost v] effect to (0)\n    end\nend\n\nset size to (120) %\n\nwhen this sprite clicked\nstart sound [click v]\nbroadcast (restart v)\n\nwhen flag clicked\nhide\n\nwhen I receive [new game v]\nshow\n\nwhen I receive [new game v]\nforever\n    if <(LEVEL) = [12]> then\n        hide\n    else\n        show\n    end\nend\n\n@Sprite12\n\nwhen flag clicked\nforever\n    if <(LEVEL) < [9]> then\n        hide\n    end\n    if <(LEVEL) = [10]> then\n        show\n        go to x: (200) y: (30)\n    end\n    if <(LEVEL) = [11]> then\n        hide\n    end\nend\n\nstop [this script v]\n\nwhen flag clicked\nforever\n    if <(LEVEL) = [10]> then\n        if <touching (player v)?> then\n            repeat (20)\n                change [ghost v] effect by (5)\n            end\n            broadcast (open 2 v)\n            stop [this script v]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        play sound [Magic Spell v] until done\n        stop [this script v]\n    end\nend\n\n@Sprite13\n\nwhen flag clicked\nforever\n    switch costume to (LEVEL)\nend\n\nwhen flag clicked\nforever\n    go to x: (36) y: (28)\n    wait (2) seconds\n    repeat (40)\n        change y by (-1)\n    end\n    wait (2) seconds\n    repeat (40)\n        change y by (1)\n    end\nend\n\n@Sprite14\n\nwhen flag clicked\nforever\n    if <(LEVEL) < [9]> then\n        hide\n    end\n    if <(LEVEL) = [11]> then\n        show\n        go to x: (-190) y: (110)\n    end\nend\n\nstop [this script v]\n\nwhen flag clicked\nforever\n    if <(LEVEL) = [11]> then\n        clear graphic effects\n        if <touching (player v)?> then\n            repeat (20)\n                change [ghost v] effect by (5)\n            end\n            broadcast (open 3 v)\n            stop [this script v]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        play sound [Magic Spell v] until done\n        stop [this script v]\n    end\nend\n\n@play?\n\nwhen flag clicked\nshow\n\nwhen I receive [new game v]\nhide\n\n@play?2\n\nwhen flag clicked\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        if <mouse down?> then\n            start sound [click v]\n            broadcast (new game v)\n        else\n            set [ghost v] effect to (10)\n            set [brightness v] effect to (10)\n        end\n    else\n        set size to (100) %\n        clear graphic effects\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        repeat until <(size) = [110]>\n            change size by (5)\n        end\n    else\n        repeat until <(size) = [100]>\n            set size to (100) %\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    point in direction (80)\n    repeat (20)\n        turn right (1) degrees\n    end\n    repeat (20)\n        turn left (1) degrees\n    end\nend\n\nchange y by (1)\n\nwhen I receive [new game v]\nhide\n\nstart sound [pop v]\n\n@Sprite15\n\nwhen flag clicked\nshow\n\nwhen I receive [new game v]\nhide\n\nwhen flag clicked\nforever\n    repeat (20)\n        turn left (0.5) degrees\n    end\n    repeat (20)\n        turn right (0.5) degrees\n    end\n    point in direction (95)\nend\n\n@Screen Shot 2020-05-28 at 8\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (100)\n    go to [front v] layer\nend\n\n
               Winter - a platformer  \nThis is my entry for  StratfordJames platformer contest\n\n                              Instructions:\nArrow keys, WASD or tap to move\nDon't touch spikes!\nTrampolines are very bouncy\nWater makes you sink\nIn some levels, collect the key to unlock the door\nDon't forget to love, favorite, and follow!\n\nLoved and faved by @GraphicFox!