Scrolling Platformer Engine    #games #all
@Stage\n\n@Sprite1\n\nwhen flag clicked\nset size to (100) %\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\ngo to [front v] layer\n\n@player1\n\nwhen I receive [1 v]\nforever\n    go to\nend\n\nwhen I receive [go v]\nforever\n    if <<key (d v) pressed?> or <<key (right arrow v) pressed?> or <<mouse down?> and <(x position) < (mouse x)>>>> then\n        change [xvel1 v] by (1)\n    end\n    if <<key (a v) pressed?> or <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>>> then\n        change [xvel1 v] by (-1)\n    end\nend\n\ndefine player1\nset [player1 v] to (join (timer) (join [000] (join (username) (join [000] (join ([costume # v] of [ground v]) (join [000] (join (round ((x1) + (scrollx))) (join [000] (round ((y1) + (scrolly)))))))))))\n\ndefine go to\nset [repeat v] to (length of (player1))\nset [number v] to (letter (repeat) of (player1))\nrepeat until <<(letter ((repeat) + (-2)) of (player1)) = [0]> and <<(letter ((repeat) + (-1)) of (player1)) = [0]> and <(letter ((repeat) + (-3)) of (player1)) = [0]>>>\n    change [repeat v] by (-1)\n    set [number v] to (join (letter (repeat) of (player1)) (NUMBER))\nend\nset y to (NUMBER)\nchange [repeat v] by (-4)\nset [number v] to (letter (repeat) of (player1))\nrepeat until <<<(letter ((repeat) + (-2)) of (player1)) = [0]> and <<(letter ((repeat) + (-1)) of (player1)) = [0]> and <(letter ((repeat) + (-3)) of (player1)) = [0]>>> or <(repeat) < [0]>>\n    change [repeat v] by (-1)\n    set [number v] to (join (letter (repeat) of (player1)) (NUMBER))\nend\nset x to (NUMBER)\nchange [repeat v] by (-4)\nset [number v] to (letter (repeat) of (player1))\nrepeat until <<<(letter ((repeat) + (-2)) of (player1)) = [0]> and <<(letter ((repeat) + (-1)) of (player1)) = [0]> and <(letter ((repeat) + (-3)) of (player1)) = [0]>>> or <(repeat) < [0]>>\n    change [repeat v] by (-1)\n    set [number v] to (join (letter (repeat) of (player1)) (NUMBER))\nend\nset [ground custom v] to (NUMBER)\nchange [repeat v] by (-4)\nset [number v] to (letter (repeat) of (player1))\nrepeat until <<<(letter ((repeat) + (-2)) of (player1)) = [0]> and <<(letter ((repeat) + (-1)) of (player1)) = [0]> and <(letter ((repeat) + (-3)) of (player1)) = [0]>>> or <(repeat) < [0]>>\n    change [repeat v] by (-1)\n    set [number v] to (join (letter (repeat) of (player1)) (NUMBER))\nend\nset [name tag v] to (NUMBER)\n\nwhen I receive [go v]\nshow\npoint in direction (90)\nset [repeat v] to [20]\nforever\n    go to\n    switch costume to (player v)\n    show\nend\n\nwhen flag clicked\nbroadcast (1 v)\nbroadcast (go v)\nset [coins v] to [0]\n\nwhen I receive [died v]\nset [y1 v] to ((respawn y) * (1))\nset [x1 v] to ((respawn x) * (1))\nset [xvel1 v] to [0]\nset [yvel1 v] to [0]\nset [scrollx v] to ((respawn x) * (-1))\nset [scrolly v] to ((respawn y) * (-1))\n\nwhen I receive [1 v]\nhide\nset [y1 v] to [0]\nset [x1 v] to [0]\nset [yvel1 v] to [0]\nset [xvel1 v] to [0]\nset [scrolly v] to [-100]\nset [scrollx v] to [0]\nshow\nforever\n    show\n    if <<key (space v) pressed?> or <<touching color (#66c9ff)?> or <touching (_edge_ v)?>>> then\n        broadcast (died v)\n    end\n    switch costume to (player v)\n    set size to (100) %\n    set [xvel1 v] to ((xvel1) * (0.9))\n    change [x1 v] by (xvel1)\n    set x to ((x1) + (scrollx))\n    set size to (100) %\n    if <<touching color (#00ffbb)?> or <<touching color (#60d5b6)?> or <touching color (#775c35)?>>> then\n        change y by (1)\n        change [y1 v] by (1)\n        if <<touching color (#00ffbb)?> or <<touching color (#60d5b6)?> or <touching color (#775c35)?>>> then\n            change y by (1)\n            change [y1 v] by (1)\n            if <<touching color (#00ffbb)?> or <<touching color (#60d5b6)?> or <touching color (#775c35)?>>> then\n                change y by (1)\n                change [y1 v] by (1)\n                if <<touching color (#00ffbb)?> or <<touching color (#60d5b6)?> or <touching color (#775c35)?>>> then\n                    change y by (1)\n                    change [y1 v] by (1)\n                    if <<touching color (#00ffbb)?> or <<touching color (#60d5b6)?> or <touching color (#775c35)?>>> then\n                        change y by (1)\n                        change [y1 v] by (1)\n                        if <<touching color (#00ffbb)?> or <<touching color (#60d5b6)?> or <touching color (#775c35)?>>> then\n                            change x by ((xvel1) * (-1))\n                            change [x1 v] by ((xvel1) * (-1.1))\n                            change y by (-5)\n                            change [y1 v] by (-5)\n                            if <<key (w v) pressed?> or <<key (up arrow v) pressed?> or <<mouse down?> and <(y position) < (mouse y)>>>> then\n                                set [yvel1 v] to [12]\n                                if <(xvel1) > [0.5]> then\n                                    set [xvel1 v] to [-10]\n                                else\n                                    if <[-0.5] > (xvel1)> then\n                                        set [xvel1 v] to [10]\n                                    end\n                                end\n                            else\n                                set [xvel1 v] to [0]\n                            end\n                            player1\n                            go to\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yvel1 v] by (-1)\n    if <(yvel1) < [-20]> then\n        set [yvel1 v] to [-20]\n    end\n    change [y1 v] by (yvel1)\n    set y to ((y1) + (scrolly))\n    if <<touching color (#00ffbb)?> or <<touching color (#60d5b6)?> or <touching color (#775c35)?>>> then\n        change y by ((yvel1) * (-1))\n        change [y1 v] by ((yvel1) * (-1))\n        set [yvel1 v] to [0]\n    end\n    change [scrolly v] by ((y position) * (-.3))\n    change [scrollx v] by ((x position) * (-.3))\n    change y by (-1)\n    if <<<key (w v) pressed?> or <<key (up arrow v) pressed?> or <<mouse down?> and <(y position) < (mouse y)>>>> and <<touching color (#00ffbb)?> or <<touching color (#60d5b6)?> or <touching color (#775c35)?>>>> then\n        set [yvel1 v] to [13]\n    end\n    change y by (1)\n    player1\n    go to\nend\n\n@ground\n\nwhen flag clicked\nhide\nforever\n    broadcast (reset clones v)\n    erase all\n    spikes [10] [-11]\n    check point [0] [-8]\n    check point [29] [45]\n    scroll place [0] [0] [1]\n    scroll place [1] [0] [2]\n    scroll place [1] [1.3] [3]\n    scroll place [-.3] [2.903] [1]\n    hide\nend\n\ndefine scroll place (x) (y) (custom)\npoint in direction (90)\nswitch costume to (custom)\ngo to x: (((x) * (400)) + (scrollx)) y: (((y) * (180)) + (scrolly))\nif <<(round (((x) * (400)) + (scrollx))) = (round (x position))> and <(round (((y) * (180)) + (scrolly))) = (round (y position))>> then\n    stamp\nend\n\ndefine spikes (x) (y)\npoint in direction (spin)\nswitch costume to (costume5 v)\ngo to x: (((x) * (10)) + (scrollx)) y: (((y) * (10)) + (scrolly))\nif <<(round (((x) * (10)) + (scrollx))) = (round (x position))> and <(round (((y) * (10)) + (scrolly))) = (round (y position))>> then\n    stamp\nend\n\nwhen flag clicked\nset [spin v] to [0]\nforever\n    change [spin v] by (5)\nend\n\ndefine check point (x) (y)\npoint in direction (90)\nswitch costume to (costume4 v)\ngo to x: (((x) * (10)) + (scrollx)) y: (((y) * (10)) + (scrolly))\nif <<(round (((x) * (10)) + (scrollx))) = (round (x position))> and <(round (((y) * (10)) + (scrolly))) = (round (y position))>> then\n    stamp\nend\nshow\nif <touching (player1 v)?> then\n    set [respawn x v] to ((x) * (10))\n    set [respawn y v] to ((y) * (10))\nend\nhide\n\nwhen I receive [reset clones v]\ndelete this clone\n\nwhen I start as a clone\nshow\n\n
Use arrow keys\n\nRemix and make your own scrolling platformer!! pls make it bigger :)\n\nIncludes: \n  wall jumping\n  slope physics\n  dangers\n  x and y vel\n mobile friendly