Shadow platformer v0.5.1

Instructions: Look up: up arrow key\nCrouch: down arrow key\nMove: left &right arrow keys\nJump: C\nRight or Left + X to boost\nChange character: 1, 2, 3, 4\nclassic sonic can spin/roll when holding down+x. its not really any different from running really other than it looking kinda cool i guess, you could pretend hes spindashing too

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop v)\nbroadcast (Idle v)\nforever\n    play sound [Sonic Unleashed “Spagonia Rooftop Run Day“ Music.mp3 v] until done\nend\n\nwhen I receive [finish v]\n\nwhen flag clicked\nforever\n    wait until <key (q v) pressed?>\n    set volume to (0) %\n    wait (0.5) seconds\n    wait until <key (q v) pressed?>\n    set volume to (100) %\n    wait (0.5) seconds\nend\n\nif <(Character) = [1]> then\n    switch backdrop to (finish - shadow v)\nend\nif <(Character) = [2]> then\n    switch backdrop to (finish - mighty v)\nend\nif <(Character) = [3]> then\n    switch backdrop to (finish - sonic v)\nend\nstop [other scripts in stage v]\nplay sound [Sonic Generations “Super Sonic Racing \[Generations Mix\]“ Music.mp3 v] until done\n\nset [boost energy v] to [10]\n\nwhen flag clicked\nforever\n    set [vol v] to [100]\nend\n\n@Ground\n\nwhen [2 v] key pressed\nset [character v] to [2]\n\nwhen [3 v] key pressed\nset [character v] to [3]\n\nwhen I receive [spindash go v]\nif <([direction v] of [shadow v]) = [-90]> then\n    change [x v] by (200)\nend\nif <([direction v] of [shadow v]) = [90]> then\n    change [x v] by (-200)\nend\nrepeat (12)\n    set [idle v] to [0]\nend\n\nwhen I receive [finish v]\nhide\nstop [other scripts in sprite v]\n\nwhen [1 v] key pressed\nset [character v] to [1]\n\nwhen flag clicked\nbroadcast (re/start v)\n\nwhen [4 v] key pressed\nset [character v] to [4]\n\nwhen I receive [re/start v]\ngo to x: (2350) y: ((1160) + ([y position v] of [hitbox v]))\nset [y v] to [0]\nset [x v] to [0]\nshow\ngo to [front v] layer\nset [character v] to [1]\nforever\n    change [y v] by (1)\n    if <key (right arrow v) pressed?> then\n        change [x v] by (-1.5)\n        if <(boost) = [1]> then\n            change [x v] by (-2.5)\n        end\n        if <(spnattk) = [1]> then\n            change [x v] by (-2)\n        end\n    end\n    if <key (left arrow v) pressed?> then\n        change [x v] by (1.5)\n        if <(boost) = [1]> then\n            change [x v] by (2.5)\n        end\n        if <(spnattk) = [1]> then\n            change [x v] by (2)\n        end\n    end\n    set [x v] to ((X) * (0.9))\n    change x by (X)\n    if <touching (hitbox v)?> then\n        change y by (-1)\n        if <touching (hitbox v)?> then\n            change y by (-1)\n            if <touching (hitbox v)?> then\n                change y by (-1)\n                if <touching (hitbox v)?> then\n                    change y by (-1)\n                    if <touching (hitbox v)?> then\n                        change y by (-1)\n                        change x by ((X) * (-1))\n                        change y by (5)\n                    end\n                end\n            end\n        end\n    end\n    change y by (Y)\n    if <touching (hitbox v)?> then\n        change y by ((Y) * (-1))\n        set [y v] to [0]\n    end\n    change y by (1)\n    if <<key (c v) pressed?> and <touching (hitbox v)?>> then\n        set [y v] to [-15]\n    end\n    change y by (-1)\n    if <(Y) > [50]> then\n        broadcast (re/start v)\n        stop [this script v]\n    end\nend\n\nif <<(X) < [0.00001]> or <(X) > [-0.00001]>> then\n    wait (1) seconds\n    change [idle v] by (1)\n    if <(Idle) > [10]> then\n        set [idle v] to [10]\n    end\nend\nif <key (any v) pressed?> then\n    set [idle v] to [0]\nend\n\nwhen I receive [idle v]\n\nwhen flag clicked\nswitch costume to (size v)\nset size to (100) %\nswitch costume to (map v)\nforever\n    set [ground y v] to (Y)\nend\n\n@behind\n\nwhen I receive [re/start v]\ngo to x: (622) y: (1160)\nset [y v] to [0]\nset [x v] to [0]\nshow\ngo to [front v] layer\ngo [backward v] (1) layers\nforever\n    go to (ground v)\nend\n\nwhen [2 v] key pressed\nset [character v] to [2]\n\nwhen [3 v] key pressed\nset [character v] to [3]\n\nwhen I receive [idle v]\nforever\n    if <<(X) < [0.00001]> or <(X) > [-0.00001]>> then\n        wait (1) seconds\n        change [idle v] by (1)\n        if <(Idle) > [10]> then\n            set [idle v] to [10]\n        end\n    end\n    if <key (any v) pressed?> then\n        set [idle v] to [0]\n    end\nend\n\nwhen I receive [finish v]\nhide\nstop [other scripts in sprite v]\n\nwhen flag clicked\nswitch costume to (size v)\nset size to (100) %\nswitch costume to (map \(1\) v)\n\nwhen [1 v] key pressed\nset [character v] to [1]\n\nwhen flag clicked\nbroadcast (re/start v)\n\nchange [y v] by (1)\nif <key (right arrow v) pressed?> then\n    change [x v] by (-1.5)\nend\nif <key (left arrow v) pressed?> then\n    change [x v] by (1.5)\nend\nset [x v] to ((X) * (0.9))\nchange x by (X)\nif <touching (hitbox v)?> then\n    change y by (-1)\n    if <touching (hitbox v)?> then\n        change y by (-1)\n        if <touching (hitbox v)?> then\n            change y by (-1)\n            if <touching (hitbox v)?> then\n                change y by (-1)\n                if <touching (hitbox v)?> then\n                    change y by (-1)\n                    change x by ((X) * (-1))\n                    change y by (5)\n                end\n            end\n        end\n    end\nend\nchange y by (Y)\nif <touching (hitbox v)?> then\n    change y by ((Y) * (-1))\n    set [y v] to [0]\nend\nchange y by (1)\nif <<key (c v) pressed?> and <touching (hitbox v)?>> then\n    set [y v] to [-15]\nend\nchange y by (-1)\nif <(Y) > [50]> then\n    broadcast (re/start v)\n    stop [this script v]\nend\n\nset [character v] to [1]\n\nwhen I receive [spindash go v]\nif <([direction v] of [shadow v]) = [-90]> then\n    change [x v] by (200)\nend\nif <([direction v] of [shadow v]) = [90]> then\n    change [x v] by (-200)\nend\nrepeat (12)\n    set [idle v] to [0]\nend\n\n@Hitbox\n\nwhen flag clicked\nset [boost v] to [0]\nset [jump v] to [0]\nshow\ngo to x: (0) y: (-80)\nforever\n    set [ghost v] effect to (100)\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n    else\n        if <key (left arrow v) pressed?> then\n            point in direction (-90)\n        end\n    end\nend\n\nwhen I receive [finish v]\n\nif <(jump) = [1]> then\n    switch costume to (spin v)\nelse\n    if <(jump) = [0]> then\n        switch costume to (stand v)\n    end\nend\n\nswitch costume to (spin v)\n\nhide\n\nchange y by (10)\n\nchange x by < or >\n\nif <(x position) = [0]> then\nend\n\nif  then\n    set x to (20)\nend\n\nset x to (0)\n\nif  then\n    set x to (-20)\nend\n\n@Shadow\n\ndefine Spindash\nbroadcast (spindash1 v)\nswitch costume to (dash v)\nrepeat (150)\n    next costume\n    if <(costume [number v]) = [1]> then\n        switch costume to (dash v)\n    end\n    broadcast (spindash2 v)\nend\nbroadcast (spindash go v)\nrepeat (5)\n    switch costume to (roll5 v)\nend\nrepeat (5)\n    wait (0) seconds\n    switch costume to (roll v)\n    wait (0) seconds\n    switch costume to (roll2 v)\n    wait (0) seconds\n    switch costume to (roll3 v)\n    wait (0) seconds\n    switch costume to (roll4 v)\n    wait (0) seconds\n    switch costume to (roll5 v)\nend\n\ndefine Idle\n\nwhen flag clicked\nshow\nset [idle v] to [0]\npoint in direction (90)\nforever\n    if <key (c v) pressed?> then\n        switch costume to (roll v)\n        set [jump v] to [1]\n        repeat until <touching (ground v)?>\n            jump/roll\n            if <key (left arrow v) pressed?> then\n                point in direction (-90)\n            end\n            if <key (right arrow v) pressed?> then\n                point in direction (90)\n            end\n        end\n        set [jump v] to [0]\n    else\n        if <<key (left arrow v) pressed?> and <key (right arrow v) pressed?>> then\n            switch costume to (wait v)\n        else\n            if <key (right arrow v) pressed?> then\n                point in direction (90)\n                switch costume to (shadow run v)\n                repeat until <<not <key (right arrow v) pressed?>> or <key (c v) pressed?>>\n                    next costume\n                    if <(costume [number v]) = [6]> then\n                        switch costume to (shadow run v)\n                    end\n                    wait (0.04) seconds\n                end\n            else\n                if <key (left arrow v) pressed?> then\n                    point in direction (-90)\n                    switch costume to (shadow run v)\n                    repeat until <<not <key (left arrow v) pressed?>> or <key (c v) pressed?>>\n                        next costume\n                        if <(costume [number v]) = [6]> then\n                            switch costume to (shadow run v)\n                        end\n                        wait (0.04) seconds\n                    end\n                else\n                    if <key (up arrow v) pressed?> then\n                        switch costume to (look up v)\n                    else\n                        if <key (down arrow v) pressed?> then\n                            switch costume to (duck v)\n                        else\n                            switch costume to (stand v)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    go to [front v] layer\nend\n\nwhen I receive [spindash1 v]\nplay sound [017.Synth_MLT_se_ch_sn_Spindash Charge with Ancient Light Begin v] until done\n\nwhen I receive [spindash2 v]\nplay sound [017.Synth_MLT_se_ch_sn_Spindash Charge with Ancient Light Loop v] until done\nwait (1) seconds\n\nwhen I receive [finish v]\nhide\nstop [other scripts in sprite v]\n\ndefine jump/roll\nnext costume\nif <(costume [number v]) = [13]> then\n    switch costume to (roll v)\nend\n\ndefine jump/roll\n\nwhen flag clicked\nforever\n    go to (hitbox v)\n    if <(Character) = [1]> then\n        set [ghost v] effect to (0)\n        if <key (c v) pressed?> then\n            start sound (pick random (5) to (6))\n            start sound [002.Synth_MLT_se_ch_sn_Jump - Shadow v]\n            repeat until <touching (ground v)?>\n        end\n        if <(boost) = [1]> then\n            start sound (pick random (2) to (5))\n            repeat until <(boost) = [0]>\n        end\n    else\n        if <(Character) = [2]> then\n            set [ghost v] effect to (100)\n        else\n            if <(Character) = [3]> then\n                set [ghost v] effect to (100)\n            else\n                if <(Character) = [4]> then\n                    set [ghost v] effect to (100)\n                end\n            end\n        end\n    end\nend\n\n@background\n\nwhen flag clicked\nshow\ngo [backward v] (1500) layers\ngo to x: (0) y: (0)\nswitch costume to (building-a v)\nset [brightness v] effect to (10)\nforever\n    set y to (([y position v] of [ground v]) * (0.1))\n    set x to (([x position v] of [ground v]) * (0.1))\nend\n\nwhen I receive [finish v]\nhide\nstop [other scripts in sprite v]\n\n@foreground\n\nwhen flag clicked\nshow\ngo [backward v] (150) layers\ngo to x: (0) y: (0)\nset [brightness v] effect to (5)\nswitch costume to (building-a v)\nforever\n    set y to (([y position v] of [ground v]) * (0.2))\n    set x to (([x position v] of [ground v]) * (0.2))\nend\n\nwhen I receive [finish v]\nhide\nstop [other scripts in sprite v]\n\nswitch costume to (building-j v)\n\n@boost meter\n\nwhen I receive [finish v]\nhide\n\nwhen flag clicked\ngo to x: (-170) y: (-150)\nforever\n    show\n    go to [front v] layer\n    if <(boost energy) = [0]> then\n        switch costume to (0 v)\n    else\n        if <(boost energy) = [1]> then\n            switch costume to (1 v)\n        else\n            if <(boost energy) = [2]> then\n                switch costume to (2 v)\n            else\n                if <(boost energy) = [3]> then\n                    switch costume to (3 v)\n                else\n                    if <(boost energy) = [4]> then\n                        switch costume to (4 v)\n                    else\n                        if <(boost energy) = [5]> then\n                            switch costume to (5 v)\n                        else\n                            if <(boost energy) = [6]> then\n                                switch costume to (6 v)\n                            else\n                                if <(boost energy) = [7]> then\n                                    switch costume to (7 v)\n                                else\n                                    if <(boost energy) = [8]> then\n                                        switch costume to (8 v)\n                                    else\n                                        if <(boost energy) = [9]> then\n                                            switch costume to (9 v)\n                                        else\n                                            if <(boost energy) = [10]> then\n                                                switch costume to (10 v)\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nif <(boost energy) = [1]> then\n    switch costume to (0 v)\nelse\nend\n\nif <(boost energy) = [3]> then\n    switch costume to (0 v)\nelse\nend\n\nwhen flag clicked\nforever\n    if <(Character) = [1]> then\n    else\n        if <(Character) = [2]> then\n        else\n            if <(Character) = [3]> then\n            else\n            end\n        end\n    end\nend\n\n@Modern sonic\n\nwhen flag clicked\nshow\nset [idle v] to [0]\npoint in direction (90)\nforever\n    if <key (c v) pressed?> then\n        switch costume to (roll v)\n        repeat until <touching (ground v)?>\n            jump/roll\n            if <key (left arrow v) pressed?> then\n                point in direction (-90)\n            end\n            if <key (right arrow v) pressed?> then\n                point in direction (90)\n            end\n        end\n    else\n        if <<key (left arrow v) pressed?> and <key (right arrow v) pressed?>> then\n            switch costume to (wait v)\n        else\n            if <key (right arrow v) pressed?> then\n                point in direction (90)\n                switch costume to (run v)\n                repeat until <<not <key (right arrow v) pressed?>> or <key (c v) pressed?>>\n                    next costume\n                    if <(costume [number v]) = [6]> then\n                        switch costume to (run v)\n                    end\n                    wait (0.03) seconds\n                end\n            else\n                if <key (left arrow v) pressed?> then\n                    point in direction (-90)\n                    switch costume to (run v)\n                    repeat until <<not <key (left arrow v) pressed?>> or <key (c v) pressed?>>\n                        next costume\n                        if <(costume [number v]) = [6]> then\n                            switch costume to (run v)\n                        end\n                        wait (0.03) seconds\n                    end\n                else\n                    if <key (up arrow v) pressed?> then\n                        switch costume to (look up v)\n                    else\n                        if <key (down arrow v) pressed?> then\n                            switch costume to (crouch v)\n                        else\n                            switch costume to (stand v)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    go to (hitbox v)\n    if <(Character) = [2]> then\n        set [ghost v] effect to (0)\n        if <key (c v) pressed?> then\n            start sound (pick random (5) to (7))\n            start sound [modern jump v]\n            repeat until <touching (ground v)?>\n            end\n        end\n        if <(boost) = [1]> then\n            start sound (pick random (1) to (5))\n            repeat until <(boost) = [0]>\n            end\n        end\n    else\n        if <(Character) = [3]> then\n            set [ghost v] effect to (100)\n        else\n            if <(Character) = [1]> then\n                set [ghost v] effect to (100)\n            else\n                if <(Character) = [4]> then\n                    set [ghost v] effect to (100)\n                else\n                end\n            end\n        end\n    end\nend\n\ndefine jump/roll\nnext costume\nif <(costume [number v]) = [13]> then\n    switch costume to (roll v)\nend\n\n@Mighty\n\nwhen flag clicked\nshow\nset [idle v] to [0]\npoint in direction (90)\nforever\n    if <key (c v) pressed?> then\n        switch costume to (roll v)\n        repeat until <touching (ground v)?>\n            jump/roll\n            if <key (left arrow v) pressed?> then\n                point in direction (-90)\n            end\n            if <key (right arrow v) pressed?> then\n                point in direction (90)\n            end\n        end\n    else\n        if <<key (b v) pressed?> and <key (down arrow v) pressed?>> then\n            set [spnattk v] to [1]\n            spndsh\n            switch costume to (roll v)\n            repeat until <not <key (down arrow v) pressed?>>\n                jump/roll\n                if <key (left arrow v) pressed?> then\n                    point in direction (-90)\n                end\n                if <key (right arrow v) pressed?> then\n                    point in direction (90)\n                end\n            end\n            set [spnattk v] to [0]\n        else\n            if <<key (left arrow v) pressed?> and <key (right arrow v) pressed?>> then\n                switch costume to (wait v)\n            else\n                if <key (right arrow v) pressed?> then\n                    point in direction (90)\n                    switch costume to (run v)\n                    repeat until <<not <key (right arrow v) pressed?>> or <key (c v) pressed?>>\n                        next costume\n                        if <(costume [number v]) = [6]> then\n                            switch costume to (run v)\n                        end\n                        wait (0.04) seconds\n                    end\n                else\n                    if <key (left arrow v) pressed?> then\n                        point in direction (-90)\n                        switch costume to (run v)\n                        repeat until <<not <key (left arrow v) pressed?>> or <key (c v) pressed?>>\n                            next costume\n                            if <(costume [number v]) = [6]> then\n                                switch costume to (run v)\n                            end\n                            wait (0.04) seconds\n                        end\n                    else\n                        if <key (up arrow v) pressed?> then\n                            switch costume to (look up v)\n                        else\n                            if <key (down arrow v) pressed?> then\n                                switch costume to (duck v)\n                            else\n                                switch costume to (stand v)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    go to (hitbox v)\n    if <(Character) = [3]> then\n        set [ghost v] effect to (0)\n        if <key (c v) pressed?> then\n            start sound [003.Synth_MLT_se_ch_sn_Jump - Sonic v]\n            repeat until <touching (ground v)?>\n            end\n        end\n    else\n        if <(Character) = [2]> then\n            set [ghost v] effect to (100)\n        else\n            if <(Character) = [1]> then\n                set [ghost v] effect to (100)\n            else\n                if <(Character) = [4]> then\n                    set [ghost v] effect to (100)\n                else\n                end\n            end\n        end\n    end\nend\n\nrepeat until <(boost) = [0]>\n    next costume\n    if <(costume [number v]) = [6]> then\n        switch costume to (run v)\n    end\nend\n\ndefine jump/roll\nnext costume\nif <(costume [number v]) = [13]> then\n    switch costume to (roll v)\nend\n\ndefine spndsh\nrepeat until <<key (left arrow v) pressed?> or <<key (right arrow v) pressed?> or <not <key (down arrow v) pressed?>>>>\n    switch costume to (spindash v)\n    wait (0.05) seconds\n    switch costume to (dash v)\n    wait (0.05) seconds\nend\n\nswitch costume to (roll v)\nrepeat (5)\n    next costume\n    if <(costume [number v]) = [13]> then\n        switch costume to (roll v)\n    end\nend\n\n@Boost\n\nwhen flag clicked\ngo to (hitbox v)\nforever\n    go to [front v] layer\n    if <<<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> and <key (x v) pressed?>> then\n        repeat until <<(boost energy) < [1]> or <not <<<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> and <key (x v) pressed?>>>>\n            set [boost v] to [1]\n            show\n            if <(spnattk) = [1]> then\n                switch costume to (classic v)\n                set [boost v] to [0]\n            else\n                if <(Character) = [1]> then\n                    switch costume to (boost2/1 v)\n                    start sound [SE_Boost v]\n                    repeat until <<not <key (x v) pressed?>> or <(boost energy) < [0]>>\n                        next costume\n                        if <(costume [number v]) = [5]> then\n                            switch costume to (boost2/1 v)\n                        end\n                        point in direction ([direction v] of [hitbox v])\n                    end\n                else\n                    if <(Character) = [2]> then\n                        switch costume to (boost1/1 v)\n                        start sound [SE_Boost v]\n                        repeat until <<not <key (x v) pressed?>> or <(boost energy) < [0]>>\n                            next costume\n                            if <(costume [number v]) = [3]> then\n                                switch costume to (boost1/1 v)\n                            end\n                            point in direction ([direction v] of [hitbox v])\n                        end\n                    else\n                        if <(Character) = [3]> then\n                            switch costume to (boost3/1 v)\n                            start sound [SE_Boost v]\n                            repeat until <<not <key (x v) pressed?>> or <(boost energy) < [0]>>\n                                next costume\n                                if <(costume [number v]) = [7]> then\n                                    switch costume to (boost3/1 v)\n                                end\n                                point in direction ([direction v] of [hitbox v])\n                            end\n                        else\n                            if <(Character) = [4]> then\n                                start sound [S2HDSFX - Spindash Release v]\n                                repeat until <<not <key (x v) pressed?>> or <(boost energy) < [0]>>\n                                    switch costume to (classic v)\n                                end\n                            else\n                                set [boost v] to [0]\n                            end\n                        end\n                    end\n                end\n                set [boost v] to [0]\n            end\n        end\n        hide\n        set [boost v] to [0]\n    end\nend\n\nstart sound [SE_Boost v]\n\nnext costume\n\nwhen flag clicked\n\nrepeat until \nend\n\npoint towards ( v)\n\nchange [boost energy v] by (1)\n\nif  then\nelse\nend\n\nhide\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    if <(boost) = [1]> then\n        repeat until <(boost) = [0]>\n            wait (0.5) seconds\n            change [boost energy v] by (-1)\n        end\n    end\nend\n\nnext costume\n\nif  then\nelse\nend\nset [boost v] to [0]\nhide\n\nif <(boost energy) < [0]> then\n    wait until <(boost energy) > [0]>\nend\n\nstart sound [SE_Boost v]\n\nplay sound [S2HDSFX - Spindash Release v] until done\n\nwhen flag clicked\nforever\n    wait (2.5) seconds\n    change [boost energy v] by (1)\nend\n\nwhen flag clicked\nforever\n    if <(boost energy) > [10]> then\n        set [boost energy v] to [10]\n        set [boost v] to [0]\n    end\n    if <(boost energy) < [0]> then\n        set [boost energy v] to [0]\n        set [boost v] to [0]\n    end\n    if <<not <<<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> and <key (x v) pressed?>>> and <(boost energy) = [0]>> then\n        set [boost energy v] to [0]\n        set [boost v] to [0]\n    end\nend\n\nnext costume\nif <(costume [number v]) = [1]> then\n    switch costume to (peelout-3 v)\nend\npoint in direction ([direction v] of [hitbox v])\n\n@Classic sonic\n\ndefine jump/roll\nnext costume\nif <(costume [number v]) = [9]> then\n    switch costume to (sonic roll v)\nend\n\nrepeat until <(boost) < [1]>\n    switch costume to (peelout-3 v)\nend\n\nif  then\nend\n\nnext costume\n\nwhen flag clicked\nforever\n    go to (hitbox v)\n    if <(Character) = [4]> then\n        set [ghost v] effect to (0)\n        if <key (c v) pressed?> then\n            start sound [DSJUMP v]\n            repeat until <touching (ground v)?>\n            end\n        end\n    else\n        if <(Character) = [2]> then\n            set [ghost v] effect to (100)\n        else\n            if <(Character) = [1]> then\n                set [ghost v] effect to (100)\n            else\n                if <(Character) = [3]> then\n                    set [ghost v] effect to (100)\n                else\n                end\n            end\n        end\n    end\nend\n\nnext costume\nif <(costume [number v]) = [1]> then\n    switch costume to (peelout-3 v)\nend\n\nwhen flag clicked\nshow\nset [idle v] to [0]\npoint in direction (90)\nset size to (100) %\nset [boost energy v] to [10]\nforever\n    if <key (c v) pressed?> then\n        switch costume to (sonic roll v)\n        repeat until <touching (ground v)?>\n            jump/roll\n            if <key (left arrow v) pressed?> then\n                point in direction (-90)\n            end\n            if <key (right arrow v) pressed?> then\n                point in direction (90)\n            end\n        end\n    else\n        if <<key (x v) pressed?> and <key (down arrow v) pressed?>> then\n            switch costume to (sonic roll v)\n            set [spnattk v] to [1]\n            repeat until <not <key (down arrow v) pressed?>>\n                jump/roll\n                if <key (left arrow v) pressed?> then\n                    point in direction (-90)\n                end\n                if <key (right arrow v) pressed?> then\n                    point in direction (90)\n                end\n            end\n            set [spnattk v] to [0]\n        else\n            if <<key (left arrow v) pressed?> and <key (right arrow v) pressed?>> then\n                switch costume to (sonic stand v)\n            else\n                if <key (right arrow v) pressed?> then\n                    point in direction (90)\n                    switch costume to (run1 v)\n                    repeat until <<not <key (right arrow v) pressed?>> or <key (c v) pressed?>>\n                        if <(boost) = [1]> then\n                            switch costume to (peelout-3 v)\n                            repeat until <<(boost) < [0]> or <<not <<<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> and <key (x v) pressed?>>> or <key (c v) pressed?>>>\n                                next costume\n                                if <key (left arrow v) pressed?> then\n                                    point in direction (-90)\n                                end\n                                if <key (right arrow v) pressed?> then\n                                    point in direction (90)\n                                end\n                                if <(costume [number v]) = [1]> then\n                                    switch costume to (peelout-3 v)\n                                end\n                            end\n                            switch costume to (run1 v)\n                        else\n                            next costume\n                            if <(costume [number v]) = [19]> then\n                                switch costume to (run1 v)\n                            end\n                            wait (0.04) seconds\n                        end\n                    end\n                else\n                    if <key (left arrow v) pressed?> then\n                        point in direction (-90)\n                        switch costume to (run1 v)\n                        repeat until <<not <key (left arrow v) pressed?>> or <key (c v) pressed?>>\n                            if <(boost) = [1]> then\n                                switch costume to (peelout-3 v)\n                                repeat until <<(boost) < [0]> or <not <<<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> and <key (x v) pressed?>>>>\n                                    next costume\n                                    if <(costume [number v]) = [1]> then\n                                        point in direction (-90)\n                                        switch costume to (peelout-3 v)\n                                    end\n                                end\n                                switch costume to (run1 v)\n                            else\n                                next costume\n                                if <(costume [number v]) = [19]> then\n                                    switch costume to (run1 v)\n                                end\n                                wait (0.04) seconds\n                            end\n                        end\n                    else\n                        if <key (up arrow v) pressed?> then\n                            switch costume to (look up v)\n                        else\n                            if <key (down arrow v) pressed?> then\n                                switch costume to (duck v)\n                            else\n                                switch costume to (sonic stand v)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\nend\n\npoint in direction (90)\n\nif <key (left arrow v) pressed?> then\n    point in direction (-90)\nend\nif <key (right arrow v) pressed?> then\n    point in direction (90)\nend\n\nif <(costume [number v]) = [19]> then\nend\n\n@Thumbnail\n\nwhen flag clicked\nhide\n\ngo to [front v] layer\nset size to (200) %\ngo to x: (0) y: (0)\nshow\n\n@End\n\nwhen I receive [re/start v]\n\nwhen [2 v] key pressed\nset [character v] to [2]\n\nwhen [3 v] key pressed\nset [character v] to [3]\n\nwhen I receive [idle v]\nforever\n    if <<(X) < [0.00001]> or <(X) > [-0.00001]>> then\n        wait (1) seconds\n        change [idle v] by (1)\n        if <(Idle) > [10]> then\n            set [idle v] to [10]\n        end\n    end\n    if <key (any v) pressed?> then\n        set [idle v] to [0]\n    end\nend\n\nwhen I receive [spindash go v]\nif <([direction v] of [shadow v]) = [-90]> then\n    change [x v] by (200)\nend\nif <([direction v] of [shadow v]) = [90]> then\n    change [x v] by (-200)\nend\nrepeat (12)\n    set [idle v] to [0]\nend\n\nwhen I receive [finish v]\nhide\nstop [other scripts in sprite v]\n\nwhen flag clicked\nswitch costume to (size v)\nset size to (1000) %\nswitch costume to (map v)\n\nwhen [1 v] key pressed\nset [character v] to [1]\n\nwhen flag clicked\nbroadcast (Re/Start v)\n\nchange [y v] by (1)\nif <key (right arrow v) pressed?> then\n    change [x v] by (-1.5)\nend\nif <key (left arrow v) pressed?> then\n    change [x v] by (1.5)\nend\nset [x v] to ((X) * (0.9))\nchange x by (X)\nif <touching (hitbox v)?> then\n    change y by (-1)\n    if <touching (hitbox v)?> then\n        change y by (-1)\n        if <touching (hitbox v)?> then\n            change y by (-1)\n            if <touching (hitbox v)?> then\n                change y by (-1)\n                if <touching (hitbox v)?> then\n                    change y by (-1)\n                    change x by ((X) * (-1))\n                    change y by (5)\n                end\n            end\n        end\n    end\nend\nchange y by (Y)\nif <touching (hitbox v)?> then\n    change y by ((Y) * (-1))\n    set [y v] to [0]\nend\nchange y by (1)\nif <<key (c v) pressed?> and <touching (hitbox v)?>> then\n    set [y v] to [-15]\nend\nchange y by (-1)\nif <(Y) > [50]> then\n    broadcast (Re/Start v)\n    stop [this script v]\nend\n\nset [character v] to [1]\n\ngo to x: (622) y: (1160)\nset [y v] to [0]\nset [x v] to [0]\nshow\ngo to [front v] layer\ngo [backward v] (1) layers\nforever\n    go to (ground v)\n    if <touching (hitbox v)?> then\n        broadcast (Finish v)\n    end\nend\n\n