- Sketch - Platformer ( #3 )

Instructions: How to move - Use arrow keys or mobile controls\n

@Stage\n\nwhen flag clicked\nforever\n    play sound [れじぇくん2 v] until done\nend\n\n@Player\n\ndefine Spin off screen\nset rotation style [all around v]\nset [player death v] to [1]\nstart sound [tin1 v]\nset [y v v] to [15]\nrepeat until <(y position) < [-178]>\n    go to [front v] layer\n    turn right (10) degrees\n    change y by (Y v)\n    change [y v v] by (-1)\nend\nset [player death v] to [0]\ngo to [back v] layer\nset rotation style [left-right v]\npoint in direction (90)\ngo [forward v] (3) layers\ngo to [front v] layer\n\nnext backdrop\n\nwhen flag clicked\ngo [forward v] (10) layers\nhide variable [☁ world record v]\nhide variable [☁ your time v]\nhide\ngo [forward v] (3) layers\ngo to x: (-199) y: (-60)\nset rotation style [left-right v]\npoint in direction (90)\nset size to (100) %\nset [x v] to [0]\nset [y v] to [0]\nshow\n\nwhen I receive [start v]\n\nSpin off screen\n\nwhen flag clicked\nhide variable [☁ world record v]\nhide variable [☁ your time v]\nreset timer\nswitch costume to (1 v)\nswitch backdrop to (2 v)\nshow\nforever\n    change y by (1)\n    change [y v] by (-1)\n    if <<key (right arrow v) pressed?> or <<(mouse x) > [1]> and <mouse down?>>> then\n        change [x v] by (1)\n        point in direction (90)\n    end\n    if <<key (left arrow v) pressed?> or <<(mouse x) < [-1]> and <mouse down?>>> 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)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (-4)\n        change x by ((x) * (-1))\n        set [y v] to [0]\n        if <<key (up arrow v) pressed?> or <<(mouse y) > [50]> and <mouse down?>>> then\n            set [y v] to [15]\n            if <(x) > [0]> then\n                set [x v] to [-10]\n            else\n                set [x v] to [10]\n            end\n        else\n            set [y v] to [0]\n        end\n    end\n    change y by (y)\n    if <touching (ground v)?> then\n        change y by ((0) - (y))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<<key (up arrow v) pressed?> and <touching (ground v)?>> or <<mouse down?> and <<touching (ground v)?> and <(mouse y) > [50]>>>> then\n        start sound [ジャンプ v]\n        set [y v] to [15]\n    end\n    if <touching (magma v)?> then\n        Spin off screen\n    end\n    if <touching (spike v)?> then\n        Spin off screen\n    else\n        if <[-166] > (y position)> then\n            go to x: (-199) y: (-60)\n        end\n    end\n    if <(Stage) = [11]> then\nend\n\n@Ground\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\ngo to [back v] layer\ngo [forward v] (5) layers\nforever\n    switch costume to (Stage)\nend\n\nwhen flag clicked\nset [stage v] to [1]\n\nwhen I receive [goal v]\nchange [stage v] by (1)\n\n@transition\n\nwhen flag clicked\nhide\n\nwhen I receive [goal v]\nset [trans on or off v] to [On]\ngo [forward v] (1) layers\ngo to [front v] layer\nset x to (500)\nshow\nrepeat (6)\n    change x by (-80)\nend\nchange x by (-15)\nwait (0.6) seconds\nset [trans on or off v] to [Off]\nrepeat (5)\n    change x by (-80)\nend\nhide\n\n@Spike\n\nwhen flag clicked\nshow\nswitch costume to (コスチューム1 v)\nhide variable [☁ world record v]\nhide variable [☁ your time v]\n\nwhen I receive [goal v]\nwait (0.5) seconds\nnext costume\n\n@スプライト1\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\ngo to [front v] layer\ngo [forward v] (100) layers\n\n@スプライト2\n\nwhen flag clicked\nshow\nset [ghost v] effect to (50)\n\n