DUNGEON || Scroll Platformer

Instructions: 鍵を3つ集め、扉へ向かおう。\nCollect 3 keys and go to the door.\n\n音楽 @-Xaf-\n\n効果音 効果音ラボ\n\nスクロールのプログラム @hiron0413\n\nデザインと効果音の参考 @YY-H\n\n鍵と扉 @yuki384\n\n背景 @hati32

@Stage\n\nwhen flag clicked\nforever\n    play sound [Unlimited v] until done\nend\n\n@Time\n\nwhen I receive [ゴール v]\nstop [other scripts in sprite v]\nif <(☁ わーるどれこーど) > (Time)> then\n    set [☁ わーるどれこーど v] to (Time)\nend\nset size to (100) %\nswitch costume to (♡ ☆ follow v)\ngo to x: (0) y: (-100)\ncreate clone of (_myself_ v)\nswitch costume to (time v)\ngo to x: (-50) y: (50)\ncreate clone of (_myself_ v)\nif <(length of (Time)) = [2]> then\n    switch costume to (letter (1) of (Time))\n    go to x: (-75) y: (0)\n    create clone of (_myself_ v)\n    switch costume to (letter (2) of (Time))\n    go to x: (-25) y: (0)\n    create clone of (_myself_ v)\nelse\n    if <(length of (Time)) = [3]> then\n        switch costume to (letter (1) of (Time))\n        go to x: (-100) y: (0)\n        create clone of (_myself_ v)\n        switch costume to (letter (2) of (Time))\n        go to x: (-50) y: (0)\n        create clone of (_myself_ v)\n        switch costume to (letter (3) of (Time))\n        go to x: (0) y: (0)\n        create clone of (_myself_ v)\n    else\n        switch costume to (9 v)\n        go to x: (0) y: (0)\n        create clone of (_myself_ v)\n        go to x: (-50) y: (0)\n        create clone of (_myself_ v)\n        go to x: (-100) y: (0)\n        create clone of (_myself_ v)\n    end\nend\nset size to (50) %\nswitch costume to (☁︎ v)\ngo to x: (87) y: (20)\ncreate clone of (_myself_ v)\nswitch costume to (letter (1) of (☁ わーるどれこーど))\ngo to x: (75) y: (-10)\ncreate clone of (_myself_ v)\nswitch costume to (letter (2) of (☁ わーるどれこーど))\ngo to x: (100) y: (-10)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\nset [time v] to [0]\nforever\n    wait (1) seconds\n    change [time v] by (1)\nend\n\nwhen I start as a clone\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\n@ぶらっく\n\nwhen flag clicked\nhide\n\nwhen I receive [ゴール v]\ngo to x: (0) y: (348)\nshow\nrepeat (30)\n    change y by (((0) - (y position)) / (4))\nend\n\n@カウンター\n\nwhen I start as a clone\nset [ghost v] effect to (60)\nshow\nwait until <(カウンター) = (n)>\nclear graphic effects\nwait until <(g) = [1]>\nrepeat (5)\n    change [ghost v] effect by (20)\n    change size by (((10) - (size)) / (4))\nend\ndelete this clone\n\nwhen flag clicked\nset size to (100) %\nhide\n配置\n\ndefine 配置\nset [n v] to [0]\ngo to x: (130) y: (150)\nrepeat (3)\n    change [n v] by (1)\n    create clone of (_myself_ v)\n    change x by (40)\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ステージ配置 [2152] [35] [21]\nステージ配置 [1920] [0] [5]\nステージ配置 [0] [360] [6]\nステージ配置 [480] [360] [7]\nステージ配置 [1440] [360] [9]\nステージ配置 [1920] [360] [10]\nステージ配置 [960] [0] [11]\nステージ配置 [960] [0] [12]\nステージ配置 [960] [0] [13]\nステージ配置 [960] [0] [14]\nステージ配置 [960] [0] [15]\nステージ配置 [960] [360] [16]\nステージ配置 [2400] [0] [17]\nステージ配置 [1920] [0] [18]\nステージ配置 [1650] [-100] [19]\nステージ配置 [1850] [-100] [20]\nステージ配置 [1950] [-300] [19]\nステージ配置 [2100] [-400] [22]\nswitch costume to (none v)\nbroadcast (プログラム v)\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))\n    if <(costume [number v]) = [12]> then\n        移動 ((My_x) - (Camera_x)) (((My_y) - (Camera _y)) + (いどー1))\n    end\n    if <(costume [number v]) = [13]> then\n        移動 ((My_x) - (Camera_x)) (((My_y) - (Camera _y)) + (いどー2))\n    end\n    if <(costume [number v]) = [14]> then\n        移動 ((My_x) - (Camera_x)) (((My_y) - (Camera _y)) + (いどー3))\n    end\n    if <(costume [number v]) = [15]> then\n        移動 ((My_x) - (Camera_x)) (((My_y) - (Camera _y)) + (いどー4))\n    end\n    if <(costume [number v]) = [16]> then\n        移動 ((My_x) - (Camera_x)) (((My_y) - (Camera _y)) + (いどー5))\n    end\n    if <(costume [number v]) = [20]> then\n        turn right (2) degrees\n    end\n    if <(costume [number v]) = [21]> then\n        turn left (2) degrees\n    end\nend\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\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\nwhen I start as a clone\nshow\nif <(costume [number v]) = [22]> then\n    wait until <(g) = [1]>\n    start sound [コイン v]\n    delete this clone\nend\n\nwhen flag clicked\nset [いどー1 v] to [-200]\nforever\n    repeat until <(いどー1) = [800]>\n        change [いどー1 v] by (2)\n    end\n    set [いどー1 v] to [-200]\nend\n\nwhen flag clicked\nset [いどー2 v] to [0]\nforever\n    repeat until <(いどー2) = [800]>\n        change [いどー2 v] by (2)\n    end\n    set [いどー2 v] to [-200]\nend\n\nwhen flag clicked\nset [いどー3 v] to [200]\nforever\n    repeat until <(いどー3) = [800]>\n        change [いどー3 v] by (2)\n    end\n    set [いどー3 v] to [-200]\nend\n\nwhen flag clicked\nset [いどー4 v] to [400]\nforever\n    repeat until <(いどー4) = [800]>\n        change [いどー4 v] by (2)\n    end\n    set [いどー4 v] to [-200]\nend\n\nwhen flag clicked\nset [いどー5 v] to [600]\nforever\n    repeat until <(いどー5) = [800]>\n        change [いどー5 v] by (2)\n    end\n    set [いどー5 v] to [-200]\nend\n\n@水\n\nwhen flag clicked\nhide\nステージ配置 [1440] [360] [1]\nステージ配置 [1920] [360] [2]\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\nset [ghost v] effect to (60)\nshow\n\n@逆走くん\n\nwhen flag clicked\nhide\nステージ配置 [1440] [360] [1]\nステージ配置 [1920] [360] [1]\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\nset [ghost v] effect to (60)\nshow\n\n@障害物\n\nwhen flag clicked\npoint in direction (90)\nhide\nステージ配置 [300] [-50] [1]\nステージ配置 [450] [150] [2]\nステージ配置 [480] [0] [3]\nステージ配置 [670] [300] [4]\nステージ配置 [500] [530] [2]\nステージ配置 [0] [300] [4]\nステージ配置 [0] [360] [5]\nステージ配置 [0] [360] [6]\nステージ配置 [960] [360] [7]\nステージ配置 [1440] [360] [8]\nステージ配置 [1370] [300] [4]\nステージ配置 [1510] [300] [9]\nステージ配置 [1920] [265] [10]\nステージ配置 [1440] [360] [11]\nステージ配置 [1920] [530] [2]\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))\n    if <(costume [number v]) = [2]> then\n        go to [front v] layer\n        go [backward v] (7) layers\n        turn right (2) degrees\n    end\n    if <(costume [number v]) = [3]> then\n        go to [front v] layer\n        go [backward v] (7) layers\n        turn left (2) degrees\n    end\n    if <(costume [number v]) = [4]> then\n        移動 ((My_x) - (Camera_x)) (((My_y) - (Camera _y)) - (針のあっぷだうん))\n    end\n    if <(costume [number v]) = [5]> then\n        移動 ((My_x) - (Camera_x)) (((My_y) - (Camera _y)) - (([sin v] of ((timer) * (100)) ) * (100)))\n    end\n    if <(costume [number v]) = [6]> then\n        移動 (((My_x) - (Camera_x)) - (針のあっぷだうん)) ((My_y) - (Camera _y))\n    end\n    if <(costume [number v]) = [7]> then\n        移動 ((My_x) - (Camera_x)) (((My_y) - (Camera _y)) + (針のあっぷだうん))\n    end\n    if <(costume [number v]) = [8]> then\n        go to [front v] layer\n        go [backward v] (7) layers\n    end\n    if <(costume [number v]) = [10]> then\n        移動 ((My_x) - (Camera_x)) (((My_y) - (Camera _y)) - (([sin v] of (((timer) + (10)) * (100)) ) * (100)))\n    end\n    if <(costume [number v]) = [11]> then\n        turn right (2) degrees\n    end\nend\n\nwhen I start as a clone\nshow\n\nwhen flag clicked\nforever\n    set [針のあっぷだうん v] to [0]\n    wait (1) seconds\n    repeat (30)\n        change [針のあっぷだうん v] by (((40) - (針のあっぷだうん)) / (4))\n    end\n    set [針のあっぷだうん v] to [40]\n    wait (1) seconds\n    repeat (30)\n        change [針のあっぷだうん v] by (((0) - (針のあっぷだうん)) / (4))\n    end\nend\n\n@Player\n\nwhen flag clicked\ngo to x: (0) y: (-20)\nset [xの力 v] to [0]\nset [yの力 v] to [0]\nset [camera_x v] to [0]\nset [camera _y v] to [50]\nset [x v] to [0]\nset [y v] to [50]\nset [復活x v] to [0]\nset [復活y v] to [50]\n\ndefine 動作\nif <not <touching (水 v)?>> then\n    change [yの力 v] by (-1)\nelse\n    change [yの力 v] by (-0.1)\nend\nif <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<(mouse x) > [0]> and <mouse down?>>>> then\n    switch costume to (コスチューム1 v)\n    if <not <touching (水 v)?>> then\n        change [xの力 v] by (1)\n    else\n        change [xの力 v] by (0.5)\n    end\nend\nif <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<[0] > (mouse x)> and <mouse down?>>>> then\n    switch costume to (コスチューム2 v)\n    if <not <touching (水 v)?>> then\n        change [xの力 v] by (-1)\n    else\n        change [xの力 v] by (-0.5)\n    end\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 <not <touching (水 v)?>> then\n        if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(mouse y) > [0]> and <mouse down?>>>> then\n            start sound [壁キック 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\n    end\nend\nif <touching (逆走くん v)?> then\n    change [xの力 v] by (-0.5)\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 <not <touching (水 v)?>> then\n    if <<touching (代わりのステージ v)?> and <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(mouse y) > [0]> and <mouse down?>>>>> then\n        start sound [ジャンプ v]\n        set [yの力 v] to [15]\n    end\nelse\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 [3]\n    end\nend\nchange y by (1.1)\nif <<(Y) < [-400]> or <touching (障害物 v)?>> then\n    start sound [やられる v]\n    初期位置\nend\n処理\nbroadcast (プログラム2 v)\n\nwhen I receive [プログラム 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 (代わりのステージ 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 [x v] to (復活x)\nset [y v] to (復活y)\n\nwhen I receive [ゴール v]\nstop [other scripts in sprite v]\n\n@ステージ（背面）\n\nwhen flag clicked\nset [g v] to [0]\nhide\nステージ配置 [0] [0] [1]\nステージ配置 [480] [0] [2]\nステージ配置 [960] [0] [3]\nステージ配置 [960] [360] [3]\nステージ配置 [960] [720] [3]\nステージ配置 [1440] [0] [4]\nステージ配置 [2152] [35] [5]\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))\n    if <(costume [number v]) = [4]> then\n        set [ghost v] effect to (50)\n    end\n    if <(costume [number v]) = [6]> then\n        set [ghost v] effect to (100)\n    end\nend\n\nwhen I start as a clone\nshow\nif <(costume [number v]) = [6]> then\n    wait until <<touching (player v)?> and <(カウンター) = [3]>>\n    set [g v] to [1]\nend\n\n@鍵\n\nwhen flag clicked\nset [カウンター v] to [0]\nset size to (100) %\nhide\nステージ配置 [300] [410] [1]\nステージ配置 [2100] [220] [1]\nステージ配置 [2100] [450] [1]\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))\n    point in direction ((90) + (([sin v] of ((timer) * (150)) ) * (20)))\nend\n\nwhen I start as a clone\nshow\nforever\n    if <touching (player v)?> then\n        change [カウンター v] by (1)\n        start sound [コイン v]\n        repeat (5)\n            change [ghost v] effect by (20)\n            change size by (((10) - (size)) / (4))\n        end\n        delete this clone\n    end\nend\n\n@ボーナス鍵\n\nwhen flag clicked\nset size to (100) %\nhide\nステージ配置 [2100] [-330] [1]\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))\n    point in direction ((90) + (([sin v] of ((timer) * (150)) ) * (20)))\nend\n\nwhen I start as a clone\nshow\nforever\n    if <touching (player v)?> then\n        start sound [コイン v]\n        repeat (5)\n            change [ghost v] effect by (20)\n            change size by (((10) - (size)) / (4))\n        end\n        delete this clone\n    end\nend\n\n@ゴール\n\nwhen flag clicked\nhide\nステージ配置 [2400] [50] [1]\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))\n    if <touching (player v)?> then\n        start sound [Collect v]\n        switch costume to (コスチューム2 v)\n        broadcast (ゴール v)\n    end\nend\n\nwhen I start as a clone\nshow\n\n@さむねぇ\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\n