Fred the Box - Platformer
@Stage\n\nwhen I receive [reset v]\nforever\n    if <([costume # v] of [ground v]) = [1]> then\n        switch backdrop to (backdrop2 v)\n    end\n    if <([costume # v] of [ground v]) = [7]> then\n        switch backdrop to (backdrop3 v)\n    end\n    if <([costume # v] of [ground v]) = [8]> then\n        switch backdrop to (backdrop4 v)\n    end\n    if <([costume # v] of [ground v]) = [9]> then\n        switch backdrop to (backdrop5 v)\n    end\n    if <([costume # v] of [ground v]) = [10]> then\n        switch backdrop to (backdrop6 v)\n    end\n    if <([costume # v] of [ground v]) = [11]> then\n        switch backdrop to (backdrop7 v)\n    end\n    if <([costume # v] of [ground v]) = [12]> then\n        switch backdrop to (backdrop8 v)\n    end\n    if <([costume # v] of [ground v]) = [14]> then\n        switch backdrop to (backdrop9 v)\n    end\n    if <([costume # v] of [ground v]) = [15]> then\n        switch backdrop to (backdrop10 v)\n    end\n    if <([costume # v] of [ground v]) = [16]> then\n        switch backdrop to (backdrop11 v)\n    end\n    if <([costume # v] of [ground v]) = [17]> then\n        switch backdrop to (backdrop12 v)\n    end\n    if <([costume # v] of [ground v]) = [18]> then\n        switch backdrop to (backdrop13 v)\n    end\n    if <([costume # v] of [ground v]) = [19]> then\n        switch backdrop to (backdrop14 v)\n    end\n    if <([costume # v] of [ground v]) = [20]> then\n        switch backdrop to (backdrop2 v)\n    end\nend\n\n@Blank\n\n@You\n\ndefine Go\nif <(Begin Level?) = [yes]> then\n    if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n        switch costume to (left v)\n        change [you x v] by (-1.1)\n    end\n    if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n        switch costume to (right v)\n        change [you x v] by (1.1)\n    end\n    set [you x v] to ((You X) * (.87))\n    change x by (You X)\nend\nif <<<touching (fred v)?> and <(y position) > ([y position v] of [fred v])>> or <touching (ground v)?>> then\n    change y by (1)\n    if <<<touching (fred v)?> and <(y position) > ([y position v] of [fred v])>> or <touching (ground v)?>> then\n        change y by (1)\n        if <<<touching (fred v)?> and <(y position) > ([y position v] of [fred v])>> or <touching (ground v)?>> then\n            change y by (1)\n            if <<<touching (fred v)?> and <(y position) > ([y position v] of [fred v])>> or <touching (ground v)?>> then\n                change y by (1)\n                if <<<touching (fred v)?> and <(y position) > ([y position v] of [fred v])>> or <touching (ground v)?>> then\n                    change y by (1)\n                    if <<<touching (fred v)?> and <(y position) > ([y position v] of [fred v])>> or <touching (ground v)?>> then\n                        change y by (1)\n                        if <<<touching (fred v)?> and <(y position) > ([y position v] of [fred v])>> or <touching (ground v)?>> then\n                            change y by (1)\n                            if <<<touching (fred v)?> and <(y position) > ([y position v] of [fred v])>> or <touching (ground v)?>> then\n                                change y by (1)\n                                if <<<touching (fred v)?> and <(y position) > ([y position v] of [fred v])>> or <touching (ground v)?>> then\n                                    if <touching (ground v)?> then\n                                        change y by (-8)\n                                        change x by ((You X) * (-1))\n                                        point in direction (90)\n                                        set [you x v] to [0]\n                                        set [you y v] to [0]\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nchange [you y v] by (-1)\nchange y by (You Y)\nif <<<touching (fred v)?> and <(y position) > ([y position v] of [fred v])>> or <touching (ground v)?>> then\n    change y by ((You Y) * (-1))\n    set [you y v] to [0]\nend\nchange y by (-1)\nif <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n    if <<touching (ground v)?> or <<not <touching (ground v)?>> and <<touching (fred v)?> and <(y position) > ([y position v] of [fred v])>>>> then\n        point in direction (90)\n        set [you y v] to [12]\n    end\nend\nchange y by (1)\n\nif <<touching (dangers v)?> or <<touching (_edge_ v)?> and <(y position) < [-164]>>> then\n    hide\n    stop [other scripts in sprite v]\n    broadcast (You died v)\n    wait until <not <<touching (dangers v)?> or <<touching (_edge_ v)?> and <(y position) < [-164]>>>>\nend\n\nwhen I receive [reset v]\nshow\nclear graphic effects\nswitch costume to (right v)\nset [begin level? v] to [no]\nset [you and fred done? v] to [0]\nset [you y v] to [0]\nset [you x v] to [0]\ngo to x: (-200) y: (120)\npoint in direction (90)\nforever\n    Go\nend\n\nwhen I receive [you turn left v]\nturn left (3) degrees\n\nwhen I receive [you turn right v]\nturn right (3) degrees\n\nwhen I receive [fred died v]\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [reset v]\nwait until <not <(You Y) = [0]>>\nwait until <(You Y) = [0]>\nset [begin level? v] to [yes]\nforever\n    if <<touching (_edge_ v)?> and <<(x position) > [220]> and <not <(y position) < [-164]>>>> then\n        if <(You and Fred Done?) = [Fred done]> then\n            if <([costume # v] of [ground v]) = [20]> then\n                broadcast (Victory v)\n                hide\n                stop [other scripts in sprite v]\n                stop [this script v]\n            else\n                broadcast (Next level v)\n            end\n        end\n    end\n    if <key (r v) pressed?> then\n        broadcast (Reset v)\n    end\n    if <key (space v) pressed?> then\n        broadcast (Next level v)\n    end\nend\n\nwhen I receive [reset v]\nforever\n    if <([costume # v] of [ground v]) = [1]> then\n        set [brightness v] effect to (0)\n    end\n    if <([costume # v] of [ground v]) = [7]> then\n        set [brightness v] effect to (-5)\n    end\n    if <([costume # v] of [ground v]) = [8]> then\n        set [brightness v] effect to (-10)\n    end\n    if <([costume # v] of [ground v]) = [9]> then\n        set [brightness v] effect to (-15)\n    end\n    if <([costume # v] of [ground v]) = [10]> then\n        set [brightness v] effect to (-25)\n    end\n    if <([costume # v] of [ground v]) = [11]> then\n        set [brightness v] effect to (-55)\n    end\n    if <([costume # v] of [ground v]) = [12]> then\n        if <touching (stuff v)?> then\n            set [brightness v] effect to (0)\n        else\n            set [brightness v] effect to (-80)\n        end\n    end\n    if <([costume # v] of [ground v]) = [13]> then\n        if <touching (stuff v)?> then\n            set [brightness v] effect to (0)\n        else\n            set [brightness v] effect to (-80)\n        end\n    end\n    if <([costume # v] of [ground v]) = [14]> then\n        if <touching (stuff v)?> then\n            set [brightness v] effect to (0)\n        else\n            set [brightness v] effect to (-80)\n        end\n    end\n    if <([costume # v] of [ground v]) = [15]> then\n        if <touching (stuff v)?> then\n            set [brightness v] effect to (0)\n        else\n            set [brightness v] effect to (-40)\n        end\n    end\n    if <([costume # v] of [ground v]) = [16]> then\n        set [brightness v] effect to (-25)\n    end\n    if <([costume # v] of [ground v]) = [17]> then\n        set [brightness v] effect to (-15)\n    end\n    if <([costume # v] of [ground v]) = [18]> then\n        set [brightness v] effect to (-10)\n    end\n    if <([costume # v] of [ground v]) = [19]> then\n        set [brightness v] effect to (-5)\n    end\n    if <([costume # v] of [ground v]) = [20]> then\n        set [brightness v] effect to (0)\n    end\nend\n\nstop [this script v]\n\nwhen I receive [reset v]\nforever\n    if <touching (dangers v)?> then\n        hide\n        broadcast (You died v)\n        stop [other scripts in sprite v]\n        wait until <not <<touching (dangers v)?> or <<touching (_edge_ v)?> and <(y position) < [-164]>>>>\n    end\n    if <touching (_edge_ v)?> then\n        if <(y position) < [-164]> then\n            hide\n            broadcast (You died v)\n            stop [other scripts in sprite v]\n            wait until <not <<touching (dangers v)?> or <<touching (_edge_ v)?> and <(y position) < [-164]>>>>\n        end\n    end\nend\n\nwait until <not <<touching (dangers v)?> or <touching (_edge_ v)?>>>\n\n@Fred\n\ndefine Go\nif <<(y position) > ([y position v] of [you v])> and <touching (you v)?>> then\n    wait until <not <touching (you v)?>>\n    wait (.1) seconds\nend\nif <<([x position v] of [you v]) > (x position)> and <touching (you v)?>> then\n    start sound [Sound v]\n    if <not <(round (You X)) = [0]>> then\n        if <<key (s v) pressed?> or <key (down arrow v) pressed?>> then\n            if <(You X) < [0]> then\n                set [fred y v] to (((You X) - ((You X) * (2))) + (4))\n            else\n                set [fred y v] to ((You X) + (4))\n            end\n        end\n    end\n    set [fred x v] to [0]\n    repeat until <not <touching (you v)?>>\n        set [fred x v] to ((((You X) * (6)) / (2)) + (1))\n    end\nend\nif <<(x position) > ([x position v] of [you v])> and <touching (you v)?>> then\n    start sound [Sound v]\n    if <<key (s v) pressed?> or <key (down arrow v) pressed?>> then\n        if <not <(round (You X)) = [0]>> then\n            if <(You X) < [0]> then\n                set [fred y v] to (((You X) - ((You X) * (2))) + (4))\n            else\n                set [fred y v] to ((You X) + (4))\n            end\n        end\n    end\n    repeat until <not <touching (you v)?>>\n        set [fred x v] to ((((You X) * (6)) / (2)) + (1))\n    end\nend\nchange x by (Fred X)\nif <not <(round (You X)) = [0]>> then\n    if <<<touching (you v)?> and <(y position) > ([x position v] of [you v])>> or <touching (ground v)?>> then\n        change y by (1)\n        if <<<touching (you v)?> and <(y position) > ([x position v] of [you v])>> or <touching (ground v)?>> then\n            change y by (1)\n            if <<<touching (you v)?> and <(y position) > ([x position v] of [you v])>> or <touching (ground v)?>> then\n                change y by (1)\n                if <<<touching (you v)?> and <(y position) > ([x position v] of [you v])>> or <touching (ground v)?>> then\n                    change y by (1)\n                    if <<<touching (you v)?> and <(y position) > ([x position v] of [you v])>> or <touching (ground v)?>> then\n                        change y by (1)\n                        if <<<touching (you v)?> and <(y position) > ([x position v] of [you v])>> or <touching (ground v)?>> then\n                            change y by (1)\n                            if <<<touching (you v)?> and <(y position) > ([x position v] of [you v])>> or <touching (ground v)?>> then\n                                change y by (1)\n                                if <<<touching (you v)?> and <(y position) > ([x position v] of [you v])>> or <touching (ground v)?>> then\n                                    change y by (1)\n                                    if <<<touching (you v)?> and <(y position) > ([x position v] of [you v])>> or <touching (ground v)?>> then\n                                        if <touching (ground v)?> then\n                                            change y by (-8)\n                                            change x by ((Fred X) * (-1))\n                                            set [fred x v] to [0]\n                                            set [fred y v] to [0]\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nset [fred x v] to ((Fred X) * (.87))\nchange [fred y v] by (-1)\nchange y by (Fred Y)\nif <<<touching (you v)?> and <(y position) > ([x position v] of [you v])>> or <touching (ground v)?>> then\n    change y by ((Fred Y) * (-1))\n    set [fred y v] to [0]\nend\n\nwhen I receive [reset v]\nshow\nclear graphic effects\nswitch costume to (box v)\nset [fred x v] to [0]\nset [fred y v] to [0]\ngo to x: (-160) y: (100)\npoint in direction (-90)\nforever\n    Go\nend\n\nwhen I receive [reset v]\nwait until <not <<touching (dangers v)?> or <touching (_edge_ v)?>>>\nforever\n    if <touching (dangers v)?> then\n        hide\n        broadcast (Fred died v)\n        stop [other scripts in sprite v]\n        wait until <not <<touching (dangers v)?> or <<touching (_edge_ v)?> and <(y position) < [-164]>>>>\n    end\n    if <touching (_edge_ v)?> then\n        if <(y position) < [-164]> then\n            hide\n            broadcast (Fred died v)\n            stop [other scripts in sprite v]\n            wait until <not <<touching (dangers v)?> or <<touching (_edge_ v)?> and <(y position) < [-164]>>>>\n        else\n            if <(x position) > [220]> then\n                set [you and fred done? v] to [Fred done]\n                hide\n                wait until <not <touching (_edge_ v)?>>\n            else\n                point in direction (-90)\n            end\n        end\n    end\nend\n\nwhen I receive [you died v]\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [reset v]\nforever\n    if <([costume # v] of [ground v]) = [1]> then\n        set [brightness v] effect to (0)\n    end\n    if <([costume # v] of [ground v]) = [7]> then\n        set [brightness v] effect to (-5)\n    end\n    if <([costume # v] of [ground v]) = [8]> then\n        set [brightness v] effect to (-10)\n    end\n    if <([costume # v] of [ground v]) = [9]> then\n        set [brightness v] effect to (-15)\n    end\n    if <([costume # v] of [ground v]) = [10]> then\n        set [brightness v] effect to (-25)\n    end\n    if <([costume # v] of [ground v]) = [11]> then\n        set [brightness v] effect to (-55)\n    end\n    if <([costume # v] of [ground v]) = [12]> then\n        if <touching (stuff v)?> then\n            set [brightness v] effect to (0)\n        else\n            set [brightness v] effect to (-80)\n        end\n    end\n    if <([costume # v] of [ground v]) = [13]> then\n        if <touching (stuff v)?> then\n            set [brightness v] effect to (0)\n        else\n            set [brightness v] effect to (-80)\n        end\n    end\n    if <([costume # v] of [ground v]) = [14]> then\n        if <touching (stuff v)?> then\n            set [brightness v] effect to (0)\n        else\n            set [brightness v] effect to (-80)\n        end\n    end\n    if <([costume # v] of [ground v]) = [15]> then\n        if <touching (stuff v)?> then\n            set [brightness v] effect to (0)\n        else\n            set [brightness v] effect to (-40)\n        end\n    end\n    if <([costume # v] of [ground v]) = [16]> then\n        set [brightness v] effect to (-25)\n    end\n    if <([costume # v] of [ground v]) = [17]> then\n        set [brightness v] effect to (-15)\n    end\n    if <([costume # v] of [ground v]) = [18]> then\n        set [brightness v] effect to (-10)\n    end\n    if <([costume # v] of [ground v]) = [19]> then\n        set [brightness v] effect to (-5)\n    end\n    if <([costume # v] of [ground v]) = [20]> then\n        set [brightness v] effect to (0)\n    end\n    if <([costume # v] of [ground v]) = [16]> then\n        set [brightness v] effect to (-20)\n    end\nend\n\n@Dangers\n\nwhen I receive [fred died v]\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [you died v]\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen flag clicked\nhide\n\nwhen I receive [reset v]\nDelete clones\nforever\n    if <([costume # v] of [ground v]) = [1]> then\n        hide\n    end\n    if <([costume # v] of [ground v]) = [2]> then\n        hide\n    end\n    if <([costume # v] of [ground v]) = [3]> then\n        set size to (100) %\n        go to x: (0) y: (-60)\n        go to [back v] layer\n        show\n        switch costume to (1 v)\n        repeat until <([costume # v] of [ground v]) = [4]>\n            go to [back v] layer\n            if <(costume [number v]) > [6]> then\n                switch costume to (1 v)\n            end\n            next costume\n            wait (.03) seconds\n        end\n    end\n    if <([costume # v] of [ground v]) = [4]> then\n        set size to (100) %\n        go to x: (0) y: (-60)\n        go to [back v] layer\n        show\n        switch costume to (8 v)\n    end\n    if <([costume # v] of [ground v]) = [6]> then\n        hide\n    end\n    if <([costume # v] of [ground v]) = [7]> then\n        set size to (100) %\n        go to x: (0) y: (-60)\n        go to [front v] layer\n        go [backward v] (1) layers\n        show\n        switch costume to (9 v)\n        repeat until <([costume # v] of [ground v]) = [8]>\n            set size to (80) %\n            go to x: (40) y: (-67)\n            if <(costume [number v]) > [14]> then\n                switch costume to (9 v)\n            end\n            next costume\n            wait (.03) seconds\n            go to [front v] layer\n            go [backward v] (1) layers\n        end\n    end\n    if <([costume # v] of [ground v]) = [8]> then\n        set size to (100) %\n        go to x: (0) y: (-60)\n        go to [back v] layer\n        show\n        switch costume to (8 v)\n    end\n    if <([costume # v] of [ground v]) = [10]> then\n        set size to (100) %\n        go to x: (0) y: (-40)\n        go to [back v] layer\n        show\n        switch costume to (8 v)\n    end\n    if <([costume # v] of [ground v]) = [11]> then\n        hide\n        set [brightness v] effect to (-55)\n        go to x: (180) y: (-72)\n        create clone of (_myself_ v)\n        wait (2.5) seconds\n        go to x: (240) y: (-72)\n        create clone of (_myself_ v)\n        wait until <([costume # v] of [ground v]) = [12]>\n    end\n    if <([costume # v] of [ground v]) = [13]> then\n        hide\n    end\n    if <([costume # v] of [ground v]) = [14]> then\n        go to [back v] layer\n        go to x: (97) y: (-70)\n        switch costume to (25 v)\n        show\n    end\n    if <([costume # v] of [ground v]) = [15]> then\n        go to x: (0) y: (-60)\n        switch costume to (8 v)\n        show\n    end\n    if <([costume # v] of [ground v]) = [16]> then\n        go to x: (0) y: (-55)\n        set size to (62) %\n        switch costume to (26 v)\n        point in direction (90)\n        show\n        repeat until <([costume # v] of [ground v]) = [17]>\n            switch costume to (26 v)\n            repeat (22)\n                next costume\n                wait (.06) seconds\n            end\n            repeat (22)\n                switch costume to ((costume [number v]) - (1))\n                wait (.06) seconds\n            end\n        end\n    end\n    if <([costume # v] of [ground v]) = [17]> then\n        hide\n    end\n    if <([costume # v] of [ground v]) = [18]> then\n        hide\n    end\nend\n\nwhen I start as a clone\nset size to (100) %\ngo to [back v] layer\nshow\nswitch costume to (16 v)\nrepeat until <<([costume # v] of [ground v]) = [12]> or <(x position) = [-250]>>\n    set size to (100) %\n    if <(costume [number v]) > [23]> then\n        switch costume to (16 v)\n    end\n    next costume\n    wait (.03) seconds\n    go to [back v] layer\n    move (-4.6) steps\nend\ndelete this clone\n\ndefine Delete clones\ndelete this clone\n\nwhen I receive [reset v]\nforever\n    if <([costume # v] of [ground v]) = [1]> then\n        set [brightness v] effect to (0)\n    end\n    if <([costume # v] of [ground v]) = [10]> then\n        set [brightness v] effect to (-25)\n    end\n    if <([costume # v] of [ground v]) = [11]> then\n        set [brightness v] effect to (-55)\n    end\n    if <([costume # v] of [ground v]) = [12]> then\n        set [brightness v] effect to (-80)\n    end\n    if <([costume # v] of [ground v]) = [14]> then\n        set [brightness v] effect to (-5)\n    end\n    if <([costume # v] of [ground v]) = [15]> then\n        set [brightness v] effect to (-25)\n    end\n    if <([costume # v] of [ground v]) = [16]> then\n        set [brightness v] effect to (-20)\n    end\nend\n\nhide\ngo to x: (0) y: (-60)\n\n@Died\n\nwhen I receive [fred died v]\nif <([costume # v] of [ground v]) = [3]> then\n    start sound [Splash v]\n    switch costume to (2 v)\nend\nif <([costume # v] of [ground v]) = [4]> then\n    start sound [Splash v]\n    switch costume to (2 v)\nend\nif <([costume # v] of [ground v]) = [5]> then\n    start sound [Splash v]\n    switch costume to (4 v)\nend\nif <([costume # v] of [ground v]) = [7]> then\n    start sound [Sizzle v]\n    switch costume to (6 v)\nend\nif <([costume # v] of [ground v]) = [8]> then\n    start sound [Splash v]\n    switch costume to (4 v)\nend\nif <([costume # v] of [ground v]) = [10]> then\n    start sound [Duck v]\n    switch costume to (8 v)\nend\nif <([costume # v] of [ground v]) = [11]> then\n    start sound [Bite v]\n    switch costume to (10 v)\nend\nif <([costume # v] of [ground v]) = [13]> then\n    start sound [Splash v]\n    switch costume to (12 v)\nend\nif <([costume # v] of [ground v]) = [14]> then\n    start sound [Tennis Hit v]\n    switch costume to (14 v)\nend\nif <([costume # v] of [ground v]) = [15]> then\n    start sound [Splash v]\n    switch costume to (16 v)\nend\nif <([costume # v] of [ground v]) = [16]> then\n    start sound [Splash2 v]\n    switch costume to (20 v)\nend\nshow\nwait until <mouse down?>\nrepeat (2)\n    broadcast (Reset v)\n    hide\nend\n\nwhen I receive [you died v]\nif <([costume # v] of [ground v]) = [3]> then\n    start sound [Splash v]\n    switch costume to (1 v)\nend\nif <([costume # v] of [ground v]) = [4]> then\n    start sound [Splash v]\n    switch costume to (1 v)\nend\nif <([costume # v] of [ground v]) = [5]> then\n    start sound [Splash v]\n    switch costume to (3 v)\nend\nif <([costume # v] of [ground v]) = [7]> then\n    start sound [Sizzle v]\n    switch costume to (5 v)\nend\nif <([costume # v] of [ground v]) = [8]> then\n    start sound [Splash v]\n    switch costume to (3 v)\nend\nif <([costume # v] of [ground v]) = [10]> then\n    start sound [Duck v]\n    switch costume to (7 v)\nend\nif <([costume # v] of [ground v]) = [11]> then\n    start sound [Bite v]\n    switch costume to (9 v)\nend\nif <([costume # v] of [ground v]) = [13]> then\n    start sound [Splash v]\n    switch costume to (11 v)\nend\nif <([costume # v] of [ground v]) = [14]> then\n    start sound [Tennis Hit v]\n    switch costume to (13 v)\nend\nif <([costume # v] of [ground v]) = [15]> then\n    start sound [Splash v]\n    switch costume to (15 v)\nend\nif <([costume # v] of [ground v]) = [16]> then\n    start sound [Splash2 v]\n    switch costume to (19 v)\nend\nshow\nwait until <mouse down?>\nrepeat (2)\n    broadcast (Reset v)\n    hide\nend\n\nwhen flag clicked\nswitch costume to (background v)\ngo to [front v] layer\nshow\n\nwhen I receive [next level v]\nhide\nforever\n    go to [front v] layer\n    set [ghost v] effect to (30)\nend\n\nwhen I receive [victory v]\nswitch costume to (21 v)\nshow\nwait until <mouse down?>\nrepeat (2)\n    broadcast (Reset v)\n    hide\nend\n\ngo [forward v] (1) layers\n\nset [counter v] to [0]\nchange [counter v] by (1)\nif <(Counter) = [1]> then\n    stop [this script v]\nend\n\nstart sound [Splash v]\n\n@Detector\n\nwhen flag clicked\nhide\npoint in direction (90)\nswitch costume to (costume1 v)\nrepeat (2)\n    create clone of (_myself_ v)\n    next costume\nend\n\nwhen I start as a clone\nset [ghost v] effect to (99.9)\nshow\nif <(costume [number v]) = [1]> then\n    forever\n        if <([costume # v] of [you v]) = [1]> then\n            go to (you v)\n            if <not <touching (ground v)?>> then\n                repeat until <touching (ground v)?>\n                    go to (you v)\n                    broadcast (You turn left v)\n                end\n            end\n        end\n        if <([costume # v] of [you v]) = [2]> then\n            go to (you v)\n            if <not <touching (ground v)?>> then\n                repeat until <touching (ground v)?>\n                    go to (you v)\n                    broadcast (You turn left v)\n                end\n            end\n        end\n    end\nend\nif <(costume [number v]) = [2]> then\n    forever\n        if <([costume # v] of [you v]) = [1]> then\n            go to (you v)\n            if <not <touching (ground v)?>> then\n                repeat until <touching (ground v)?>\n                    go to (you v)\n                    broadcast (You turn right v)\n                end\n            end\n        end\n        if <([costume # v] of [you v]) = [2]> then\n            go to (you v)\n            if <not <touching (ground v)?>> then\n                repeat until <touching (ground v)?>\n                    go to (you v)\n                    broadcast (You turn right v)\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    point in direction ([direction v] of [you v])\nend\n\n@Stuff\n\nwhen flag clicked\ngo to [back v] layer\n\nwhen I receive [reset v]\nforever\n    if <(costume [number v]) = [1]> then\n        set [brightness v] effect to (0)\n    end\n    if <(costume [number v]) = [7]> then\n        set [brightness v] effect to (-5)\n    end\n    if <(costume [number v]) = [8]> then\n        set [brightness v] effect to (-10)\n    end\n    if <(costume [number v]) = [9]> then\n        set [brightness v] effect to (-15)\n    end\n    if <(costume [number v]) = [10]> then\n        set [brightness v] effect to (-25)\n    end\n    if <(costume [number v]) = [11]> then\n        set [brightness v] effect to (-55)\n    end\n    if <(costume [number v]) = [12]> then\n        set [brightness v] effect to (-60)\n    end\n    if <(costume [number v]) = [13]> then\n        set [brightness v] effect to (-40)\n    end\n    if <(costume [number v]) = [14]> then\n        set [brightness v] effect to (-40)\n    end\n    if <(costume [number v]) = [15]> then\n        set [brightness v] effect to (-40)\n    end\n    if <(costume [number v]) = [16]> then\n        set [brightness v] effect to (-25)\n    end\n    if <(costume [number v]) = [17]> then\n        set [brightness v] effect to (-15)\n    end\nend\n\nwhen I receive [next level v]\nforever\n    go [forward v] (1) layers\n    go [backward v] (1) layers\n    go to x: (0) y: (-60)\n    switch costume to ([costume # v] of [ground v])\nend\n\n@More stuff\n\nwhen flag clicked\nforever\n    if <([costume # v] of [ground v]) = [7]> then\n        go to x: (0) y: (-60)\n        clear graphic effects\n        switch costume to (1 v)\n        go to [back v] layer\n        show\n    else\n        if <([costume # v] of [ground v]) = [9]> then\n            go to x: (0) y: (-60)\n            set [brightness v] effect to (-15)\n            switch costume to (2 v)\n            go to [back v] layer\n            show\n        else\n            if <([costume # v] of [ground v]) = [15]> then\n                go to x: (0) y: (-60)\n                set [brightness v] effect to (-25)\n                switch costume to (3 v)\n                go to [back v] layer\n                show\n            else\n                if <([costume # v] of [ground v]) = [16]> then\n                    go to x: (0) y: (-60)\n                    set [brightness v] effect to (-15)\n                    switch costume to (4 v)\n                    go to [back v] layer\n                    show\n                else\n                    if <([costume # v] of [ground v]) = [17]> then\n                        go to x: (0) y: (-60)\n                        set [brightness v] effect to (-10)\n                        switch costume to (5 v)\n                        go to [back v] layer\n                        show\n                    else\n                        if <([costume # v] of [ground v]) = [18]> then\n                            go to x: (0) y: (-60)\n                            set [brightness v] effect to (-10)\n                            switch costume to (6 v)\n                            go to [back v] layer\n                            show\n                        else\n                            if <([costume # v] of [ground v]) = [19]> then\n                                go to x: (0) y: (-60)\n                                set [brightness v] effect to (-10)\n                                switch costume to (7 v)\n                                go to [back v] layer\n                                show\n                            else\n                                if <([costume # v] of [ground v]) = [20]> then\n                                    go to x: (0) y: (-60)\n                                    set [brightness v] effect to (-10)\n                                    switch costume to (8 v)\n                                    go to [back v] layer\n                                    show\n                                else\n                                    hide\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\n@Start/Intro\n\nwhen flag clicked\nshow\ngo to [front v] layer\nswitch costume to (dnb v)\nset [ghost v] effect to (100)\nwait (.8) seconds\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nwait (2) seconds\nrepeat (8)\n    next costume\nend\nbroadcast (Clone v)\nbroadcast (Next level v)\nhide\n\nwhen flag clicked\ngo to [front v] layer\nforever\n    go [forward v] (1) layers\nend\n\n@Ground\n\nwhen I receive [next level v]\nbroadcast (Reset v)\nnext costume\n\nwhen I receive [reset v]\nforever\n    if <(costume [number v]) = [1]> then\n        set [brightness v] effect to (0)\n    end\n    if <(costume [number v]) = [7]> then\n        set [brightness v] effect to (-5)\n    end\n    if <(costume [number v]) = [8]> then\n        set [brightness v] effect to (-10)\n    end\n    if <(costume [number v]) = [9]> then\n        set [brightness v] effect to (-15)\n    end\n    if <(costume [number v]) = [10]> then\n        set [brightness v] effect to (-25)\n    end\n    if <(costume [number v]) = [11]> then\n        set [brightness v] effect to (-40)\n    end\n    if <(costume [number v]) = [12]> then\n        set [brightness v] effect to (-60)\n    end\n    if <(costume [number v]) = [13]> then\n        set [brightness v] effect to (-30)\n    end\n    if <(costume [number v]) = [15]> then\n        set [brightness v] effect to (-20)\n    end\n    if <(costume [number v]) = [16]> then\n        set [brightness v] effect to (-15)\n    end\n    if <(costume [number v]) = [17]> then\n        set [brightness v] effect to (-10)\n    end\n    if <(costume [number v]) = [18]> then\n        set [brightness v] effect to (-5)\n    end\n    if <(costume [number v]) = [19]> then\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen flag clicked\nswitch costume to (20 v)\ngo to x: (0) y: (-60)\n\nwhen I receive [victory v]\nwait until <mouse down?>\nbroadcast (Next level v)\n\n@Thumb\n\nwhen flag clicked\nhide\n\n@Instructions\n\nwhen flag clicked\nset [ghost v] effect to (50)\nforever\n    go to [front v] layer\n    if <([costume # v] of [ground v]) = [1]> then\n        go to x: (-178) y: (-117)\n        switch costume to (1 v)\n        show\n    else\n        if <([costume # v] of [ground v]) = [3]> then\n            go to x: (-176) y: (-81)\n            switch costume to (2 v)\n            show\n        else\n            hide\n        end\n    end\nend\n\n@Cloud\n\nwhen I receive [next level v]\nchange [☁ score v] by (1)\n\nwhen flag clicked\nset [☁ score v] to [0]\n\n@:D\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\n
Probably my favourite game I made...\n\nHOW TO MOVE FRED\n-Use the arrows or wasd. \n-If you die, CLICK THE SCREEN (don't press the flag again)\n-To just kick him, ram into the side of Fred. \n-To kick him up, ram into his side while holding the "s" key or down arrow.\n-Make it to the end of every level with Fred\n\nPOINT OF THE GAME \nYou are a box, and your friend, Fred, fell off a 30 story building and you must take him to the hospital. However, the hospital is on the other side of the city, and Fred is to hard to carry, so you must kick him there.\n\nNOTES\n-space to skip\n-You can stand on Fred\n-Press the "r" key to restart in case something goes wrong\n-Not mobile friendly at the moment... but it will be