Planet -100%PEN Platformer-　

Instructions: WASDkey ,arrow key\nWASDキーか矢印キー\n\n旗しかない星についたらゴールです

@Stage\n\n@pen\n\ndefine 2点の角度1 (ｘ) (ｙ) 2 (ｘ2) (ｙ2) から見て\nif <<(ｘ) < (ｘ2)> or <(ｘ) = (ｘ2)>> then\n    set [2点間の角度 v] to (([atan v] of (((ｙ2) - (ｙ)) / ((ｘ2) - (ｘ))) ) + (180))\nelse\n    set [2点間の角度 v] to ([atan v] of (((ｙ2) - (ｙ)) / ((ｘ2) - (ｘ))) )\nend\n\nwhen flag clicked\nforever\n    change [ステージｘ v] by (round (((自機ｘ) + (Xv)) / (12)))\n    change [自機ｘ v] by (round ((-1) * (((自機ｘ) + (Xv)) / (12))))\n    change [ステージｙ v] by (round (((自機ｙ) + (Yv)) / (12)))\n    change [自機ｙ v] by (round ((-1) * (((自機ｙ) + (Yv)) / (12))))\nend\n\ndefine 2点間の距離 (ｘ) (ｙ) 、 (ｘ2) (ｙ2)\nset [2点間の距離 v] to ([sqrt v] of ((((ｘ) - (ｘ2)) * ((ｘ) - (ｘ2))) + (((ｙ) - (ｙ2)) * ((ｙ) - (ｙ2)))) )\n\nwhen flag clicked\nset [チェックポイントx v] to [0]\nset [チェックポイントｙ v] to [0]\nリスポ\nforever\n    動く\nend\n\ndefine リスポ\nset [xv v] to [0]\nset [yv v] to [0]\nset [ステージｘ v] to (チェックポイントx)\nset [ステージｙ v] to (チェックポイントｙ)\nset [自機ｘ v] to [0]\nset [自機ｙ v] to [0]\n\ndefine xy (x) (y)\ngo to x: (((-1) * (ステージｘ)) + (x)) y: (((-1) * (ステージｙ)) + (y))\n\ndefine 星追加xy (x) (y) 半径 (半径) 色 (色) 種類 (種類) 重力 (重力)\nadd (x) to [ステージ情報 v]\nadd (y) to [ステージ情報 v]\nadd (半径) to [ステージ情報 v]\nadd (色) to [ステージ情報 v]\nadd (種類) to [ステージ情報 v]\nadd [100000] to [ステージ情報 v]\nadd (重力) to [ステージ情報 v]\n\ndefine 描画\nerase all\nset pen size to ((1) / (0))\nset pen color to (#000000)\ngo to x: (0) y: (0)\npen down\npen up\nset [jj v] to [0]\nrepeat ((length of [流れ星 v]) / (7))\n    set pen color to (#ffe4e4)\n    change pen (color v) by (item ((jj) + (7)) of [流れ星 v])\n    set pen size to ((item ((jj) + (3)) of [流れ星 v]) * ((1) / (10)))\n    set pen (transparency v) to (50)\n    xy ((item ((jj) + (1)) of [流れ星 v]) + (((10) * (item ((jj) + (6)) of [流れ星 v])) * ([cos v] of ((item ((jj) + (5)) of [流れ星 v]) + (180)) ))) ((item ((jj) + (2)) of [流れ星 v]) + (((10) * (item ((jj) + (6)) of [流れ星 v])) * ([sin v] of ((item ((jj) + (5)) of [流れ星 v]) + (180)) )))\n    repeat (20)\n        pen down\n        pen up\n        change pen size by ((item ((jj) + (3)) of [流れ星 v]) * ((1) / (10)))\n        change pen (saturation v) by (5)\n        change pen (transparency v) by (-5)\n        change x by (((item ((jj) + (6)) of [流れ星 v]) * ([cos v] of (item ((jj) + (5)) of [流れ星 v]) )) / (1.5))\n        change y by (((item ((jj) + (6)) of [流れ星 v]) * ([sin v] of (item ((jj) + (5)) of [流れ星 v]) )) / (1.5))\n    end\n    replace item ((jj) + (1)) of [流れ星 v] with ((item ((jj) + (1)) of [流れ星 v]) + ((item ((jj) + (6)) of [流れ星 v]) * ([cos v] of (item ((jj) + (5)) of [流れ星 v]) )))\n    replace item ((jj) + (2)) of [流れ星 v] with ((item ((jj) + (2)) of [流れ星 v]) + ((item ((jj) + (6)) of [流れ星 v]) * ([sin v] of (item ((jj) + (5)) of [流れ星 v]) )))\n    replace item ((jj) + (4)) of [流れ星 v] with ((item ((jj) + (4)) of [流れ星 v]) + (-1))\n    if <(item ((jj) + (4)) of [流れ星 v]) < [1]> then\n        repeat (7)\n            delete ((jj) + (1)) of [流れ星 v]\n        end\n    else\n        change [jj v] by (7)\n    end\nend\nset [i v] to [0]\nrepeat ((length of [ステージ情報 v]) / (7))\n    set pen color to (#ff0000)\n    change pen (color v) by (item ((i) + (4)) of [ステージ情報 v])\n    set pen size to ((2) * (item ((i) + (3)) of [ステージ情報 v]))\n    if <(item ((i) + (4)) of [ステージ情報 v]) = []> then\n        set pen color to (#828282)\n    end\n    xy (item ((i) + (1)) of [ステージ情報 v]) (item ((i) + (2)) of [ステージ情報 v])\n    pen down\n    pen up\n    repeat (10)\n        if <(item ((i) + (4)) of [ステージ情報 v]) = []> then\n            change pen (brightness v) by (((1) * (item ((i) + (3)) of [ステージ情報 v])) / (10))\n        else\n            change pen (saturation v) by (((-1) * (item ((i) + (3)) of [ステージ情報 v])) / (10))\n        end\n        change pen size by (((-2) * (item ((i) + (3)) of [ステージ情報 v])) / (10))\n        pen down\n        pen up\n    end\n    change [i v] by (7)\nend\nset [i v] to [0]\nrepeat ((length of [旗情報 v]) / (3))\n    set pen color to (#ffbb00)\n    set pen size to (10)\n    xy ((item ((i) + (1)) of [旗情報 v]) + (-30)) ((item ((i) + (2)) of [旗情報 v]) + (-50))\n    pen down\n    xy ((item ((i) + (1)) of [旗情報 v]) + (-30)) ((item ((i) + (2)) of [旗情報 v]) + (50))\n    xy ((item ((i) + (1)) of [旗情報 v]) + (30)) ((item ((i) + (2)) of [旗情報 v]) + (25))\n    xy ((item ((i) + (1)) of [旗情報 v]) + (-30)) ((item ((i) + (2)) of [旗情報 v]) + (0))\n    pen up\n    change [i v] by (3)\nend\nset [i v] to [0]\nrepeat (12)\n    偽旗xy [25373] [1500] 距離 [200] 角度 (i)\n    change [i v] by (30)\nend\nset pen size to (30)\nset pen color to (#ffffff)\ngo to x: (自機ｘ) y: (自機ｙ)\npen down\npen up\nchange pen (brightness v) by (-100)\nchange pen size by (-8)\npen down\npen up\nchange pen (brightness v) by (100)\nchange pen size by (-12)\nchange x by ((((Xv) / (2)) * ([cos v] of ((一番近い星との角度) - (90)) )) + (((Yv) / (6)) * ([cos v] of (一番近い星との角度) )))\nchange y by ((((Xv) / (2)) * ([sin v] of ((一番近い星との角度) - (90)) )) + (((Yv) / (6)) * ([sin v] of (一番近い星との角度) )))\npen down\npen up\n\ndefine 接触判定\ndelete all of [接触 v]\nset [ii v] to [0]\nrepeat ((length of [ステージ情報 v]) / (7))\n    2点間の距離 (item ((ii) + (1)) of [ステージ情報 v]) (item ((ii) + (2)) of [ステージ情報 v]) 、 ((ステージｘ) + (自機ｘ)) ((ステージｙ) + (自機ｙ))\n    replace item ((ii) + (6)) of [ステージ情報 v] with ((2点間の距離) - (item ((ii) + (3)) of [ステージ情報 v]))\n    if <(2点間の距離) < ((item ((ii) + (3)) of [ステージ情報 v]) + (15))> then\n        add (item ((ii) + (5)) of [ステージ情報 v]) to [接触 v]\n    end\n    change [ii v] by (7)\nend\n\nwhen flag clicked\nhide\nforever\n    描画\nend\n\nwhen flag clicked\nforever\n    接触判定\nend\n\ndefine 動く\nif <<<<(mouse x) < (x position)> and <mouse down?>> or <key (a v) pressed?>> or <key (left arrow v) pressed?>> then\n    change [xv v] by (-1)\nend\nif <<<<(x position) < (mouse x)> and <mouse down?>> or <key (d v) pressed?>> or <key (right arrow v) pressed?>> then\n    change [xv v] by (1)\nend\nset [xv v] to ((Xv) * (0.88))\n自機xかy [x] を (Xv) ずつ動かす\nif <[接触 v] contains [1]?> then\n    自機xかy [y] を [1] ずつ動かす\n    if <[接触 v] contains [1]?> then\n        自機xかy [y] を [1] ずつ動かす\n        if <[接触 v] contains [1]?> then\n            自機xかy [y] を [1] ずつ動かす\n            if <[接触 v] contains [1]?> then\n                自機xかy [y] を [1] ずつ動かす\n                if <[接触 v] contains [1]?> then\n                    自機xかy [y] を [1] ずつ動かす\n                    接触判定\n                    if <[接触 v] contains [1]?> then\n                        自機xかy [y] を [-5] ずつ動かす\n                        自機xかy [x] を ((-1) * (Xv)) ずつ動かす\n                        if <<<<[0] < (mouse y)> and <mouse down?>> or <<key (w v) pressed?> or <key (up arrow v) pressed?>>> and <[接触 v] contains [1]?>> then\n                            if <[0] < (Xv)> then\n                                set [xv v] to [-10]\n                            else\n                                set [xv v] to [10]\n                            end\n                            set [yv v] to [15]\n                        else\n                            set [xv v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nchange [yv v] by (-1)\n自機xかy [y] を (Yv) ずつ動かす\n接触判定\nif <[接触 v] contains [1]?> then\n    自機xかy [y] を ((-1) * (Yv)) ずつ動かす\n    set [yv v] to [0]\nend\nif <[接触 v] contains [2]?> then\n    リスポ\nend\n自機xかy [y] を [-4] ずつ動かす\nif <<[接触 v] contains [1]?> and <<<[0] < (mouse y)> and <mouse down?>> or <<key (w v) pressed?> or <key (up arrow v) pressed?>>>> then\n    set [yv v] to [15]\nend\nif <[接触 v] contains [3]?> then\n    set [yv v] to [22]\nend\n自機xかy [y] を [4] ずつ動かす\n\ndefine 一番近い星とその角度\nset [iii v] to [7]\nset [雑用 v] to [0]\nrepeat (((length of [ステージ情報 v]) / (7)) - (1))\n    if <((item ((iii) + (6)) of [ステージ情報 v]) * (item ((iii) + (7)) of [ステージ情報 v])) < ((item ((雑用) + (6)) of [ステージ情報 v]) * (item ((雑用) + (7)) of [ステージ情報 v]))> then\n        set [雑用 v] to (iii)\n    end\n    change [iii v] by (7)\nend\nif <not <(一番近い星) = (雑用)>> then\n    set [xv v] to [0]\n    set [yv v] to [0]\nend\nset [一番近い星 v] to (雑用)\n2点の角度1 ((ステージｘ) + (自機ｘ)) ((ステージｙ) + (自機ｙ)) 2 (item ((一番近い星) + (1)) of [ステージ情報 v]) (item ((一番近い星) + (2)) of [ステージ情報 v]) から見て\nset [一番近い星との角度 v] to (2点間の角度)\n\nwhen flag clicked\nforever\n    一番近い星とその角度\nend\n\ndefine 自機xかy (xかy) を (何) ずつ動かす\nif <(xかy) = [x]> then\n    change [自機ｘ v] by ((何) * ([cos v] of ((一番近い星との角度) + (-90)) ))\n    change [自機ｙ v] by ((何) * ([sin v] of ((一番近い星との角度) + (-90)) ))\nend\nif <(xかy) = [y]> then\n    change [自機ｘ v] by ((何) * ([cos v] of (一番近い星との角度) ))\n    change [自機ｙ v] by ((何) * ([sin v] of (一番近い星との角度) ))\nend\n\nwhen flag clicked\nステージ生成\nforever\n    接触判定\nend\n\nwhen flag clicked\nforever\n    play sound [Tobu - Infectious _NCS Release_ v] until done\nend\n\ndefine 旗追加xy (x) (y) ステージ何+10の旗？ (何+10)\nadd (x) to [旗情報 v]\nadd (y) to [旗情報 v]\nadd (何+10) to [旗情報 v]\nadd ((x) + (5000)) to [チェックポイント v]\nadd (y) to [チェックポイント v]\n\ndefine 旗接触判定\ndelete all of [旗接触 v]\nset [iiii v] to [0]\nrepeat ((length of [旗情報 v]) / (3))\n    if <<<((item ((iiii) + (1)) of [旗情報 v]) + (-30)) < (((ステージｘ) + (自機ｘ)) + (15))> and <(((ステージｘ) + (自機ｘ)) + (-15)) < ((item ((iiii) + (1)) of [旗情報 v]) + (30))>> and <<((item ((iiii) + (2)) of [旗情報 v]) + (-50)) < (((ステージｙ) + (自機ｙ)) + (15))> and <(((ステージｙ) + (自機ｙ)) + (-15)) < ((item ((iiii) + (2)) of [旗情報 v]) + (50))>>> then\n        add (item ((iiii) + (3)) of [旗情報 v]) to [旗接触 v]\n    end\n    change [iiii v] by (3)\nend\n\nwhen flag clicked\nforever\n    旗接触判定\nend\n\nwhen flag clicked\nforever\n    if <not <(length of [旗接触 v]) = [0]>> then\n        set [チェックポイントx v] to (item ((item (1) of [旗接触 v]) - (10)) of [チェックポイント v])\n        set [チェックポイントｙ v] to (item ((item (1) of [旗接触 v]) - (9)) of [チェックポイント v])\n        リスポ\n    end\nend\n\ndefine ステージ生成\ndelete all of [ステージ情報 v]\ndelete all of [旗情報 v]\ndelete all of [チェックポイント v]\ndelete all of [流れ星 v]\n星追加xy [0] [-500] 半径 [200] 色 [55] 種類 [1] 重力 [100]\n星追加xy [450] [-500] 半径 [100] 色 [44] 種類 [1] 重力 [100]\n星追加xy [800] [-200] 半径 [200] 色 [88] 種類 [1] 重力 [110]\n旗追加xy [832] [52] ステージ何+10の旗？ [11]\n星追加xy [5832] [-500] 半径 [300] 色 [17] 種類 [1] 重力 [100]\n星追加xy [6450] [-500] 半径 [100] 色 [44] 種類 [3] 重力 [50]\n星追加xy [6800] [-200] 半径 [50] 色 [88] 種類 [1] 重力 [110]\n旗追加xy [6832] [-100] ステージ何+10の旗？ [13]\n星追加xy [11832] [500] 半径 [80] 色 [75] 種類 [1] 重力 [110]\n星追加xy [12100] [500] 半径 [50] 色 [0] 種類 [2] 重力 [110]\n星追加xy [11600] [700] 半径 [50] 色 [33] 種類 [1] 重力 [110]\n星追加xy [11600] [950] 半径 [100] 色 [67] 種類 [1] 重力 [100]\n星追加xy [12000] [1400] 半径 [300] 色 [7] 種類 [1] 重力 [50]\n旗追加xy [12032] [1752] ステージ何+10の旗？ [15]\n星追加xy [18000] [1752] 半径 [300] 色 [0] 種類 [1] 重力 [100]\n星追加xy [18000] [1250] 半径 [30] 色 [49] 種類 [1] 重力 [100]\n星追加xy [18200] [980] 半径 [80] 色 [15] 種類 [1] 重力 [100]\n星追加xy [18500] [820] 半径 [100] 色 [60] 種類 [1] 重力 [100]\n星追加xy [18800] [820] 半径 [50] 色 [] 種類 [1] 重力 [100]\n星追加xy [19100] [970] 半径 [90] 色 [2] 種類 [1] 重力 [100]\n星追加xy [19450] [1150] 半径 [150] 色 [8] 種類 [1] 重力 [100]\n星追加xy [19800] [1500] 半径 [140] 色 [16] 種類 [1] 重力 [100]\n星追加xy [20100] [1850] 半径 [100] 色 [60] 種類 [1] 重力 [100]\n星追加xy [20350] [2100] 半径 [100] 色 [65] 種類 [1] 重力 [100]\n旗追加xy [20373] [2250] ステージ何+10の旗？ [17]\n星追加xy [25373] [1500] 半径 [150] 色 [] 種類 [1] 重力 [100]\n\ndefine 偽旗xy (x) (y) 距離 (距離) 角度 (角度)\nset pen color to (#ffbb00)\nset pen size to (10)\nxy ((x) + (((距離) + (-50)) * ([cos v] of ((角度) + (0)) ))) ((y) + (((距離) + (-50)) * ([sin v] of ((角度) + (0)) )))\npen down\nxy ((x) + (((距離) + (50)) * ([cos v] of ((角度) + (0)) ))) ((y) + (((距離) + (50)) * ([sin v] of ((角度) + (0)) )))\nxy ((x) + (((距離) + (25)) * ([cos v] of ((角度) + (-15)) ))) ((y) + (((距離) + (25)) * ([sin v] of ((角度) + (-15)) )))\nxy ((x) + (((距離) + (0)) * ([cos v] of ((角度) + (0)) ))) ((y) + (((距離) + (0)) * ([sin v] of ((角度) + (0)) )))\npen up\n\ndefine 流れ星追加xy (x) (y) 大きさ (大きさ) 何回描画 (何回) 角度 (角度) 速さ (速さ) 色 (色)\nadd (x) to [流れ星 v]\nadd (y) to [流れ星 v]\nadd (大きさ) to [流れ星 v]\nadd (何回) to [流れ星 v]\nadd (角度) to [流れ星 v]\nadd (速さ) to [流れ星 v]\nadd (色) to [流れ星 v]\n\nwhen flag clicked\nforever\n    流れ星追加xy (((ステージｘ) + (自機ｘ)) + (pick random (-300) to (300))) (((ステージｙ) + (自機ｙ)) + (pick random (-225) to (225))) 大きさ (pick random (3.1) to (6.9)) 何回描画 (pick random (80) to (120)) 角度 (pick random (1) to (360)) 速さ (pick random (5.1) to (11.9)) 色 (pick random (0) to (199.9))\n    wait (pick random (0.05) to (0.15)) seconds\nend\n\n@ thumbnail\n\nwhen flag clicked\nhide\n\n