Platformer Engine #game #platformer
@Stage\n\nwhen flag clicked\nset [levels v] to [1]\nforever\n    switch backdrop to (levels)\nend\n\n@player\n\nwhen flag clicked\nset [levels v] to [1]\nbroadcast (next level pog v)\nswitch costume to (normal v)\nclear graphic effects\nset size to (90) %\nshow\nset [x_velocity v] to [0]\nset [y_velocity v] to [0]\nforever\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        change [x_velocity v] by (1)\n        switch costume to (right v)\n    end\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(x position) > (mouse x)>>> then\n        change [x_velocity v] by (-1)\n        switch costume to (left v)\n    end\n    set [x_velocity v] to ((X_velocity) * (0.91))\n    change x by (X_velocity)\n    if <touching (ground v)?> then\n        change y by (1)\n        if <touching (ground v)?> then\n            change y by (1)\n            if <touching (ground v)?> then\n                change y by (1)\n                if <touching (ground v)?> then\n                    change y by (1)\n                    if <touching (ground v)?> then\n                        change y by (1)\n                        if <touching (ground v)?> then\n                            change y by (-4)\n                            change x by ((X_velocity) * (-1))\n                            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n                                if <(X_velocity) > [0]> then\n                                    set [x_velocity v] to [-10]\n                                else\n                                    set [x_velocity v] to [10]\n                                end\n                                set [y_velocity v] to [15]\n                            else\n                                set [x_velocity v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y_velocity v] by (-1)\n    change y by (Y_velocity)\n    if <touching (ground v)?> then\n        change y by ((Y_velocity) - ((Y_velocity) * (2)))\n        set [y_velocity v] to [0]\n    end\n    change y by (-1)\n    if <<touching (ground v)?> and <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n        set [y_velocity v] to [17]\n    end\n    change y by (1)\n    if <(x position) > [240]> then\n        broadcast (next level pog v)\n        change [levels v] by (1)\n    end\n    if <[-180] > (y position)> then\n        broadcast (reset oof v)\n    end\n    if <touching (spike  v)?> then\n        broadcast (reset oof v)\n    end\n    if <touching (trampoline v)?> then\n        set [y_velocity v] to [20]\n        start sound [Boing v]\n    end\n    if <touching (acid v)?> then\n        broadcast (reset oof v)\n    end\nend\n\nwhen I receive [next level pog v]\nbroadcast (reset oof v)\n\nwhen I receive [reset oof v]\nset [x_velocity v] to [0]\nset [y_velocity v] to [0]\ngo to x: (-204) y: (20)\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nswitch costume to (clone v)\nrepeat (10)\n    change [ghost v] effect by (5)\n    change size by (-5)\nend\ndelete this clone\n\n@ground\n\nwhen flag clicked\ngo [forward v] (1) layers\nforever\n    switch costume to (levels)\nend\n\n@spike \n\nwhen flag clicked\nforever\n    switch costume to (levels)\nend\n\n@acid\n\nwhen flag clicked\nforever\n    repeat (10)\n        change y by (1)\n    end\n    repeat (20)\n        change y by (-1)\n    end\n    repeat (10)\n        change y by (1)\n    end\nend\n\nwhen flag clicked\nforever\n    switch costume to (levels)\nend\n\n@trampoline\n\nwhen flag clicked\nforever\n    if <(levels) = [1]> then\n        hide\n    end\n    if <(levels) = [2]> then\n        hide\n    end\n    if <(levels) = [3]> then\n        hide\n    end\n    if <(levels) = [4]> then\n        hide\n    end\n    if <(levels) = [5]> then\n        show\n    end\n    if <(levels) = [6]> then\n        hide\n    end\nend\n\nwhen flag clicked\nswitch costume to (normal v)\nforever\n    if <touching (player v)?> then\n        next costume\n        wait (0.5) seconds\n        next costume\n    end\nend\n\n@Love fave\n\nwhen flag clicked\nset [costume v] to [0]\nhide\nforever\n    if <not <<(LOVED__) = [1]> and <(FAVED___) = [1]>>> then\n        wait (pick random (30) to (40)) seconds\n        switch costume to (costume1 v)\n        go to x: (0) y: (50)\n        show\n        go to [front v] layer\n        start sound [pop v]\n        repeat (9)\n            change y by (-6)\n        end\n        repeat (5)\n            change y by (3)\n        end\n        repeat (5)\n            change y by (-1)\n        end\n        wait (2) seconds\n        repeat (15)\n            change y by (7)\n        end\n        hide\n    end\n    if <(Costume) > [0]> then\n        hide\n        stop [this script v]\n    end\nend\n\n@tb\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\ngo to [front v] layer\n\n
Be creative!!\nMake sure to credit @DrWine31!\n▪ mobile-friendly\n▪ levels\n▪ spikes\n▪ trampolines\n▪ wall jump\n▪ kinda easy to re-code it\n▪ acid