ADVENTURE 5 \Cave/ <a platformer> 
@Stage\n\nwhen I receive [green flag v]\nswitch backdrop to (backdrop1 v)\nset [level v] to [1]\n\nwhen I receive [start v]\nswitch backdrop to (backdrop2 v)\n\n@Alone\n\nwhen flag clicked\nbroadcast (Green Flag v)\nshow\nset [clone rapid v] to [no]\nset [ghost v] effect to (100)\n\nwhen I receive [green flag v]\nwait (2.5) seconds\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\n\nwhen I receive [start v]\nhide\n\nwhen I receive [green flag v]\nforever\n    change [turn v] by (5)\n    point in direction ((([cos v] of (Turn) ) * (10)) - (-90))\nend\n\nwhen I receive [green flag v]\nforever\n    play sound [Alan Walker - Alone.mp3 v] until done\nend\n\n@effects\n\nwhen I receive [green flag v]\nhide\nforever\n    repeat until <(Effects no of yes) = [no]>\n        wait (pick random (0.0005) to (0.2)) seconds\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I start as a clone\nif <(Effects no of yes) = [no]> then\n    delete this clone\nelse\nend\nif <(Clone Rapid) = [yes]> then\n    repeat until <(Clone Rapid) = [no]>\n        next costume\n        go [backward v] (99) layers\n        set size to (pick random (20) to (45)) %\n        set [ghost v] effect to (pick random (20) to (35))\n        show\n        go to x: (pick random (240) to (-240)) y: (pick random (180) to (-180))\n        change x by ((pick random (5) to (20)) / (2))\n        change y by ((pick random (5) to (20)) / (2))\n        turn right (5) degrees\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nelse\n    repeat (pick random (1) to (5))\n        next costume\n    end\n    go to x: (pick random (240) to (-240)) y: (pick random (180) to (-180))\n    next costume\n    go [backward v] (99) layers\n    set size to (pick random (20) to (45)) %\n    set [ghost v] effect to (pick random (20) to (35))\n    show\n    repeat (pick random (35) to (150))\n        change x by (1)\n        change y by (1)\n        turn right (5) degrees\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\n\nwhen [o v] key pressed\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [green flag v]\nset [effects no of yes v] to [yes]\nset [clone rapid v] to [yes]\nwait (2.5) seconds\nset [clone rapid v] to [no]\n\nwhen I receive [done v]\nstop [other scripts in sprite v]\n\n@Play\n\nwhen I receive [green flag v]\nshow\nset [ghost v] effect to (100)\nwait (2.5) seconds\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\nwhen this sprite clicked\nbroadcast (Start v)\nhide\n\nwhen I receive [green flag v]\nforever\n    change [turn v] by (5)\n    point in direction ((([cos v] of (Turn) ) * (10)) - (-90))\nend\n\n@ground\n\nwhen I receive [start v]\n\nwhen I receive [start v]\nswitch costume to (Level)\nset [x scroll v] to [-78.799699]\nset [y vel v] to [0]\nset [y vel v] to [0]\nshow\ngo to x: (142) y: (-76)\nforever\n    if <(Restart level) = [0]> then\n        set x to ((x scroll) + (500))\n        change y by ((y vel) * (-1))\n    else\n        go to x: (142) y: (-76)\n    end\n    if <(y vel) < [-25]> then\n        set [restart level v] to [yes]\n        set [y vel v] to [0]\n        set [x scroll v] to [-78.799699]\n        broadcast (Start v)\n        go to x: (142) y: (-76)\n    else\n        set [restart level v] to [0]\n    end\n    if <(Dead?) = [yes]> then\n        set [restart level v] to [yes]\n        set [y vel v] to [0]\n        set [x scroll v] to [-78.799699]\n        broadcast (Start v)\n        go to x: (142) y: (-76)\n    end\nend\n\nwhen I receive [green flag v]\nset [x scroll v] to [-78.799699]\nset [y vel v] to [0]\nhide\n\n@Sprite2\n\nwhen I receive [done v]\nhide\n\nwhen I receive [start v]\ngo to x: (-123) y: (152)\nshow\nforever\n    go to [front v] layer\n    platform physics (12) (-1) (0.9) (1) (8) (8)\n    change [x scroll v] by ((-1) * (x position))\n    set x to (0)\n    set y to (-128)\n    if <touching (obstacles v)?> then\n        set [dead? v] to [yes]\n    end\n    if <not <touching (obstacles v)?>> then\n        set [dead? v] to [no]\n    end\n    if <touching (get the thing v)?> then\n        broadcast (Transition v)\n        change [level v] by (1)\n        broadcast (Start v)\n        stop [this script v]\n    end\n    if <(Level) = [3]> then\n        hide\n    end\nend\n\nwhen I receive [green flag v]\nhide\n\ndefine None\nchange y by (y vel)\nif <touching (ground v)?> then\n    repeat ([abs v] of (y vel) )\n        if <touching (ground v)?> then\n            change y by ((-1) * (([abs v] of (y vel) ) / (y vel)))\n        end\n    end\n    if <<key (up arrow v) pressed?> and <not <(y vel) > [0]>>> then\n        set [y vel v] to (jump height)\n    else\n        set [y vel v] to [0]\n    end\nelse\n    change [y vel v] by (gravity)\nend\nif <key (right arrow v) pressed?> then\n    change [x vel v] by (movement speed)\nend\nif <key (left arrow v) pressed?> then\n    change [x vel v] by ((-1) * (movement speed))\nend\nchange x by (x vel)\nif <touching (ground v)?> then\n    set [old y v] to (y position)\n    repeat (([abs v] of (x vel) ) + (1))\n        if <touching (ground v)?> then\n            change y by (1)\n        end\n    end\n    if <touching (ground v)?> then\n        set y to (old y)\n        repeat ([ceiling v] of ([abs v] of (x vel) ) )\n            if <touching (ground v)?> then\n                change x by ((-1) * (([abs v] of (x vel) ) / (x vel)))\n            end\n        end\n        if <key (up arrow v) pressed?> then\n            if <(x vel) < [0]> then\n                set [x vel v] to [0]\n                if <key (left arrow v) pressed?> then\n                    set [x vel v] to (wall jump hm)\n                    set [y vel v] to (wall jump vm)\n                end\n            else\n                set [x vel v] to [0]\n                if <key (right arrow v) pressed?> then\n                    set [x vel v] to ((-1) * (wall jump hm))\n                    set [y vel v] to (wall jump vm)\n                end\n            end\n        end\n    end\nend\nset [x vel v] to ((x vel) * (friction))\n\n@Obstacles\n\nwhen I receive [green flag v]\nset [x scroll v] to [-78.799699]\nset [y vel v] to [0]\nhide\n\nwhen I receive [start v]\nswitch costume to (Level)\nset [x scroll v] to [-78.799699]\nset [y vel v] to [0]\nset [ghost v] effect to (0)\nset [y vel v] to [0]\ngo to x: (142) y: (-76)\nshow\nforever\n    if <(Restart level) = [0]> then\n        set x to ((x scroll) + (500))\n        change y by ((y vel) * (-1))\n    else\n        go to x: (142) y: (-76)\n    end\n    if <(y vel) < [-25]> then\n        set [restart level v] to [yes]\n        set [y vel v] to [0]\n        set [x scroll v] to [-78.799699]\n        go to x: (142) y: (-76)\n    else\n        set [restart level v] to [0]\n    end\n    if <(Dead?) = [yes]> then\n        set [restart level v] to [yes]\n        set [y vel v] to [0]\n        set [x scroll v] to [-78.799699]\n        broadcast (Start v)\n        go to x: (142) y: (-76)\n    end\nend\n\nif <(Level) = [1]> then\n    switch costume to (1 v)\nend\nif <(Level) = [2]> then\n    switch costume to (2 v)\nend\nif <(Level) = [3]> then\n    switch costume to (3 v)\nend\n\nwhen I receive [start v]\n\n@Guide\n\nwhen I receive [green flag v]\nset [x scroll v] to [-78.799699]\nset [y vel v] to [0]\nhide\n\nwhen I receive [start v]\nswitch costume to (Level)\nset [x scroll v] to [-78.799699]\nset [y vel v] to [0]\nset [ghost v] effect to (30)\nset [y vel v] to [0]\ngo to x: (142) y: (-76)\nshow\nforever\n    if <(Restart level) = [0]> then\n        set x to ((x scroll) + (500))\n        change y by ((y vel) * (-1))\n    else\n        go to x: (142) y: (-76)\n    end\n    if <(y vel) < [-25]> then\n        set [restart level v] to [yes]\n        set [y vel v] to [0]\n        set [x scroll v] to [-78.799699]\n        go to x: (142) y: (-76)\n    else\n        set [restart level v] to [0]\n    end\n    if <(Dead?) = [yes]> then\n        set [restart level v] to [yes]\n        set [y vel v] to [0]\n        set [x scroll v] to [-78.799699]\n        broadcast (Start v)\n        go to x: (142) y: (-76)\n    end\nend\n\nif <(Level) = [1]> then\n    switch costume to (1 v)\nend\nif <(Level) = [2]> then\n    switch costume to (2 v)\nend\nif <(Level) = [3]> then\n    switch costume to (3 v)\nend\n\n@Transition\n\nwhen I receive [green flag v]\ngo to x: (0) y: (-337)\nhide\n\nwhen I receive [start v]\nshow\nglide (0.5) secs to x: (0) y: (323)\nhide\ngo to x: (0) y: (-337)\n\nwhen I receive [transition v]\nshow\nglide (0.5) secs to x: (0) y: (323)\nhide\ngo to x: (0) y: (-337)\n\n@Get the thing\n\nwhen I receive [start v]\nswitch costume to (Level)\nset [x scroll v] to [-78.799699]\nset [y vel v] to [0]\nset [y vel v] to [0]\nshow\ngo to x: (142) y: (-76)\nforever\n    if <(Restart level) = [0]> then\n        set x to ((x scroll) + (500))\n        change y by ((y vel) * (-1))\n    else\n        go to x: (142) y: (-76)\n    end\n    if <(y vel) < [-25]> then\n        set [restart level v] to [yes]\n        set [y vel v] to [0]\n        set [x scroll v] to [-78.799699]\n        broadcast (Start v)\n        go to x: (142) y: (-76)\n    else\n        set [restart level v] to [0]\n    end\n    if <(Dead?) = [yes]> then\n        set [restart level v] to [yes]\n        set [y vel v] to [0]\n        set [x scroll v] to [-78.799699]\n        broadcast (Start v)\n        go to x: (142) y: (-76)\n    end\nend\n\nwhen I receive [green flag v]\nset [x scroll v] to [-78.799699]\nset [y vel v] to [0]\nhide\n\nwhen I receive [transition v]\nhide\n\nforever\nend\n\nif <<(x scroll) < [-472.406605]> and <(Level) = [1]>> then\n    show\nelse\n    hide\nend\n\nset size to (300) %\n\n@Thumbnail\n\nwhen I receive [green flag v]\nset [ghost v] effect to (100)\nforever\n    go to x: (6) y: (0)\n    show\n    go to [front v] layer\nend\n\nwhen I receive [done v]\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\n@Ya boiiiiii\n\nwhen I receive [green flag v]\nhide\nforever\n    if <(Level) = [3]> then\n        show\n    end\n    change [turn v] by (5)\n    point in direction ((([cos v] of (Turn) ) * (10)) - (-90))\nend\n\nwhen this sprite clicked\nbroadcast (DOne v)\nhide\n\n@Bat Enemy\n\nwhen I receive [green flag v]\n\nif <(Level) = [3]> then\n    show\n    broadcast (Bat Show v)\nelse\n    hide\nend\n\n
Note: This is an engine, not a game.\nRemix it and make a platformer out of it!\n\nControl with WASD keys or arrow keys\nLava and spikes are death.\n