Sonic platformer v0.7


@Stage\n\nwhen flag clicked\nforever\n    play sound (pick random (1) to (2)) until done\nend\n\n@Ground-scroll\n\nwhen I receive [re/start v]\nset [ypos v] to [0]\nset [xpos v] to [0]\nshow\ngo to [front v] layer\ngo to x: (-3) y: (0)\nforever\n    change [ypos v] by (1)\n    if <key (right arrow v) pressed?> then\n        change [xpos v] by (-1.5)\n        if <(Sonic_SpinDash) = [1]> then\n            change [xpos v] by (-2)\n        end\n    end\n    if <key (left arrow v) pressed?> then\n        change [xpos v] by (1.5)\n        if <(Sonic_SpinDash) = [1]> then\n            change [xpos v] by (2)\n        end\n    end\n    set [xpos v] to ((xPos) * (0.9))\n    change x by (xPos)\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 ((xPos) * (-1))\n                        change y by (5)\n                    end\n                end\n            end\n        end\n    end\n    change y by (yPos)\n    if <touching (hitbox v)?> then\n        change y by ((yPos) * (-1))\n        set [ypos v] to [0]\n    end\n    change y by (1)\n    if <<<key (c v) pressed?> and <not <key (down arrow v) pressed?>>> and <touching (hitbox v)?>> then\n        start sound [DSJUMP v]\n        set [ypos v] to [-15]\n        set [jump v] to [1]\n    else\n        set [jump v] to [0]\n    end\n    change y by (-1)\n    if <(yPos) > [50]> then\n        broadcast (re/start v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nswitch costume to (size v)\nset size to (350) %\nswitch costume to (map v)\n\nwhen flag clicked\nbroadcast (Re/Start v)\n\n@snow\n\nwhen flag clicked\nforever\n    hide\n    create clone of (_myself_ v)\n    wait (0.05) seconds\nend\n\nwhen I start as a clone\ngo to (random position v)\nset y to (180)\nshow\nforever\n    go to [front v] layer\n    change y by (-3)\n    if <touching (ground-scroll v)?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        delete this clone\n    else\n        if <(y position) < [-170]> then\n            delete this clone\n        end\n    end\n    if <key (c v) pressed?> then\n        change y by (-2)\n    else\n        if <key (right arrow v) pressed?> then\n            change x by (-5)\n        else\n            if <key (left arrow v) pressed?> then\n                change x by (5)\n            end\n        end\n    end\nend\n\nwait (0.1) seconds\nrepeat until <key (e v) pressed?>\nend\n\nrepeat until <key (a v) pressed?>\nend\n\n@hitbox\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    set [ghost v] effect to (100)\n    if <(Sonic_SpinDash) = [1]> then\n        repeat until <(Sonic_SpinDash) = [0]>\n            switch costume to (stand2 v)\n        end\n    else\n        switch costume to (stand v)\n    end\nend\n\n@Sonic\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    go to [front v] layer\n    if <not <(yPos) = [0]>> then\n        switch costume to (roll v)\n        repeat until <touching (ground-scroll v)?>\n            next costume\n            if <(costume [number v]) = [13]> then\n                switch costume to (roll v)\n            end\n            if <key (right arrow v) pressed?> then\n                point in direction (90)\n            end\n            if <key (left arrow v) pressed?> then\n                point in direction (-90)\n            end\n            wait (0.005) seconds\n        end\n    else\n        if <<key (down arrow v) pressed?> and <<key (c v) pressed?> and <touching (ground-scroll v)?>>> then\n            switch costume to (dash v)\n            start sound [DSSPNDSH v]\n            repeat until <<key (left arrow v) pressed?> or <<key (right arrow v) pressed?> or <not <key (down arrow v) pressed?>>>>\n                next costume\n                if <(costume [number v]) = [1]> then\n                    switch costume to (dash v)\n                end\n            end\n            set [sonic_spindash v] to [1]\n            start sound [DSZOOM v]\n            switch costume to (roll v)\n            repeat until <not <<key (left arrow v) pressed?> or <key (right arrow v) pressed?>>>\n                next costume\n                if <(costume [number v]) = [13]> then\n                    switch costume to (roll v)\n                end\n                if <key (right arrow v) pressed?> then\n                    point in direction (90)\n                end\n                if <key (left arrow v) pressed?> then\n                    point in direction (-90)\n                end\n                if <key (c v) pressed?> then\n                    set [sonic_jump v] to [1]\n                end\n            end\n            set [sonic_spindash v] to [0]\n        else\n            if <(xPos) < [-0.5]> then\n                switch costume to (run v)\n                point in direction (90)\n                repeat until <<not <(xPos) < [-0.5]>> or <<key (c v) pressed?> or <<key (down arrow v) pressed?> and <key (b v) pressed?>>>>\n                    next costume\n                    if <(costume [number v]) = [6]> then\n                        switch costume to (run v)\n                    end\n                    wait ((4) / (xPos)) seconds\n                end\n            else\n                if <(xPos) > [0.5]> then\n                    switch costume to (run v)\n                    point in direction (-90)\n                    repeat until <<not <(xPos) > [0.5]>> or <<key (c v) pressed?> or <<key (down arrow v) pressed?> and <key (b v) pressed?>>>>\n                        next costume\n                        if <(costume [number v]) = [6]> then\n                            switch costume to (run v)\n                        end\n                        wait ((4) / ((xPos) * (-1))) 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\nend\n\nset [sonic_jump v] to [0]\n\n@thumbnail\n\nwhen flag clicked\nhide\n\nshow\ngo to x: (0) y: (0)\ngo to [front v] layer\n\n