☁Online Platformer


@Stage\n\nwhen flag clicked\nforever\n    play sound [Nebula v] until done\nend\n\n@Player\n\ndefine 処理\nchange [x2 v] by ((x position) - ((X2) - (Camera_x)))\nchange [y2 v] by ((y position) - (((Y2) - (Camera _y)) - (20)))\nchange [camera_x v] by ([floor v] of (((X2) - (Camera_x)) * (0.1)) )\nchange [camera _y v] by ([floor v] of (((Y2) - (Camera _y)) * (0.2)) )\nset x to ((X2) - (Camera_x))\nset y to (((Y2) - (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 (ステージ v)?>> or <(i) = ((回数) + (1))>>\n    change [i v] by (1)\n    change x by (向き)\nend\nchange x by (() - ((向き) * (((回数) + (1)) * <<(i) = ((回数) + (1))> and <touching (ステージ v)?>>)))\n\ndefine 位置補正y (向き) (回数)\nif <(yの力) = [0]> then\n    stop [this script v]\nend\nset [i v] to [0]\nrepeat until <<not <touching (ステージ v)?>> or <(i) = ((回数) + (1))>>\n    change [i v] by (1)\n    change y by (向き)\nend\nchange y by (() - ((向き) * (((回数) + (1)) * <<(i) = ((回数) + (1))> and <touching (ステージ v)?>>)))\nset [yの力 v] to [0]\n\ndefine 初期位置\ngo to x: (0) y: (-20)\nset [xの力 v] to [0]\nset [yの力 v] to [0]\nset [camera_x v] to (復活x)\nset [camera _y v] to (復活y)\nset [x2 v] to (復活x)\nset [y2 v] to (復活y)\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    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    change [xの力 v] by (-1)\nend\nset [xの力 v] to ((xの力) * (0.88))\nchange x by (xの力)\nrepeat (6)\n    if <touching (ステージ v)?> then\n        change y by (1)\n    end\nend\nif <touching (ステージ 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        start sound [Jump v]\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 (ステージ v)?> then\n    位置補正y (() - ((yの力) / ([abs v] of (yの力) ))) ([ceiling v] of ([abs v] of (yの力) ) )\nend\nchange y by (-1.1)\nif <<touching (ステージ v)?> and <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(mouse y) > [0]> and <mouse down?>>>>> then\n    start sound [Jump v]\n    set [yの力 v] to [15]\nend\nchange y by (1.1)\nif <<(Y2) < [-400]> or <touching (障害物 v)?>> then\n    start sound [Rip v]\n    初期位置\nend\n処理\nbroadcast (プログラム2 v)\n\nwhen [t v] key pressed\nhide list [chat v]\nask [送りたい文章を選んでください。] and wait\nif <<(answer) > [0]> and <((length of [chat v]) + (1)) > (answer)>> then\n    show list [chat v]\n    set [chat v] to (answer)\n    say (join (username) (item (chat) of [chat v]))\n    wait (5) seconds\n    set [chat v] to [0]\n    say (join (username) (item (chat) of [chat v]))\nend\nsay (join (username) (item (chat) of [chat v]))\nshow list [chat v]\n\nwhen flag clicked\nsay (join (username) (item (chat) of [chat v]))\n\nwhen flag clicked\nwait (1) seconds\ndelete all of [xy\(放置防止\) v]\nadd (join (Camera_x) (Camera _y)) to [xy\(放置防止\) v]\nforever\n    wait (60) seconds\n    if <(join (Camera_x) (Camera _y)) = (item (1) of [xy\(放置防止\) v])> then\n        stop [all v]\n    end\n    replace item (1) of [xy\(放置防止\) v] with (join (Camera_x) (Camera _y))\nend\n\nwhen I receive [プログラム v]\n動作\n\nwhen flag clicked\nset size to (70) %\ngo to [front v] layer\npoint in direction (90)\ngo to x: (0) y: (-20)\nset [chat v] to [0]\nshow list [chat v]\nset [xの力 v] to [0]\nset [yの力 v] to [0]\nset [camera_x v] to [-200]\nset [camera _y v] to [-20]\nset [x2 v] to [-200]\nset [y2 v] to [-20]\nset [復活x v] to [-200]\nset [復活y v] to [-20]\n\n@Player2\n\nwhen I start as a clone\ngo to [front v] layer\ngo to x: ((item (costume [number v]) of [x v]) - (Camera_x)) y: (((item (costume [number v]) of [y v]) - (Camera _y)) - (20))\nif <not <(myP) = (costume [number v])>> then\n    if <<<((Camera_x) + (240)) > (item (costume [number v]) of [x v])> and <((Camera_x) - (240)) < (item (costume [number v]) of [x v])>> and <<((Camera _y) + (180)) > (item (costume [number v]) of [y v])> and <((Camera _y) - (180)) < (item (costume [number v]) of [y v])>>> then\n        show\n        say (join (item (costume [number v]) of [player_list v]) (item (costume [number v]) of [chat_list v]))\n    else\n        set [ghost v] effect to (100)\n        if <(item (costume [number v]) of [x v]) > (Camera_x)> then\n            go to x: (999) y: (((item (costume [number v]) of [y v]) - (Camera _y)) - (20))\n        else\n            go to x: (-999) y: (((item (costume [number v]) of [y v]) - (Camera _y)) - (20))\n        end\n        show\n        say (join (item (costume [number v]) of [player_list v]) (item (costume [number v]) of [chat_list v]))\n    end\nend\nwait (0.01) seconds\ndelete this clone\n\nwhen flag clicked\nset [online v] to [1人]\nwait (4) seconds\nPlayer check\nforever\n    保存\n    delete all of [player_list v]\n    delete all of [x v]\n    delete all of [y v]\n    delete all of [chat_list v]\n    set [online v] to [0]\n    読込 (☁ 1)\n    読込 (☁ 2)\n    読込 (☁ 3)\n    読込 (☁ 4)\n    読込 (☁ 5)\n    読込 (☁ 6)\n    読込 (☁ 7)\n    読込 (☁ 8)\n    読込 (☁ 9)\n    読込 (☁ 10)\n    set [online v] to (join (ONLINE) [人])\nend\n\ndefine 読込 (☁)\nset [name v] to []\nset [counter v] to [1]\nrepeat (20)\n    if <not <(join (letter (counter) of (☁)) (letter ((counter) + (1)) of (☁))) = [00]>> then\n        set [name v] to (join (name) (item (join (letter (counter) of (☁)) (letter ((counter) + (1)) of (☁))) of [a~z v]))\n    end\n    change [counter v] by (2)\nend\nadd (name) to [player_list v]\nadd ((join (join (join (letter (46) of (☁)) (letter (47) of (☁))) (letter (48) of (☁))) (letter (49) of (☁))) - (2000)) to [x v]\nadd ((join (join (join (letter (50) of (☁)) (letter (51) of (☁))) (letter (52) of (☁))) (letter (53) of (☁))) - (2000)) to [y v]\nadd (item ((join (letter (54) of (☁)) (letter (55) of (☁))) - (10)) of [chat v]) to [chat_list v]\nswitch costume to (length of [player_list v])\ncreate clone of (_myself_ v)\nif <not <(☁) = [0]>> then\n    change [online v] by (1)\nend\n\ndefine Player check\nif <(☁ 1) = [0]> then\n    set [myp v] to [1]\nelse\n    if <(☁ 2) = [0]> then\n        set [myp v] to [2]\n    else\n        if <(☁ 3) = [0]> then\n            set [myp v] to [3]\n        else\n            if <(☁ 4) = [0]> then\n                set [myp v] to [4]\n            else\n                if <(☁ 5) = [0]> then\n                    set [myp v] to [5]\n                else\n                    if <(☁ 6) = [0]> then\n                        set [myp v] to [6]\n                    else\n                        if <(☁ 7) = [0]> then\n                            set [myp v] to [7]\n                        else\n                            if <(☁ 8) = [0]> then\n                                set [myp v] to [8]\n                            else\n                                if <(☁ 9) = [0]> then\n                                    set [myp v] to [9]\n                                else\n                                    if <(☁ 10) = [0]> then\n                                        set [myp v] to [10]\n                                    else\n                                        stop [all v]\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine timer start (☁cloud)\nadd ((join (join (join (join (letter (41) of (☁cloud)) (letter (42) of (☁cloud))) (letter (43) of (☁cloud))) (letter (44) of (☁cloud))) (letter (45) of (☁cloud))) - (10000)) to [timer_list v]\n\ndefine timer check (☁変数) (list_number)\nif <((join (join (join (join (letter (41) of (☁変数)) (letter (42) of (☁変数))) (letter (43) of (☁変数))) (letter (44) of (☁変数))) (letter (45) of (☁変数))) - (10000)) = (item (list_number) of [timer_list v])> then\n    if <(list_number) = [1]> then\n        set [☁ 1 v] to [0]\n    else\n        if <(list_number) = [2]> then\n            set [☁ 2 v] to [0]\n        else\n            if <(list_number) = [3]> then\n                set [☁ 3 v] to [0]\n            else\n                if <(list_number) = [4]> then\n                    set [☁ 4 v] to [0]\n                else\n                    if <(list_number) = [5]> then\n                        set [☁ 5 v] to [0]\n                    else\n                        if <(list_number) = [6]> then\n                            set [☁ 6 v] to [0]\n                        else\n                            if <(list_number) = [7]> then\n                                set [☁ 7 v] to [0]\n                            else\n                                if <(list_number) = [8]> then\n                                    set [☁ 8 v] to [0]\n                                else\n                                    if <(list_number) = [9]> then\n                                        set [☁ 9 v] to [0]\n                                    else\n                                        set [☁ 10 v] to [0]\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nelse\n    replace item (list_number) of [timer_list v] with ((join (join (join (join (letter (41) of (☁変数)) (letter (42) of (☁変数))) (letter (43) of (☁変数))) (letter (44) of (☁変数))) (letter (45) of (☁変数))) - (10000))\nend\n\nwhen flag clicked\nwait (1) seconds\ndelete all of [timer_list v]\ntimer start (☁ 1)\ntimer start (☁ 2)\ntimer start (☁ 3)\ntimer start (☁ 4)\ntimer start (☁ 5)\ntimer start (☁ 6)\ntimer start (☁ 7)\ntimer start (☁ 8)\ntimer start (☁ 9)\ntimer start (☁ 10)\nforever\n    wait (2) seconds\n    timer check (☁ 1) [1]\n    timer check (☁ 2) [2]\n    timer check (☁ 3) [3]\n    timer check (☁ 4) [4]\n    timer check (☁ 5) [5]\n    timer check (☁ 6) [6]\n    timer check (☁ 7) [7]\n    timer check (☁ 8) [8]\n    timer check (☁ 9) [9]\n    timer check (☁ 10) [10]\nend\n\ndefine 保存\nset [name v] to []\nset [counter v] to [1]\nrepeat (length of (username))\n    set [name v] to (join (name) (item # of (letter (counter) of (username)) in [a~z v]))\n    change [counter v] by (1)\nend\nrepeat ((20) - (length of (username)))\n    set [name v] to (join (name) [00])\nend\nset [name v] to (join (name) ((round (timer)) + (10000)))\nset [name v] to (join (join (name) (join (round ((X2) + (2000))) (round ((Y2) + (2000))))) ((chat) + (10)))\nif <(myP) = [1]> then\n    set [☁ 1 v] to (name)\nelse\n    if <(myP) = [2]> then\n        set [☁ 2 v] to (name)\n    else\n        if <(myP) = [3]> then\n            set [☁ 3 v] to (name)\n        else\n            if <(myP) = [4]> then\n                set [☁ 4 v] to (name)\n            else\n                if <(myP) = [5]> then\n                    set [☁ 5 v] to (name)\n                else\n                    if <(myP) = [6]> then\n                        set [☁ 6 v] to (name)\n                    else\n                        if <(myP) = [7]> then\n                            set [☁ 7 v] to (name)\n                        else\n                            if <(myP) = [8]> then\n                                set [☁ 8 v] to (name)\n                            else\n                                if <(myP) = [9]> then\n                                    set [☁ 9 v] to (name)\n                                else\n                                    set [☁ 10 v] to (name)\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\n@ステージ\n\nwhen flag clicked\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ステージ配置 [1920] [360] [7]\nステージ配置 [2880] [0] [8]\nswitch costume to (none v)\nbroadcast (プログラム v)\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 [プログラム2 v]\nif <(costume [number v]) = [1]> then\n    broadcast (プログラム v)\nelse\n    移動 ((My_x) - (Camera_x)) ((My_y) - (Camera _y))\nend\n\nwhen I start as a clone\nshow\n\n@障害物\n\nwhen flag clicked\nhide\nステージ配置 [0] [0] [1]\nステージ配置 [480] [0] [2]\nステージ配置 [960] [0] [3]\nステージ配置 [1440] [0] [4]\nswitch costume to (none v)\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 [プログラム2 v]\nif <not <(costume [number v]) = [1]>> then\n    移動 ((My_x) - (Camera_x)) ((My_y) - (Camera _y))\nend\n\nwhen I start as a clone\ngo to [back v] layer\nshow\n\n@SUN\n\nwhen flag clicked\nset [sin v] to [0]\nset size to (100) %\nforever\n    change [sin v] by (1)\n    set size to ((([sin v] of ((sin) * (5)) ) * (10)) + (130)) %\nend\n\n@ステージ（背面）\n\nwhen flag clicked\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]\nswitch costume to (none v)\nbroadcast (プログラム v)\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 [プログラム2 v]\nif <(costume [number v]) = [1]> then\n    broadcast (プログラム v)\nelse\n    移動 ((My_x) - (Camera_x)) ((My_y) - (Camera _y))\nend\n\nwhen I start as a clone\nshow\n\n@チェックポイント\n\nwhen flag clicked\nset [チェックポイント到達 v] to [0]\nswitch costume to (a v)\nhide\n\nwhen I receive [プログラム2 v]\n移動 ((1933) - (Camera_x)) ((-56) - (Camera _y))\n\ndefine 移動 (x) (y)\nswitch costume to (none v)\ngo to x: (x) y: (y)\nswitch costume to ((チェックポイント到達) + (2))\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\n    if <<touching (player v)?> and <(チェックポイント到達) = [0]>> then\n        set [チェックポイント到達 v] to [1]\n        set [復活x v] to [1933]\n        set [復活y v] to [-40]\n    end\nend\nswitch costume to ((チェックポイント到達) + (2))\n\n@サムネ\n\nwhen flag clicked\nhide\n\ngo to [front v] layer\nshow\n\n@雲\n\nwhen flag clicked\ngo to x: (264) y: (130)\nset size to (50) %\nset [ghost v] effect to (50)\nhide\nforever\n    create clone of (_myself_ v)\n    wait (pick random (1) to (5)) seconds\nend\n\nwhen I start as a clone\ngo to [front v] layer\nshow\nset [cloud-y v] to (pick random (130) to (160))\ngo to x: (264) y: (cloud-y)\nglide (pick random (10) to (15)) secs to x: (-264) y: (cloud-y)\ndelete this clone\n\n