Platformer Engine v1.2
@Stage\n\nwhen [m v] key pressed\nshow variable [mouse v]\nset [mouse v] to (join (mouse x) (join [,] (mouse y)))\n\nwhen flag clicked\nforever\n    play sound [Add some music here. v] until done\n    wait (2) seconds\nend\n\nwhen [h v] key pressed\nhide variable [mouse v]\n\n@Blank\n\n@TN\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\n@Guy\n\ndefine setup\nshow\ngo to [front v] layer\nset rotation style [left-right v]\ngo to x: (-210) y: (-80)\npoint in direction (90)\nset [ghost v] effect to (100)\nset size to (100) %\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nset [xvel v] to [0]\nset [yvel v] to [0]\n\nwhen flag clicked\nset [level v] to [1]\n\nwhen I receive [yellow ring v]\nif <(Gravity) = [0]> then\n    set [yvel v] to [15]\nelse\n    set [yvel v] to [-15]\nend\n\nwhen I receive [purple ring v]\nif <(Gravity) = [0]> then\n    set [yvel v] to [9]\nelse\n    set [yvel v] to [-9]\nend\n\nwhen I receive [red ring v]\nif <(Gravity) = [0]> then\n    set [yvel v] to [18]\nelse\n    set [yvel v] to [-18]\nend\n\nwhen I receive [restart v]\nsetup\n\nwhen I receive [outro v]\nhide\n\nwhen flag clicked\nset [level v] to [1]\nsetup\nforever\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        if <<<key (down arrow v) pressed?> or <key (s v) pressed?>> or <<mouse down?> and <(mouse y) < (y position)>>> then\n            point in direction (90)\n            change [xvel v] by (0.5)\n        else\n            point in direction (90)\n            change [xvel v] by (0.75)\n        end\n    end\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        if <<<key (down arrow v) pressed?> or <key (s v) pressed?>> or <<mouse down?> and <(mouse y) < (y position)>>> then\n            point in direction (-90)\n            change [xvel v] by (-0.5)\n        else\n            point in direction (-90)\n            change [xvel v] by (-0.75)\n        end\n    end\n    set [xvel v] to ((Xvel) * (0.9))\n    change x by (Xvel)\n    if <(Gravity) = [1]> then\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 y by (-1)\n                                if <touching (level v)?> then\n                                    change y by (-1)\n                                    if <touching (level v)?> then\n                                        change x by ((Xvel) * (-1))\n                                        change y by (-1)\n                                        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n                                            if <(Xvel) > [0]> then\n                                                set [xvel v] to [-7]\n                                            else\n                                                set [xvel v] to [7]\n                                            end\n                                            set [yvel v] to [-12]\n                                        else\n                                            set [xvel v] to [0]\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        change [yvel v] by (1)\n        change y by (Yvel)\n        if <touching (level v)?> then\n            change y by ((Yvel) * (-1))\n            set [yvel v] to [0]\n        end\n        change y by (1)\n        if <touching (level v)?> then\n            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n                set [yvel v] to [-15]\n            end\n        end\n        change y by (-1)\n    else\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 y by (1)\n                                if <touching (level v)?> then\n                                    change y by (1)\n                                    if <touching (level v)?> then\n                                        change x by ((Xvel) * (-1))\n                                        change y by (1)\n                                        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n                                            if <(Xvel) > [0]> then\n                                                set [xvel v] to [-7]\n                                            else\n                                                set [xvel v] to [7]\n                                            end\n                                            set [yvel v] to [12]\n                                        else\n                                            set [xvel v] to [0]\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        change [yvel v] by (-1)\n        change y by (Yvel)\n        if <touching (level v)?> then\n            change y by ((Yvel) * (-1))\n            set [yvel v] to [0]\n        end\n        change y by (-1)\n        if <touching (level v)?> then\n            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n                set [yvel v] to [15]\n            end\n        end\n        change y by (1)\n    end\n    if <<(x position) > [239]> or <key (b v) pressed?>> then\n        if <(Level) = [5]> then\n            set [level v] to [1]\n            setup\n        else\n            change [level v] by (1)\n            broadcast (Next Level v)\n            setup\n        end\n    end\n    if <<touching color (#ff6666)?> or <touching color (#bd4c4c)?>> then\n        broadcast (Restart v)\n    end\n    if <<<key (down arrow v) pressed?> or <key (s v) pressed?>> or <<mouse down?> and <(mouse y) < (y position)>>> then\n        switch costume to (costume2 v)\n    else\n        switch costume to (costume1 v)\n    end\n    if <key (r v) pressed?> then\n        broadcast (Restart v)\n    end\nend\n\nwhen flag clicked\nset [gravity v] to [0]\nforever\n    if <touching color (#bbd100)?> then\n        set [gravity v] to [0]\n    end\n    if <touching color (#0095d2)?> then\n        set [gravity v] to [1]\n    end\nend\n\nwhen I receive [black ring v]\nif <(Gravity) = [0]> then\n    set [yvel v] to [-10]\nelse\n    set [yvel v] to [10]\nend\n\nwhen I receive [gravity switch v]\nif <(Gravity) = [0]> then\n    set [gravity v] to [1]\nelse\n    set [gravity v] to [0]\nend\n\nwhen I receive [mini v]\nif <touching color (#ff00d4)?> then\n    set size to (50) %\nelse\n    set size to (100) %\nend\n\nwhen flag clicked\nforever\n    if <<touching color (#ff00d4)?> or <touching color (#5ae494)?>> then\n        broadcast (Mini v)\n        wait until <not <<touching color (#ff00d4)?> or <touching color (#5ae494)?>>>\n    end\nend\n\n@Level\n\nwhen flag clicked\nswitch costume to (1 v)\n\nwhen I receive [next level v]\nnext costume\n\n@Other\n\nwhen flag clicked\ngo to [back v] layer\nswitch costume to (1 v)\n\nwhen I receive [next level v]\nnext costume\n\n@Rings\n\nwhen flag clicked\nset [delete all clones? v] to [yes]\nhide\n\ndefine Clone Ring (#) x: (x) y: (y)\ngo to x: (x) y: (y)\nswitch costume to (#)\nset [i v] to (#)\ncreate clone of (_myself_ v)\n\nwhen I receive [next level v]\nset [delete all clones? v] to [yes]\nwait (0.1) seconds\nset [delete all clones? v] to [no]\nif <(Level) = [1]> then\n    Clone Ring [2] x: [118] y: [-48]\nend\nif <(Level) = [4]> then\n    Clone Ring [4] x: [104] y: [108]\nend\nstop [this script v]\n\nwhen I start as a clone\nshow\nrepeat until <(delete all clones?) = [yes]>\n    if <<touching (guy v)?> and <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <mouse down?>>> then\n        if <(i) = [1]> then\n            broadcast (Yellow Ring v)\n        end\n        if <(i) = [2]> then\n            broadcast (Purple Ring v)\n        end\n        if <(i) = [3]> then\n            broadcast (Red Ring v)\n        end\n        if <(i) = [4]> then\n            broadcast (Black Ring v)\n        end\n        if <(i) = [5]> then\n            broadcast (Gravity Switch v)\n        end\n    end\nend\ndelete this clone\n\nwhen I receive [restart v]\nset [delete all clones? v] to [yes]\nwait (0.1) seconds\nset [delete all clones? v] to [no]\nif <(Level) = [1]> then\n    Clone Ring [2] x: [118] y: [-48]\nend\nif <(Level) = [4]> then\n    Clone Ring [4] x: [104] y: [108]\nend\nstop [this script v]\n\nwhen flag clicked\nset [delete all clones? v] to [yes]\nwait (0.1) seconds\nset [delete all clones? v] to [no]\nif <(Level) = [1]> then\n    Clone Ring [2] x: [118] y: [-48]\nend\nif <(Level) = [4]> then\n    Clone Ring [4] x: [104] y: [108]\nend\nstop [this script v]\n\n@Tramps\n\nwhen flag clicked\nset [delete all clones? v] to [yes]\nhide\n\ndefine Clone Tramp (#) x: (x) y: (y)\ngo to x: (x) y: (y)\nswitch costume to (#)\nset [i v] to (#)\ncreate clone of (_myself_ v)\n\nwhen I receive [next level v]\nset [delete all clones? v] to [yes]\nwait (0.1) seconds\nset [delete all clones? v] to [no]\nif <(Level) = [1]> then\n    Clone Tramp [1] x: [-152] y: [-79]\nend\nstop [this script v]\n\nwhen I start as a clone\nshow\nrepeat until <(delete all clones?) = [yes]>\n    if <touching (guy v)?> then\n        if <(i) = [1]> then\n            broadcast (Yellow Ring v)\n        end\n        if <(i) = [2]> then\n            broadcast (Gravity Switch v)\n        end\n    end\nend\ndelete this clone\n\nwhen I receive [restart v]\nset [delete all clones? v] to [yes]\nwait (0.1) seconds\nset [delete all clones? v] to [no]\nif <(Level) = [1]> then\n    Clone Tramp [1] x: [-152] y: [-79]\nend\nstop [this script v]\n\nwhen flag clicked\nset [delete all clones? v] to [yes]\nwait (0.1) seconds\nset [delete all clones? v] to [no]\nif <(Level) = [1]> then\n    Clone Tramp [1] x: [-152] y: [-79]\nend\nstop [this script v]\n\n@Sun\n\nwhen flag clicked\ngo to [back v] layer\nreset timer\nforever\n    go to x: (-240) y: (180)\n    set size to ((([sin v] of ((timer) * (160)) ) * (20)) + (120)) %\nend\n\n@Enemy\n\nwhen flag clicked\nset [delete all clones? v] to [yes]\nhide\n\ndefine Clone Enemy (#) x: (x) y: (y)\ngo to x: (x) y: (y)\nswitch costume to (#)\nset [i v] to (#)\ncreate clone of (_myself_ v)\n\nwhen I receive [next level v]\nset [delete all clones? v] to [yes]\nwait (0.1) seconds\nset [delete all clones? v] to [no]\nif <(Level) = [1]> then\n    Clone Enemy [1] x: [126] y: [149]\nend\nstop [this script v]\n\nwhen I start as a clone\npoint in direction (90)\nclear graphic effects\nset size to (100) %\nshow\nset [enemyx v] to [0]\nset [enemyy v] to [0]\ngo to [front v] layer\nrepeat until <(delete all clones?) = [yes]>\n    if <touching (guy v)?> then\n        if <([y position v] of [guy v]) > ((y position) + (17.5))> then\n            set [yvel v] to [15]\n            delete this clone\n        else\n            broadcast (Restart v)\n        end\n    end\n    change [enemyy v] by (-1)\n    if <([x position v] of [guy v]) < ((x position) - (10))> then\n        change [enemyx v] by ((0) - ((Speed) / (10)))\n        point in direction (-90)\n    end\n    if <((x position) - (-10)) < ([x position v] of [guy v])> then\n        change [enemyx v] by ((Speed) / (10))\n        point in direction (90)\n    end\n    set [enemyx v] to ((Enemyx) * (0.9))\n    change x by (Enemyx)\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (-4)\n        change x by ((Enemyx) * (-1))\n        if <(y position) < ([x position v] of [guy v])> then\n            set [enemyy v] to [10]\n            if <([abs v] of (x) ) = (x)> then\n                set [enemyx v] to [-10]\n            else\n                set [enemyx v] to [10]\n            end\n        else\n            set [enemyx v] to [0]\n        end\n    end\n    change y by (Enemyy)\n    if <touching (level v)?> then\n        change y by ((Enemyy) - ((Enemyy) * (2)))\n        set [enemyy v] to [0]\n    end\n    change y by (-1)\n    if <<((y position) - (-50)) < ([x position v] of [guy v])> and <touching (level v)?>> then\n        set [enemyy v] to [14]\n    end\n    change y by (1)\nend\ndelete this clone\n\nwhen I receive [restart v]\nset [delete all clones? v] to [yes]\nwait (0.1) seconds\nset [delete all clones? v] to [no]\nif <(Level) = [10]> then\n    Clone Enemy [1] x: [180] y: [117]\nend\nif <(Level) = [11]> then\n    Clone Enemy [1] x: [145] y: [-94]\n    Clone Enemy [1] x: [90] y: [-94]\nend\nstop [this script v]\n\nwhen I receive [restart v]\nset [delete all clones? v] to [yes]\nwait (0.1) seconds\nset [delete all clones? v] to [no]\nif <(Level) = [1]> then\n    Clone Enemy [1] x: [126] y: [149]\nend\nstop [this script v]\n\nwhen flag clicked\nset [delete all clones? v] to [yes]\nwait (0.1) seconds\nset [delete all clones? v] to [no]\nif <(Level) = [1]> then\n    Clone Enemy [1] x: [126] y: [149]\nend\nstop [this script v]\n\n
➔ ᴛʜɪs ɪs ᴀ ᴘʟᴀᴛғᴏʀᴍᴇʀ ᴇɴɢɪɴᴇ ɪ ᴍᴀᴅᴇ! \n➔ ғʀᴇᴇ ᴛᴏ ʀᴇᴍɪx ᴡɪᴛʜ ᴄʀᴇᴅɪᴛ.\n\n-ɪɴsᴛʀᴜᴄᴛɪᴏɴs- \n➔ ᴜsᴇ ᴛʜᴇ ᴡᴀsᴅ ᴏʀ ᴀʀʀᴏᴡ ᴋᴇʏs ᴛᴏ ᴍᴏᴠᴇ. \n➔ ᴀᴠᴏɪᴅ sᴘɪᴋᴇs, ᴇɴᴇᴍɪᴇs, ᴀɴᴅ ʟᴀᴠᴀ. \n➔ ᴊᴜᴍᴘ ᴏɴᴛᴏ ᴛʜᴇ ᴛʀᴀᴍᴘᴏʟɪɴᴇs ᴛᴏ ɢᴇᴛ ᴀ ʙᴏᴏsᴛ. \n➔ ᴛᴀᴘ ᴡʜɪʟᴇ ᴛᴏᴜᴄʜɪɴɢ ᴀ ʀɪɴɢ ᴛᴏ ᴊᴜᴍᴘ ɪɴ ᴍɪᴅ-ᴀɪʀ. \n➔ ʏᴏᴜ ᴄᴀɴ ʙᴏᴜɴᴄᴇ ᴏɴ ᴛʜᴇ ᴇɴᴇᴍɪᴇs ᴛᴏ ᴅᴇғᴇᴀᴛ ᴛʜᴇᴍ.\n\n-ᴄʀᴇᴅɪᴛs- \n➔ ᴇɴᴇᴍʏ ᴀ. ɪ. ᴘʜʏsɪᴄs ʙʏ @0014049 (ᴅᴇʟᴇᴛᴇᴅ ᴀᴄᴄᴏᴜɴᴛ ғᴏʀ ɴᴏ ɢᴏᴏᴅ ʀᴇᴀsᴏɴ), ᴍᴏᴅɪғɪᴇᴅ ʙʏ ᴍᴇ. \n➔ ᴇᴠᴇʀʏᴛʜɪɴɢ ᴇʟsᴇ ʙʏ @SGChase18.  \n\n-ᴜᴘᴅᴀᴛᴇs- \n➔ ᴠ1.2 (3/29) ᴀᴅᴅᴇᴅ ᴍɪɴɪ ᴘᴏʀᴛᴀʟs.\n➔ ᴠ1.1 (3/28) ᴀᴅᴅᴇᴅ ɢʀᴀᴠɪᴛʏ sᴡɪᴛᴄʜ ᴀɴᴅ ʙʟᴀᴄᴋ ʀɪɴɢs.\n➔ ᴠ1.0 (3/18) ɪɴɪᴛɪᴀʟ ʀᴇʟᴇᴀsᴇ ᴅᴀᴛᴇ.\n