Grassy world l A platformer


@Stage\n\n@Player\n\ndefine Platform (jump heigh) (graity) (friction) (running speed)\nif <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [xvel v] by (running speed)\nend\nif <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [xvel v] by ((running speed) * (-1))\nend\nset [xvel v] to ((Xvel) * (friction))\nchange x by (Xvel)\nif <touching (level v)?> then\n    set [slope v] to [0]\n    repeat until <<(Slope) = [8]> or <not <touching (level v)?>>>\n        change [slope v] by (1)\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by ((Slope) * (-1))\n        repeat ([ceiling v] of ([abs v] of (Xvel) ) )\n            if <touching (level v)?> then\n                change x by ((([abs v] of (Xvel) ) / (Xvel)) * (-1))\n            end\n        end\n        set [xvel v] to [0]\n    end\nend\nchange y by (Yvel)\nif <touching (level v)?> then\n    repeat ([ceiling v] of ([abs v] of (Yvel) ) )\n        if <touching (level v)?> then\n            change y by ((([abs v] of (Yvel) ) / (Yvel)) * (-1))\n        end\n    end\n    if <<(([abs v] of (Yvel) ) / (Yvel)) = [-1]> and <<key (space v) pressed?> or <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (50))>>>>> then\n        set [yvel v] to (jump heigh)\n    else\n        set [yvel v] to [0]\n    end\nelse\n    change [yvel v] by (-1)\nend\nset [scrollx v] to ((x position) * (-0.5))\nset [scrolly v] to ((y position) * (-0.5))\n\nwhen flag clicked\nset [level v] to [1]\nhide\n\nwhen I receive [play v]\nset [level v] to [1]\ngo to x: (-128) y: (30)\nset [xvel v] to [0]\nset [yvel v] to [0]\nswitch costume to (player v)\nshow\nforever\n    Platform [13] [-1] [0.7] [4]\n    if <(y position) < [-191]> then\n        broadcast (Transition v)\n        wait (1) seconds\n        go to x: (-128) y: (24)\n        set [xvel v] to [0]\n        set [yvel v] to [0]\n    end\n    if <(x position) > [240]> then\n        broadcast (Transition v)\n        wait (1) seconds\n        go to x: (-128) y: (24)\n        change [level v] by (1)\n        set [xvel v] to [0]\n        set [yvel v] to [0]\n    end\n    if <key (r v) pressed?> then\n        broadcast (Transition v)\n        wait (1) seconds\n        go to x: (-128) y: (24)\n        set [xvel v] to [0]\n        set [yvel v] to [0]\n    end\nend\n\nwhen I receive [play v]\nforever\n    wait (pick random (2) to (10)) seconds\n    repeat (9)\n        next costume\n    end\nend\n\nwhen flag clicked\nforever\n    if <(username) = [levi_minecraft]> then\n        set drag mode [draggable v]\n    else\n        set drag mode [not draggable v]\n    end\nend\n\nwhen [s v] key pressed\nwait until <key (k v) pressed?>\nwait until <key (i v) pressed?>\nwait until <key (p v) pressed?>\ngo to x: (-128) y: (24)\nchange [level v] by (1)\nset [xvel v] to [0]\nset [yvel v] to [0]\n\n@Level\n\nwhen flag clicked\nhide\n\nwhen I receive [play v]\nshow\nforever\n    switch costume to (Level)\n    go to x: (Scrollx) y: (Scrolly)\nend\n\n@Music\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nforever\n    play sound [bensound-cute v] until done\nend\n\n@Parralax\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    go to x: (([x position v] of [player v]) * (-0.3)) y: (([y position v] of [player v]) * (-0.5))\nend\n\n@Transition\n\nwhen flag clicked\nclear graphic effects\nshow\nset [ghost v] effect to (100)\nforever\n    go to x: (0) y: (0)\nend\n\nwhen I receive [transition v]\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen I receive [transition v]\nrepeat (10)\n    go to [front v] layer\nend\n\n@Shadow\n\nwhen flag clicked\ngo to [back v] layer\nhide\n\nwhen I receive [play v]\nshow\nforever\n    set [ghost v] effect to (70)\n    switch costume to (Level)\n    go to x: (Scrollx) y: (Scrolly)\nend\n\n@Player shadow\n\nwhen flag clicked\nhide\n\nwhen I receive [play v]\nshow\nclear graphic effects\ngo to [back v] layer\nforever\n    go to (player v)\n    set [ghost v] effect to (70)\nend\n\npoint towards (sun v)\n\n@Sun\n\nwhen flag clicked\nhide\n\nwhen I receive [play v]\nshow\nforever\n    go to [back v] layer\n    go to x: (Scrollx) y: (Scrolly)\nend\n\n@Pls make this featured scratch\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nif <(letter (length of (username)) of (username)) = [*]> then\n    show\n    wait (2) seconds\n    hide\nend\n\n@intro\n\nwhen flag clicked\npoint in direction (90)\nclear graphic effects\ngo to x: (0) y: (0)\nhide\nswitch costume to (back v)\ncreate clone of (_myself_ v)\nwait (.1) seconds\nswitch costume to (logo v)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(costume [number v]) = [2]> then\n    go to x: (0) y: (0)\n    show\n    forever\n        repeat (10)\n            change [brightness v] effect by (1)\n        end\n        repeat (10)\n            change [brightness v] effect by (-1)\n        end\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    go to x: (0) y: (0)\n    set size to (200) %\n    show\n    set [ghost v] effect to (100)\n    repeat (20)\n        change size by (-5)\n        change [ghost v] effect by (-5)\n    end\n    forever\n        go to [front v] layer\n    end\nend\n\nwhen flag clicked\nplay sound [avengers v] until done\nstart sound [Crunch v]\nswitch costume to (block v)\ncreate clone of (_myself_ v)\nplay sound [Revenge v] until done\nwait (.5) seconds\nbroadcast (start v)\n\nwhen I start as a clone\nif <(costume [number v]) = [3]> then\n    go to x: (0) y: (0)\n    show\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    wait (2) seconds\n    forever\n        repeat (10)\n            change y by (1)\n        end\n        repeat (10)\n            change y by (-1)\n        end\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [3]> then\n    go to x: (0) y: (0)\n    show\n    forever\n        repeat (10)\n            change y by (1)\n        end\n        repeat (10)\n            change y by (-1)\n        end\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    wait (2) seconds\n    forever\n        repeat (10)\n            turn right (1) degrees\n        end\n        repeat (20)\n            turn left (1) degrees\n        end\n        repeat (10)\n            turn right (1) degrees\n        end\n    end\nend\n\nwhen I receive [start v]\nstop all sounds\nstop [other scripts in sprite v]\ndelete this clone\n\n@Play\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [start v]\nswitch costume to (1 v)\nshow\ngo to [front v] layer\nforever\n    set y to ((0) + (([cos v] of (((timer) - (3)) * (400)) ) * (10)))\n    set x to ((0) + (([cos v] of (((timer) - (2)) * (300)) ) * (10)))\n    if <touching (mouse-pointer v)?> then\n        set size to ((120) + (([cos v] of (((timer) - (3)) * (400)) ) * (10))) %\n        if <mouse down?> then\n            broadcast (Play v)\n            hide\n            forever\n                stop [this script v]\n            end\n        end\n    else\n        set size to (100) %\n    end\nend\n\nwhen I receive [start v]\nforever\n    repeat (12)\n        switch costume to ((costume [number v]) + (1))\n    end\n    repeat (12)\n        switch costume to ((costume [number v]) - (1))\n    end\nend\n\n@Text\n\nwhen flag clicked\ngo to x: (0) y: (89)\nhide\n\nwhen I receive [play v]\nhide\n\nwhen I receive [start v]\nshow\nforever\n    point in direction ((90) + (([cos v] of (((timer) - (3)) * (400)) ) * (10)))\nend\n\n@Thumbnail\n\nwhen flag clicked\nshow\nforever\n    set [ghost v] effect to (100)\n    go to x: (0) y: (0)\n    go to [front v] layer\nend\n\n@Play2\n\nwhen flag clicked\ngo to x: (-196) y: (-154)\nshow\n\nwhen this sprite clicked\nbroadcast (start v)\nhide\n\nwhen I receive [start v]\nhide\n\n