Scroll Platformer "Picnic"  [gold_ch's games#1]


@Stage\n\nwhen flag clicked\nforever\n    play sound [spyraluary v] until done\nend\n\n@スプライト1\n\nwhen flag clicked\ngo to x: (0) y: (-20)\nset [x 2 v] to [0]\nset [y 2 v] to [0]\nset [x 3 v] to [-200]\nset [y 3 v] to [-20]\nset [x v] to [-200]\nset [y v] to [-20]\nset [x 4 v] to [-200]\nset [y 4 v] to [-20]\n\nwhen I receive [プログラム v]\nmove\n\ndefine position correction"x" (direction) (number)\nif <(x 2) = [0]> then\n    stop [this script v]\nend\nset [good v] to [0]\nrepeat until <<not <touching (スプライト3 v)?>> or <(good) = ((number) + (1))>>\n    change [good v] by (1)\n    change x by (direction)\nend\nchange x by (() - ((direction) * (((number) + (1)) * <<(good) = ((number) + (1))> and <touching (スプライト3 v)?>>)))\n\ndefine position correction"Y" (direction) (number)\nif <(y 2) = [0]> then\n    stop [this script v]\nend\nset [good v] to [0]\nrepeat until <<not <touching (スプライト3 v)?>> or <(good) = ((number) + (1))>>\n    change [good v] by (1)\n    change y by (direction)\nend\nchange y by (() - ((direction) * (((number) + (1)) * <<(good) = ((number) + (1))> and <touching (スプライト3 v)?>>)))\nset [y 2 v] to [0]\n\ndefine move\nchange [y 2 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 2 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 2 v] by (-1)\nend\nset [x 2 v] to ((x 2) * (0.88))\nchange x by (x 2)\nrepeat (6)\n    if <touching (スプライト3 v)?> then\n        change y by (1)\n    end\nend\nif <touching (スプライト3 v)?> then\n    change y by (-6)\n    position correction"x" (() - ((x 2) / ([abs v] of (x 2) ))) ([ceiling v] of ([abs v] of (x 2) ) )\n    if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(mouse y) > [0]> and <mouse down?>>>> then\n        set [y 2 v] to [12]\n        set [x 2 v] to ((7) - (<(x 2) > [0]> * (14)))\n    else\n        set [x 2 v] to [0]\n    end\nend\nchange y by (y 2)\nif <touching (スプライト3 v)?> then\n    position correction"Y" (() - ((y 2) / ([abs v] of (y 2) ))) ([ceiling v] of ([abs v] of (y 2) ) )\nend\nchange y by (-1.1)\nif <<touching (スプライト3 v)?> and <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(mouse y) > [0]> and <mouse down?>>>>> then\n    set [y 2 v] to [15]\nend\nchange y by (1.1)\nif <<(Y) < [-400]> or <touching (障害物 v)?>> then\n    go to x: (0) y: (-20)\n    set [x 2 v] to [0]\n    set [y 2 v] to [0]\n    set [x 3 v] to (x 4)\n    set [y 3 v] to (y 4)\n    set [x v] to (x 4)\n    set [y v] to (y 4)\nend\nchange [x v] by ((x position) - ((X) - (x 3)))\nchange [y v] by ((y position) - (((Y) - (y 3)) - (20)))\nchange [x 3 v] by ([floor v] of (((X) - (x 3)) * (0.1)) )\nchange [y 3 v] by ([floor v] of (((Y) - (y 3)) * (0.2)) )\nset x to ((X) - (x 3))\nset y to (((Y) - (y 3)) - (20))\nbroadcast (プログラム2 v)\n\nwhen flag clicked\nset rotation style [left-right v]\nforever\n    if <not <key (down arrow v) pressed?>> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            if <(golden) = [0]> then\n                switch costume to (コスチューム2 v)\n            else\n                switch costume to (コスチューム7 v)\n            end\n        else\n            if <(golden) = [0]> then\n                switch costume to (コスチューム3 v)\n            else\n                switch costume to (コスチューム5 v)\n            end\n        end\n    end\nend\n\nwhen flag clicked\nset rotation style [left-right v]\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        point in direction (90)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        point in direction (-90)\n    end\nend\n\nwhen flag clicked\nset rotation style [left-right v]\nforever\n    if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n        if <(golden) = [0]> then\n            switch costume to (コスチューム4 v)\n        else\n            switch costume to (コスチューム6 v)\n        end\n    end\nend\n\n@スプライト2\n\nwhen flag clicked\nhide\nステージ配置 [0] [0] [1]\nステージ配置 [480] [0] [2]\nステージ配置 [960] [0] [3]\nステージ配置 [1440] [0] [4]\nステージ配置 [2250] [50] [5]\nステージ配置 [3310] [70] [6]\nステージ配置 [-1050] [200] [7]\nステージ配置 [4050] [-300] [8]\nステージ配置 [3200] [700] [9]\nステージ配置 [2800] [700] [10]\nステージ配置 [-600] [450] [11]\nステージ配置 [3830] [400] [12]\nステージ配置 [3400] [625] [13]\nステージ配置 [2200] [625] [14]\nステージ配置 [2900] [700] [15]\nswitch costume to (1 v)\nbroadcast (プログラム v)\n\ndefine ステージ配置 (x座標) (y座標) (ステージ番号)\nswitch costume to (1 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 (1 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) - (x 3)) ((My_y) - (y 3))\nend\n\nwhen I start as a clone\nshow\n\nステージ配置 [860] [650] [16]\n\n@スプライト3\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ステージ配置 [2500] [0] [6]\nステージ配置 [3020] [45] [7]\nステージ配置 [3600] [45] [8]\nステージ配置 [3600] [290] [9]\nステージ配置 [3300] [-470] [10]\nステージ配置 [3700] [-470] [11]\nステージ配置 [4270] [-300] [12]\nステージ配置 [4270] [10] [13]\nステージ配置 [3830] [250] [14]\nステージ配置 [2870] [500] [15]\nステージ配置 [2400] [500] [16]\nステージ配置 [1850] [500] [17]\nステージ配置 [1300] [500] [18]\nステージ配置 [800] [600] [19]\nステージ配置 [268] [600] [20]\nステージ配置 [-180] [550] [21]\nステージ配置 [-400] [380] [22]\nステージ配置 [-650] [200] [23]\nステージ配置 [-1050] [95] [24]\nswitch costume to (1 v)\nbroadcast (プログラム v)\n\ndefine ステージ配置 (x座標) (y座標) (ステージ番号)\nswitch costume to (1 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 (1 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) - (x 3)) ((My_y) - (y 3))\nend\n\nwhen I start as a clone\nshow\n\n@スプライト4\n\nwhen flag clicked\nset [チェックポイント到達 v] to [0]\nswitch costume to (a v)\nhide\n\nwhen I receive [プログラム2 v]\n移動 ((2130) - (x 3)) ((35) - (y 3))\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 (スプライト1 v)?> and <(チェックポイント到達) = [0]>> then\n        set [チェックポイント到達 v] to [1]\n        set [x 4 v] to [2130]\n        set [y 4 v] to [35]\n    end\nend\nswitch costume to ((チェックポイント到達) + (2))\n\n@障害物\n\nwhen flag clicked\nhide\nステージ配置 [1440] [0] [1]\nステージ配置 [2500] [0] [2]\nステージ配置 [1600] [0] [3]\nステージ配置 [3700] [50] [4]\nステージ配置 [-400] [172] [5]\nステージ配置 [-500] [450] [6]\nステージ配置 [3400] [650] [7]\nステージ配置 [1850] [600] [8]\nステージ配置 [222] [680] [9]\nステージ配置 [2000] [0] [10]\nステージ配置 [4250] [400] [11]\nswitch costume to (1 v)\n\ndefine ステージ配置 (x座標) (y座標) (ステージ番号)\nswitch costume to (1 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 (1 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) - (x 3)) ((My_y) - (y 3))\nend\n\nwhen I start as a clone\nshow\n\n@スプライト5\n\nwhen flag clicked\ngo to x: (8) y: (-15)\nhide\n\n@スプライト6\n\nwhen flag clicked\nset [チェックポイント到達 v] to [0]\nswitch costume to (a v)\nhide\n\nwhen I receive [プログラム2 v]\n移動 ((3500) - (x 3)) ((638) - (y 3))\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 (スプライト1 v)?> and <(チェックポイント到達) = [0]>> then\n        set [チェックポイント到達 v] to [1]\n        set [x 4 v] to [3500]\n        set [y 4 v] to [650]\n    end\nend\nswitch costume to ((チェックポイント到達) + (2))\n\n@Detector\n\nwhen flag clicked\nhide\nset [faved___ v] to [0]\nset [loved__ v] to [0]\nset [clone id v] to [0]\ncreate clone of (_myself_ v)\nwait (0.2) seconds\nset [clone id v] to [1]\ncreate clone of (_myself_ v)\nwait until <<(LOVED__) = [1]> and <(FAVED___) = [1]>>\nwait (1) seconds\nbroadcast (Thanks v)\ngo to x: (0) y: (0)\nshow\nclear graphic effects\nswitch costume to (pick random (1) to (4))\nset [ghost v] effect to (100)\nrepeat (10)\n    change y by ((y position) / (-15))\n    change [ghost v] effect by (-3)\nend\nrepeat (10)\n    change y by (((y position) - (-100)) / (-15))\n    change [ghost v] effect by (10)\nend\n\nreset timer\n\nrepeat until <(timer) > [3.5]>\nend\nreset timer\nrepeat until <(timer) > [3.5]>\nend\n\nwhen I start as a clone\nif <(clone id) = [0]> then\n    go to x: (-15) y: (0)\n    set [loved__ v] to [0]\n    switch costume to (love v)\n    forever\n        set [love? v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [loved__ v] to [1]\n        end\n    end\nend\nif <(clone id) = [1]> then\n    go to x: (0) y: (0)\n    switch costume to (fave v)\n    set [faved___ v] to [0]\n    forever\n        set [fav v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [faved___ v] to [1]\n        end\n    end\nend\n\nwhen I receive [thanks v]\nrepeat (10)\n    create clone of (cat2 v)\nend\n\n@Thanks\n\nwhen I receive [thanks v]\nswitch costume to (costume2 v)\ngo to x: (-210) y: (50)\nshow\ngo to [front v] layer\nstart sound [pop v]\nrepeat (9)\n    change y by (-6)\nend\nrepeat (5)\n    change y by (3)\nend\nrepeat (5)\n    change y by (-3)\nend\nwait (1) seconds\nrepeat (10)\n    change y by (6)\nend\nhide\n\nwhen I start as a clone\ngo to x: (0) y: (-50)\nshow\ngo to [front v] layer\nrepeat (12)\n    change y by (-9)\nend\nrepeat (5)\n    change y by (3)\nend\nrepeat (5)\n    change y by (-1)\nend\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (50)\n        if <(costume [number v]) = [2]> then\n            if <mouse down?> then\n                set [costume v] to [2]\n                repeat (25)\n                    change y by (10)\n                end\n                hide\n                delete this clone\n            end\n        else\n            if <(costume [number v]) = [3]> then\n                if <mouse down?> then\n                    set [costume v] to [1]\n                    repeat (25)\n                        change y by (15)\n                    end\n                    hide\n                    delete this clone\n                end\n            end\n        end\n    else\n        set [ghost v] effect to (0)\n    end\n    if <(Costume) > [0.99]> then\n        repeat (25)\n            change y by (15)\n        end\n        hide\n        delete this clone\n    end\n    hide\n    delete this clone\nend\n\nwhen flag clicked\nhide\nset [costume v] to [0.9]\n\nwhen I receive [begin v]\nset [costume v] to [0.9]\nwait (0.1) seconds\nset [costume v] to [0.9]\nwait (0.2) seconds\nset [costume v] to [0.9]\n\nwhen I receive [thanks v]\nstart sound [Coin v]\nset [golden v] to [1]\n\n