Shadow || A scrolling platformer <PC & Mobile>


@Stage\n\nwhen I receive [title v]\nswitch backdrop to (背景1 v)\nforever\n    play sound [Block by bubblebee3 v] until done\nend\n\nwhen flag clicked\nswitch backdrop to (背景2 v)\n\n@Hero\n\nwhen flag clicked\nhide\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 (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]> or <touching (障害物 v)?>> then\n    初期位置\nend\n処理\nbroadcast (プログラム2 v)\n\nwhen I receive [プログラム v]\n動作\nbroadcast (p v)\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 初期位置\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 [0]\nset [x v] to [0]\nset [y v] to [0]\n\npoint in direction (90)\n\nwhen I receive [title v]\nshow\nset size to (65) %\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\n@Stage\n\nwhen flag clicked\nhide\ndelete this clone\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\nwhen I receive [title v]\nhide\nステージ配置 [0] [0] [1]\nステージ配置 [480] [0] [2]\nステージ配置 [480] [360] [3]\nステージ配置 [480] [360] [4]\nステージ配置 [960] [360] [5]\nステージ配置 [1600] [850] [6]\nステージ配置 [2080] [850] [7]\nswitch costume to (none v)\nbroadcast (プログラム v)\n\nステージ配置 [2400] [0] [6]\n\n@Shadow\n\nwhen flag clicked\nhide\n\nwhen I receive [プログラム v]\nshow\ngo [backward v] (5) layers\nforever\n    go to (hero v)\nend\n\n@Intro\n\nwhen I start as a clone\npoint in direction (90)\nshow\nif <(costume [number v]) = [1]> then\n    set size to (0) %\n    point in direction (0)\n    hide\n    wait (((((x position) + (240)) / (240)) + (((y position) + (180)) / (180))) / (5)) seconds\n    show\n    repeat (30)\n        change size by (((105) - (size)) / (4))\n        turn right (((90) - (direction)) / (4)) degrees\n    end\n    wait until <[5] < (timer)>\n    delete this clone\nelse\n    if <(costume [number v]) = [2]> then\n        go to x: (0) y: (0)\n        set size to (0) %\n        set [variable v] to [0]\n        repeat (55)\n            set [variable v] to (((variable) * (0.75)) + (((100) - (size)) / (3)))\n            change size by (variable)\n        end\n        point in direction (180)\n        change x by (150)\n        repeat (20)\n            turn right (((90) - (direction)) / (3)) degrees\n            change x by (((0) - (x position)) / (3))\n        end\n        wait until <[4.5] < (timer)>\n        hide\n        go to x: (0) y: (500)\n        go to [front v] layer\n        wait until <[7] < (timer)>\n        show\n        set [variable v] to [0]\n        repeat (60)\n            set [variable v] to (((variable) * (0.75)) + (((25) - (y position)) / (3)))\n            change y by (variable)\n        end\n        wait until <[11] < (timer)>\n        broadcast (title v)\n        delete this clone\n    else\n        if <(costume [number v]) = [3]> then\n            go to [front v] layer\n            if <(variable) = [3.14]> then\n                go to x: (0) y: (-500)\n                repeat (50)\n                    change y by (((0) - (y position)) / (6))\n                end\n                wait until <[11] < (timer)>\n                delete this clone\n            else\n                go to x: (0) y: (-500)\n                repeat (50)\n                    change y by (((0) - (y position)) / (6))\n                end\n                wait until <[11] < (timer)>\n                repeat (10)\n                    change [ghost v] effect by (10)\n                end\n                delete this clone\n            end\n        else\n            if <(costume [number v]) = [4]> then\n                go to [front v] layer\n                go to x: (0) y: (0)\n                set size to (0) %\n                repeat (50)\n                    change size by (((100) - (size)) / (6))\n                end\n                wait until <[7] < (timer)>\n                set [variable v] to [0]\n                repeat (60)\n                    set [variable v] to (((variable) * (0.75)) + (((-100) - (y position)) / (3)))\n                    change y by (variable)\n                end\n                wait until <[11] < (timer)>\n                delete this clone\n            else\n                if <<[4] < (costume [number v])> and <[10] > (costume [number v])>> then\n                    if <(variable) = [1]> then\n                        go to x: (0) y: (0)\n                        set size to (pick random (80) to (150)) %\n                        set [ghost v] effect to (pick random (0) to (30))\n                        set [variable v] to (pick random (-20) to (20))\n                        set [?/? v] to (pick random (1) to (360))\n                        set [? v] to [0]\n                        repeat (60)\n                            go to [front v] layer\n                            point in direction (?/?)\n                            move (variable) steps\n                            change [? v] by (variable)\n                            point in direction ((?) + (?/?))\n                            if <touching (_edge_ v)?> then\n                                if on edge, bounce\n                                set [?/? v] to (direction)\n                            end\n                            set [variable v] to ((variable) * (0.95))\n                            change [ghost v] effect by (3.4)\n                        end\n                        delete this clone\n                    else\n                        go to (random position v)\n                        set size to (pick random (80) to (150)) %\n                        set [ghost v] effect to (100)\n                        point in direction (pick random (1) to (360))\n                        repeat until <[6] < (timer)>\n                            move (0.2) steps\n                            if <(pick random (1) to (2)) = [1]> then\n                                turn right (2) degrees\n                            else\n                                turn left (2) degrees\n                            end\n                            change [ghost v] effect by (-4)\n                        end\n                        delete this clone\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine ◇\ngo to x: (-240) y: (180)\nswitch costume to (正方形 v)\nrepeat (11)\n    repeat (13)\n        create clone of (_myself_ v)\n        change x by (40)\n    end\n    set x to (-240)\n    change y by (-36)\nend\n\ndefine Dust\nset [variable v] to [1]\nrepeat (20)\n    switch costume to (pick random (5) to (9))\n    create clone of (_myself_ v)\nend\n\ndefine Back Dust\nset [variable v] to [29]\nrepeat (40)\n    switch costume to (pick random (5) to (9))\n    create clone of (_myself_ v)\nend\n\nwhen I receive [intro v]\nreset timer\nstart sound [Lensko - Cetus \[NCS Release\] v]\n◇\nwait until <[1.8] < (timer)>\nBack Dust\nset [brightness v] effect to (-100)\nDust\nclear graphic effects\nswitch costume to (icon v)\ncreate clone of (_myself_ v)\nwait until <[4] < (timer)>\nset [variable v] to [3.14]\nswitch costume to ( v)\nrepeat (3)\n    create clone of (_myself_ v)\n    change [brightness v] effect by (-25)\n    wait (0.1) seconds\nend\nwait until <[5.25] < (timer)>\nclear graphic effects\nswitch costume to (name v)\ncreate clone of (_myself_ v)\nDust\nDust\nwait until <[9] < (timer)>\nset [variable v] to [8.97]\nswitch costume to ( v)\nrepeat (3)\n    create clone of (_myself_ v)\n    change [brightness v] effect by (-25)\n    wait (0.1) seconds\nend\n\nwhen flag clicked\nhide\nbroadcast (intro v)\n\n@障害物\n\nwhen flag clicked\nhide\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\nshow\n\nwhen I receive [title v]\nステージ配置 [1600] [960] [1]\nswitch costume to (none v)\n\n@スプライト1\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\n