ADVENTURE \Grassland/ <a platformer>

Instructions: 　　　　English　　　　　　　\nJump with the up key.　　　　\nMove with the left and right keys.\nSquat with the down key.　世界記録\n　　　　　　　　　　　@akt1014さん　\n　　　　日本語　　　　　　40.7秒\n　　上キーでジャンプ　　　\n　　左右キーで移動\n　　下キでしゃがむ

@Stage\n\nwhen flag clicked\nforever\n    play sound [Vexento - Occupy v] until done\nend\n\n@ground\n\nwhen flag clicked\nswitch costume to (fantasia1 v)\n\nwhen I receive [next v]\nnext costume\n\n@particles\n\nwhen flag clicked\npoint in direction (-90)\nhide\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nset size to (pick random (40) to (80)) %\npoint in direction (pick random (-60) to (-90))\ngo to [back v] layer\nset [speed v] to [5]\nset [ghost v] effect to (pick random (50) to (75))\ngo to x: (238) y: (pick random (18) to (-182))\nshow\nforever\n    repeat until <<(x position) = [-246]> or <(x position) < [-230]>>\n        move (speed) steps\n    end\n    delete this clone\nend\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\ndelete this clone\n\n@player\n\nwhen flag clicked\nset [y v] to [0]\nswitch costume to (fantasia1 v)\ngo to [front v] layer\nset rotation style [left-right v]\ngo to x: (-215) y: (90)\nforever\n    change [y v] by (-0.5)\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        change [x v] by (-1)\n        point in direction (-90)\n    end\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        change [x v] by (1)\n        point in direction (90)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <<touching (ground v)?> or <touching (moving platforms v)?>> then\n        change y by (1)\n    end\n    change y by (y)\n    if <<touching (ground v)?> or <touching (moving platforms v)?>> then\n        change y by ((y) * (-1))\n        set [y v] to [0]\n    end\n    change y by (-0.5)\n    if <<touching (ground v)?> and <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <((mouse y) - (y position)) > [50]>>>>> then\n        set [y v] to [10]\n    end\n    if <<touching (ground v)?> or <touching (moving platforms v)?>> then\n        change y by (1)\n        if <<touching (ground v)?> or <touching (moving platforms v)?>> then\n            change y by (1)\n            if <<touching (ground v)?> or <touching (moving platforms v)?>> then\n                change y by (1)\n                if <<touching (ground v)?> or <touching (moving platforms v)?>> then\n                    change y by (1)\n                    if <<touching (ground v)?> or <touching (moving platforms v)?>> then\n                        change y by (1)\n                        if <<touching (ground v)?> or <touching (moving platforms v)?>> then\n                            change y by (-6)\n                            if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <((mouse y) - (y position)) > [50]>>>> then\n                                set [y v] to [10]\n                                if <(x) > [0]> then\n                                    set [x v] to [-10]\n                                else\n                                    set [x v] to [10]\n                                end\n                            else\n                                change x by ((x) * (-1))\n                                set [x v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    if <(x position) > [239]> then\n        broadcast (next v)\n        go to x: (-215) y: (25)\n    end\n    if <touching (spikes v)?> then\n        broadcast (die v)\n        go to x: (-215) y: (25)\n    end\n    if <touching (trampoline v)?> then\n        set [y v] to [12.5]\n    end\nend\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-10)\nend\ndelete this clone\n\n@spikes\n\nwhen flag clicked\nswitch costume to (fantasia1 v)\nforever\n    go to (ground v)\n    switch costume to ([costume # v] of [ground v])\nend\n\n@moving platforms\n\nwhen flag clicked\ngo to x: (-153) y: (82)\npoint in direction (90)\nforever\n    move (3) steps\n    if on edge, bounce\nend\n\nwhen flag clicked\nforever\n    hide\n    if <<([costume # v] of [ground v]) = [4]> or <([costume # v] of [ground v]) = [17]>> then\n        show\n    end\n    if <not <<([costume # v] of [ground v]) = [4]> or <([costume # v] of [ground v]) = [17]>>> then\n        go to x: (-153) y: (82)\n    end\nend\n\n@trampoline\n\nwhen flag clicked\nforever\n    switch costume to (fantasia1 v)\n    if <touching (player v)?> then\n        repeat (4)\n            next costume\n        end\n        repeat (4)\n            switch costume to ((costume [number v]) - (1))\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (93) y: (27)\nforever\n    hide\n    if <<<<<([costume # v] of [ground v]) = [5]> or <([costume # v] of [ground v]) = [6]>> or <([costume # v] of [ground v]) = [7]>> or <([costume # v] of [ground v]) = [9]>> or <([costume # v] of [ground v]) = [17]>> then\n        show\n    end\n    if <([costume # v] of [ground v]) = [6]> then\n        go to x: (47) y: (27)\n    end\n    if <([costume # v] of [ground v]) = [7]> then\n        go to x: (113) y: (167)\n    end\n    if <([costume # v] of [ground v]) = [9]> then\n        go to x: (145) y: (25)\n    end\n    if <([costume # v] of [ground v]) = [17]> then\n        go to x: (5) y: (28)\n    end\nend\n\n@tb\n\nwhen flag clicked\nset [ghost v] effect to (100)\ngo to [front v] layer\n\n@sun\n\nwhen flag clicked\ngo to [back v] layer\nswitch costume to (fantasia1 v)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\ngo to [back v] layer\nset size to (100) %\nswitch costume to (fantasia2 v)\nset [ghost v] effect to (50)\nforever\n    repeat (45)\n        change size by (0.5)\n    end\n    repeat (45)\n        change size by (-0.5)\n    end\nend\n\n@transition\n\nwhen flag clicked\nhide\n\nwhen I receive [next v]\nset [ghost v] effect to (0)\nshow\ngo to [front v] layer\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen I receive [die v]\nset [ghost v] effect to (0)\nshow\ngo to [front v] layer\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\n