scroll platformer


@Stage\n\n@Player\n\ndefine 動作\nchange [yの力 v] by (-1)\nif <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<(mouse x) > [0]> and <mouse down?>>>> then\n    switch costume to (player v)\n    point in direction (90)\n    change [xの力 v] by (1)\nend\nif <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<[0] > (mouse x)> and <mouse down?>>>> then\n    switch costume to (player v)\n    point in direction (-90)\n    change [xの力 v] by (-1)\nend\nif <not <<<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<(mouse x) > [0]> and <mouse down?>>>> or <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<[0] > (mouse x)> and <mouse down?>>>>>> then\n    switch costume to (player v)\nend\nset [xの力 v] to ((xの力) * (0.88))\nchange x by (xの力)\nrepeat (6)\n    if <touching (stage v)?> then\n        change y by (1)\n    end\nend\nif <touching (stage v)?> then\n    change y by (-6)\n    位置補正x (() - ((xの力) / ([abs v] of (xの力) ))) ([ceiling v] of ([abs v] of (xの力) ) )\n    if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(mouse y) > [0]> and <mouse down?>>>> then\n        set [yの力 v] to [12]\n        set [xの力 v] to ((7) - (<(xの力) > [0]> * (14)))\n    else\n        set [xの力 v] to [0]\n    end\nend\nchange y by (yの力)\nif <touching (stage v)?> then\n    位置補正y (() - ((yの力) / ([abs v] of (yの力) ))) ([ceiling v] of ([abs v] of (yの力) ) )\nend\nchange y by (-1.1)\nif <<touching (stage v)?> and <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(mouse y) > [0]> and <mouse down?>>>>> then\n    set [yの力 v] to [15]\nend\nchange y by (1.1)\nif <(Y) < [-400]> then\n    初期位置\nend\n処理\nbroadcast (program2 v)\n\nwhen I receive [program v]\n動作\n\ndefine 処理\nchange [x v] by ((x position) - ((X) - (Camera_x)))\nchange [y v] by ((y position) - (((Y) - (Camera _y)) - (20)))\nchange [camera_x v] by ([floor v] of (((X) - (Camera_x)) * (0.1)) )\nchange [camera _y v] by ([floor v] of (((Y) - (Camera _y)) * (0.2)) )\nset x to ((X) - (Camera_x))\nset y to (((Y) - (Camera _y)) - (20))\n\ndefine 位置補正x (向き) (回数)\nif <(xの力) = [0]> then\n    stop [this script v]\nend\nset [i v] to [0]\nrepeat until <<not <touching (stage v)?>> or <(i) = ((回数) + (1))>>\n    change [i v] by (1)\n    change x by (向き)\nend\nchange x by (() - ((向き) * (((回数) + (1)) * <<(i) = ((回数) + (1))> and <touching (stage v)?>>)))\n\ndefine 位置補正y (向き) (回数)\nif <(yの力) = [0]> then\n    stop [this script v]\nend\nset [i v] to [0]\nrepeat until <<not <touching (stage v)?>> or <(i) = ((回数) + (1))>>\n    change [i v] by (1)\n    change y by (向き)\nend\nchange y by (() - ((向き) * (((回数) + (1)) * <<(i) = ((回数) + (1))> and <touching (stage v)?>>)))\nset [yの力 v] to [0]\n\ndefine 初期位置\nset rotation style [left-right v]\npoint in direction (90)\ngo to x: (0) y: (-20)\nset [xの力 v] to [0]\nset [yの力 v] to [0]\nset [camera_x v] to [-200]\nset [camera _y v] to [-20]\nset [x v] to [-200]\nset [y v] to [-20]\n\nwhen I receive [message1 v]\nset size to (100) %\nshow\nset rotation style [left-right v]\npoint in direction (90)\ngo to x: (0) y: (-20)\nset [xの力 v] to [0]\nset [yの力 v] to [0]\nset [camera_x v] to [-200]\nset [camera _y v] to [-20]\nset [x v] to [-200]\nset [y v] to [-20]\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\nhide\nbroadcast (Message v)\nbroadcast (message1 v)\nset [sound v] to [0]\nset [p v] to [0]\nset [m v] to [0]\nforever\n    play sound [Tobu - Candyland v] until done\nend\n\nwhen I receive [message v]\nforever\n    reset timer\nend\n\nwhen [timer v] > (.01)\nbroadcast (Message v)\nswitch backdrop to (backdrop2 v)\nhide\n\nwhen flag clicked\nforever\n    set [pan left/right v] effect to (Sound)\nend\n\nwhen flag clicked\nforever\n    repeat (50)\n        change [sound v] by (1)\n    end\n    repeat (50)\n        change [sound v] by (-1)\n    end\nend\n\n@stage\n\ndefine ステージ配置 (x座標) (y座標) (ステージ番号)\nswitch costume to (none v)\nset [my_x v] to (x座標)\nset [my_y v] to (y座標)\nswitch costume to ((ステージ番号) + (1))\nset [my_n v] to ((ステージ番号) + (1))\ncreate clone of (_myself_ v)\n\ndefine 移動 (x) (y)\nswitch costume to (none v)\ngo to x: (x) y: (y)\nif <<([abs v] of (x) ) > ([abs v] of (x position) )> or <([abs v] of (y) ) > ([abs v] of (y position) )>> then\n    hide\nelse\n    show\nend\nswitch costume to (My_n)\n\nwhen I receive [program2 v]\nif <(costume [number v]) = [1]> then\n    broadcast (program v)\nelse\n    移動 ((My_x) - (Camera_x)) ((My_y) - (Camera _y))\nend\n\nwhen I start as a clone\nshow\n\nwhen I receive [message1 v]\nhide\nステージ配置 [0] [0] [1]\nステージ配置 [480] [0] [2]\nステージ配置 [960] [0] [3]\nステージ配置 [1440] [0] [4]\nステージ配置 [1920] [0] [5]\nステージ配置 [2400] [0] [6]\nステージ配置 [2880] [0] [7]\nステージ配置 [3360] [0] [8]\nステージ配置 [3840] [0] [9]\nswitch costume to (none v)\nbroadcast (program v)\n\n@WASD\n\nwhen I start as a clone\nclear graphic effects\nforever\n    if <(P) = [1]> then\n        show\n        if <(costume [name v]) = [W]> then\n            go to x: (-170) y: (-100)\n            if <key (w v) pressed?> then\n                set [brightness v] effect to (100)\n            else\n                clear graphic effects\n            end\n        end\n        if <(costume [name v]) = [A]> then\n            go to x: (-202) y: (-132)\n            if <key (a v) pressed?> then\n                set [brightness v] effect to (100)\n            else\n                clear graphic effects\n            end\n        end\n        if <(costume [name v]) = [S]> then\n            go to x: (-170) y: (-132)\n            if <key (s v) pressed?> then\n                set [brightness v] effect to (100)\n            else\n                clear graphic effects\n            end\n        end\n        if <(costume [name v]) = [D]> then\n            go to x: (-138) y: (-132)\n            if <key (d v) pressed?> then\n                set [brightness v] effect to (100)\n            else\n                clear graphic effects\n            end\n        end\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nshow\nswitch costume to (w v)\ncreate clone of (_myself_ v)\nswitch costume to (a v)\ncreate clone of (_myself_ v)\nswitch costume to (s v)\ncreate clone of (_myself_ v)\nswitch costume to (d v)\ncreate clone of (_myself_ v)\nhide\n\nwhen [p v] key pressed\nset [p v] to [1]\nwait until <not <key (p v) pressed?>>\nwait until <key (p v) pressed?>\nwait until <not <key (p v) pressed?>>\nset [p v] to [0]\n\n@Map\n\nwhen flag clicked\nset size to (90) %\ngo to x: (0) y: (150)\nforever\n    if <(M) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen [m v] key pressed\nset [m v] to [1]\nwait until <not <key (m v) pressed?>>\nwait until <key (m v) pressed?>\nwait until <not <key (m v) pressed?>>\nset [m v] to [0]\n\nwhen [timer v] > (.01)\nbroadcast (Message v)\nhide\n\n@turbmode\n\nwhen flag clicked\nrepeat until <[90] = (direction)>\n    point in direction (90)\n    wait (.000001) seconds\nend\nstop [all v]\n\nwhen flag clicked\n\n    turn right (90) degrees\nend\n\n