Platformer Engine #all #games

Instructions: READ BELOW BEFORE YOU COMMENT \n\nSo the point of this game is to keep moving. If you stop moving, you die. So never let go of the arrow keys! That's about it :P Oh yeah, don't touch the spikes.

@Stage\n\n@Sprite1\n\n@Intro\n\nwhen flag clicked\nstart sound [Intro v]\nshow\nswitch costume to (bbmlogo v)\nset [ghost v] effect to (0)\ngo to x: (0) y: (0)\nset size to (0) %\npoint in direction (90)\nrepeat (20)\n    change size by (5)\n    turn right (70) degrees\nend\npoint in direction (90)\nrepeat (5)\n    repeat (15)\n        change size by (.7)\n    end\n    repeat (15)\n        change size by (-.7)\n    end\nend\nwait (1) seconds\nrepeat (50)\n    change [ghost v] effect by (10)\nend\nhide\nbroadcast (Start v)\n\nwhen flag clicked\nset volume to (100) %\nwait (5) seconds\nrepeat (40)\n    change volume by (-2.5)\nend\n\n@Darkness\n\nwhen I receive [start v]\nchange [☁ players v] by (1)\nset [time v] to [0]\ngo to x: (-200) y: (-80)\nshow\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n        change [xv v] by (1)\n    end\n    if <key (left arrow v) pressed?> then\n        point in direction (-90)\n        change [xv v] by (-1)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <touching (level v)?> then\n        change y by (1)\n        if <touching (level v)?> then\n            change y by (1)\n            if <touching (level v)?> then\n                change y by (1)\n                if <touching (level v)?> then\n                    change y by (1)\n                    if <touching (level v)?> then\n                        change y by (1)\n                        if <touching (level v)?> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <key (up arrow v) pressed?> then\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-5]\n                                else\n                                    set [xv v] to [5]\n                                end\n                                set [yv v] to [10]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-1)\n    change y by (Yv)\n    if <touching (level v)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching (level v)?> then\n        if <key (up arrow v) pressed?> then\n            set [yv v] to [15]\n        end\n    end\n    change y by (1)\n    if <(x position) > [220]> then\n        broadcast (Next v)\n        go to x: (-200) y: (-80)\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\n    if <[-175] > (y position)> then\n        go to x: (-200) y: (-80)\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\n    if <touching (spikes v)?> then\n        go to x: (-200) y: (-80)\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nset volume to (100) %\nforever\n    play sound [Purple Planet Music - Uprising 2823A1629 110bpm v] until done\nend\n\nwhen I receive [mute v]\nset volume to (0) %\n\nwhen I receive [unmute v]\nset volume to (100) %\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nhide\n\n@Level\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nswitch costume to (1 v)\nshow\n\nwhen I receive [next v]\nif <(costume [number v]) = [10]> then\n    broadcast (end v)\nelse\n    next costume\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nhide\n\n@Glow\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nshow\nforever\n    go to (darkness v)\n    go to [back v] layer\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nhide\n\n@Sprite2\n\nwhen flag clicked\nhide variable [☁ record v]\nhide variable [time v]\nhide\n\nwhen I receive [end v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [start v]\nshow variable [☁ record v]\nshow variable [time v]\nshow\nforever\n    go to [front v] layer\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        if <(costume [name v]) = [0%]> then\n            switch costume to (100% v)\n            broadcast (Unmute v)\n        else\n            switch costume to (0% v)\n            broadcast (Mute v)\n        end\n        wait until <not <mouse down?>>\n    end\nend\n\nwhen I receive [start v]\nforever\n    change [time v] by (0.03)\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nhide\n\n@Spikes\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nswitch costume to (1 v)\nshow\n\nwhen I receive [next v]\nnext costume\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nhide\n\n@Outro2Scratch\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [end v]\nwait (1.5) seconds\nforever\n    wait (pick random (.02) to (.2)) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\ngo to [front v] layer\nswitch costume to (pick random (1) to (3))\nif <(costume [number v]) = [4]> then\n    set size to (25) %\nelse\n    set size to (10) %\nend\npoint in direction (pick random (1) to (360))\ngo to x: (pick random (-240) to (240)) y: (182)\nshow\nglide (.5) secs to x: (x position) y: (-182)\nhide\ndelete this clone\n\n@OutroForScratch\n\ndefine Change Size (change) (speed)\nset [sizegoal v] to ((size) + (change))\nrepeat until <([abs v] of ((SizeGoal) - (size)) ) < [0.1]>\n    change size by (((SizeGoal) - (size)) * ((speed) / (5)))\nend\n\ndefine Glide (x) (y) (speed)\nrepeat (50)\n    change x by (((x) - (x position)) * ((speed) / (5)))\n    change y by (((y) - (y position)) * ((speed) / (5)))\nend\n\nwhen flag clicked\nset size to (100) %\nclear graphic effects\nswitch costume to (costume1 v)\nset [outro: clone id v] to [1]\ngo to x: (0) y: (0)\n\nwhen I start as a clone\nif <(Outro: Clone ID) = [1]> then\n    set size to (400) %\n    switch costume to (costume2 v)\n    go to x: (0) y: (195)\n    Glide (0) (0) (1.5)\nelse\n    if <(Outro: Clone ID) = [2]> then\n        go to [front v] layer\n        switch costume to (costume4 v)\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n        delete this clone\n    else\n        if <(Outro: Clone ID) = [3]> then\n            switch costume to (costume5 v)\n            forever\n                point in direction ((([sin v] of (rfvdcsx) ) * (7)) + (90))\n                change y by ([sin v] of (rfvdcsx) )\n                change size by ([sin v] of (rfvdcsx) )\n                change [rfvdcsx v] by (10)\n            end\n        else\n            if <(Outro: Clone ID) = [4]> then\n                switch costume to (costume6 v)\n                Change Size (900) (0.8)\n            else\n                if <(Outro: Clone ID) = [5]> then\n                    set [ghost v] effect to (100)\n                    switch costume to (costume7 v)\n                    go to [front v] layer\n                    repeat (20)\n                        change [ghost v] effect by (-5)\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nif <(Outro: Clone ID) = [1]> then\n    wait until <(Outro: Clone ID) = [2]>\n    next costume\n    go to [front v] layer\n    Change Size (250) (0.5)\nend\n\nwhen I receive [end v]\nchange [☁ finishers v] by (1)\nif <(Time) < (☁ Record)> then\n    set [☁ record v] to (Time)\nend\nwait (0.8) seconds\ncreate clone of (_myself_ v)\nwait (0.7) seconds\nrepeat (3)\n    change [outro: clone id v] by (1)\n    create clone of (_myself_ v)\nend\nwait (3) seconds\nset [outro: clone id v] to [5]\ncreate clone of (_myself_ v)\nwait (3) seconds\n\nwhen I receive [end v]\nwait (1.5) seconds\nforever\n    play sound [Outro v] until done\nend\n\nwhen I start as a clone\nwait (1) seconds\nforever\n    point in direction ((([sin v] of (rfvdcsx) ) * (7)) + (90))\n    change y by ([sin v] of (rfvdcsx) )\n    change size by ([sin v] of (rfvdcsx) )\n    change [rfvdcsx v] by (1)\nend\n\n@Sprite3\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\n