Grassland | A Generic Platformer
@Stage\n\nwhen flag clicked\nforever\n    play sound [Tobu - Hope \[NCS Release\] v] until done\nend\n\n@Shadow\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [clone # v] to [-1]\nrepeat (2)\n    create clone of (_myself_ v)\n    change [clone # v] by (2)\nend\nforever\n    switch costume to (LVL)\n    go to x: ((([x position v] of [player v]) * (-1)) / (10)) y: ((([y position v] of [player v]) * (-1)) / (5))\nend\n\nwhen I receive [dead v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\nwhen I start as a clone\nset rotation style [all around v]\nswitch costume to (clones v)\nforever\n    turn left (3) degrees\n    if <(LVL) = [6]> then\n        switch costume to (clone v)\n        go to x: (((Clone #) * (90)) + ((([x position v] of [player v]) * (-1)) / (10))) y: ((-20) + ((([y position v] of [player v]) * (-1)) / (5)))\n        show\n    end\n    if <(LVL) = [8]> then\n        go to x: ((([x position v] of [player v]) * (-1)) / (10)) y: (((([sin v] of ((timer) * (100)) ) * (5)) - (155)) + ((([y position v] of [player v]) * (-1)) / (5)))\n        go to [back v] layer\n        go [forward v] (2) layers\n        point in direction (90)\n        switch costume to (lava v)\n        show\n    end\n    if <<not <(LVL) = [6]>> and <not <(LVL) = [8]>>> then\n        hide\n    end\nend\n\n@Pixels\n\nwhen flag clicked\nset size to (50) %\nhide\nforever\n    set [id v] to [0]\nend\n\nwhen I receive [dead v]\nif <(ID) = [0]> then\n    go to x: (DX) y: (DY)\n    set [id v] to [Death]\n    Make Clones [7]\nend\n\nwhen I start as a clone\nif <(ID) = [Death]> then\n    Make Dead Animation\nend\n\ndefine Make Dead Animation\ngo to [front v] layer\nset [y velocity v] to (pick random (10) to (15))\nset [x velocity v] to (pick random (-10) to (10))\nset [ghost v] effect to (5)\nshow\nrepeat (70)\n    Move Left/Right [1.5] [3]\n    Move Up/Down With Jump Height:\n    if <(y position) < [-175]> then\n        hide\n    end\nend\nrepeat (5)\n    change [ghost v] effect by (20)\nend\ndelete this clone\n\ndefine Make Clones (amount)\nrepeat (amount)\n    create clone of (_myself_ v)\n    switch costume to (pick random (1) to (3))\nend\n\ndefine Move Left/Right (spd) (slope steepness)\nset [x velocity v] to ((X Velocity) * (0.95))\nchange x by (X Velocity)\nrepeat (slope steepness)\n    if <touching (ground v)?> then\n        change y by (1)\n    end\nend\nif <touching (ground v)?> then\n    change y by ((slope steepness) * (-1))\n    set [x velocity v] to ((X Velocity) * (-1))\n    change x by (X Velocity)\n    set [x velocity v] to [0]\nend\n\ndefine Move Up/Down With Jump Height:\nchange [y velocity v] by (-1)\nchange y by (Y Velocity)\nif <touching (ground v)?> then\n    change y by ((Y Velocity) - ((Y Velocity) * (2)))\n    set [y velocity v] to [0]\nend\n\n@spikes\n\nwhen flag clicked\nset rotation style [left-right v]\ngo to x: (0) y: (0)\npoint in direction (90)\ngo to [front v] layer\nset [clone # v] to [-1]\nrepeat (2)\n    create clone of (_myself_ v)\n    change [clone # v] by (2)\nend\nforever\n    switch costume to (LVL)\nend\n\nwhen I receive [dead v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\nwhen I start as a clone\nset rotation style [all around v]\nswitch costume to (clone v)\nforever\n    turn left (3) degrees\n    if <(LVL) = [6]> then\n        switch costume to (clone v)\n        go to x: ((Clone #) * (90)) y: ((-20) + ())\n        show\n    end\n    if <(LVL) = [8]> then\n        go to x: (0) y: ((([sin v] of ((timer) * (150)) ) * (5)) - (155))\n        point in direction (90)\n        go to [back v] layer\n        go [forward v] (4) layers\n        switch costume to (lava v)\n        show\n    end\n    if <<not <(LVL) = [6]>> and <not <(LVL) = [8]>>> then\n        hide\n    end\nend\n\n@ground\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    switch costume to (LVL)\nend\n\nwhen I receive [dead v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\n@player\n\nwhen flag clicked\nswitch costume to (1 v)\ngo to [front v] layer\nset [id v] to [Walk]\nset [lvl v] to [1]\ngo to x: (-215) y: (Spawn Y)\nset [y velocity v] to [0]\nset [x velocity v] to [0]\nforever\n    Move Left/Right [1.5] [3]\n    Move Up/Down With Jump Height: [15] <key (w v) pressed?> or <key (up arrow v) pressed?> [4]\n    Check Die [-170]\n    Check Next LVL [235]\n    Make Trail\nend\n\ndefine Move Left/Right (spd) (slope steepness)\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <((x position) - (20)) > (mouse x)>>> then\n    switch costume to (2 v)\n    change [x velocity v] by ((spd) * (-1))\nend\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > ((x position) + (20))>>> then\n    switch costume to (1 v)\n    change [x velocity v] by (spd)\nend\nset [x velocity v] to ((X Velocity) * (0.85))\nchange x by (X Velocity)\nset [player x v] to (x position)\nrepeat (slope steepness)\n    if <touching (ground v)?> then\n        change y by (1)\n    end\nend\nif <touching (ground v)?> then\n    change y by ((slope steepness) * (-1))\n    change x by ((X Velocity) * (-1))\n    set [player x v] to (x position)\n    set [x velocity v] to [0]\nend\n\ndefine Move Up/Down With Jump Height: (jump height) <jump button 1 pressed> or <jump button 2 pressed> (lag)\nchange [y velocity v] by (-1)\nchange y by (Y Velocity)\nset [player y v] to (y position)\nif <touching (ground v)?> then\n    repeat (lag)\n        if <touching (ground v)?> then\n            change y by (((Y Velocity) * (-1)) / (lag))\n        end\n    end\n    set [y velocity v] to [0]\nend\nchange y by (-1)\nif <<<<jump button 1 pressed> or <jump button 2 pressed>> or <<mouse down?> and <(mouse y) > ((y position) + (50))>>> and <touching (ground v)?>> then\n    change [y velocity v] by (jump height)\nend\nchange y by (1)\n\ndefine Check Die (fall height)\nif <<touching (spikes v)?> or <(y position) < (fall height)>> then\n    set [dx v] to (x position)\n    set [dy v] to (y position)\n    broadcast (Dead v)\nend\n\nwhen I receive [dead v]\nReset\n\ndefine Check Next LVL (x pos)\nif <(x pos) < (x position)> then\n    broadcast (Next Lvl v)\n    set x to (0)\n    change [lvl v] by (1)\nend\n\ndefine Make Trail\nset [id v] to [Trail]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    if <(ID) = [Trail]> then\n        repeat (10)\n            change [ghost v] effect by (11)\n        end\n        delete this clone\n    end\nend\n\nwhen I receive [next lvl v]\nReset\n\ndefine Reset\ngo to x: (-215) y: (Spawn Y)\nset [y velocity v] to [0]\nset [x velocity v] to [0]\ndelete this clone\n\n@BG\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    play sound [Tobu - Hope \[NCS Release\] v] until done\nend\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    switch backdrop to (LVL)\nend\n\n
  Just your average generic platformer\n\n- Arrow keys or WASD to move\n- Also mobile\n- Try to get the the end (every level is possible)\n\nWhy this is the best platformer engine (in my opinion):                           \n- First of all it has horizontal and vertical collision (can bump into ceilings and walls)\n- Second is that it doesn’t bounce when you land on the ground from a high drop like most other engines\n- Third is that it has mobile support so it works on all devices\n- The particle effects also look great in my opinion! :D\n\n\n\nMusic - Hope by Tobu\nAll code and art by me (@PrehistoricWaffle)\n\n\nTags:\n#games #platformer #all #art #game #platform #effects #fun #play #physics #levels #grassland