Christmas Platformer/クリスマスプラットフォーマー

Instructions: 【新作！見てね↓】\nhttps://scratch.mit.edu/projects/926684314/\n\n初のプラットフォーマ―です。\n細部まで細かく作ったので是非遊んでください。\n全10ステージあります。\n遊び方 how to play\n移動…矢印キー、タップ\nMove...arrow keys\nステージスキップ…♥と★で解放（3回まで）\nStage skip... unlock with ♥ and ★(up to 3 times)\n暗闇の中を進んでください。\n時間が経つごとに周りの光が小さくなっていきます。\nチェックポイント（家）に入ると光が回復します。\n\n作者のタイム...24.1

@Stage\n\nwhen flag clicked\nbroadcast (スタート v)\n\nwhen I receive [スタート v]\nforever\n    play sound [Speed Rimit v] until done\nend\n\nwhen I receive [スタート v]\nhide variable [☁ 最高記録 v]\nhide variable [合計タイム v]\nset [タイム30fps v] to [0]\nwait (0) seconds\nrepeat until <((全ステ) - (1)) < ([costume # v] of [ステージ当たり判定 v])>\n    change [タイム30fps v] by (1)\n    set [合計タイム v] to (([ceiling v] of (((タイム30fps) / (30)) * (10)) ) / (10))\nend\nshow variable [☁ 最高記録 v]\nshow variable [合計タイム v]\nif <(合計タイム) < (☁ 最高記録)> then\n    set [☁ 最高記録 v] to (合計タイム)\n    wait (0.1) seconds\nend\n\n@サムネ\n\nwhen flag clicked\nforever\n    set [タイマー v] to (timer)\n    hide\nend\n\nwhen [timer v] > ((タイマー) + (0.1))\ngo to [front v] layer\nshow\n\n@プレイヤー\n\ndefine 縦移動\nswitch costume to (当たり判定 v)\nif <(滞空時間) < [4]> then\n    if <[0.5] < (ジョイスティックｙ)> then\n        set [y移動速度 v] to (([sin v] of ([direction v] of [坂道判定 v]) ) * (15))\n        change [x移動速度 v] by (([cos v] of ([direction v] of [坂道判定 v]) ) * (-5))\n    else\n        if <[30] < ([abs v] of (([direction v] of [坂道判定 v]) - (90)) )> then\n    end\nend\nchange [y移動速度 v] by (-2)\nset [y移動速度 v] to ((y移動速度) * (0.95))\nchange y by (y移動速度)\nif <touching (ステージ当たり判定 v)?> then\n    if <(y移動速度) < [0]> then\n        位置調整y [1]\n        set [滞空時間 v] to [0]\n    else\n        位置調整y [-1]\n        change [滞空時間 v] by (8)\n    end\n    set [y移動速度 v] to [0]\nelse\n    change [滞空時間 v] by (1)\nend\n\ndefine 横移動\nswitch costume to (当たり判定 v)\nif <(滞空時間) < [1]> then\n    歩く [3]\n    if <[0] < ([abs v] of (右左) )> then\n        set [x移動速度 v] to ((x移動速度) * (0.7))\n    else\n        set [x移動速度 v] to ((x移動速度) * (0.85))\n    end\nelse\n    歩く [3]\n    if <[0] < ([abs v] of (右左) )> then\n        set [x移動速度 v] to ((x移動速度) * (0.8))\n    else\n        set [x移動速度 v] to ((x移動速度) * (0.95))\n    end\nend\nchange x by (x移動速度)\nif <touching (ステージ当たり判定 v)?> then\n    change y by (([abs v] of ([cos v] of ([direction v] of [坂道判定 v]) ) ) * (([abs v] of (x移動速度) ) * (1)))\n    change y by (1)\n    switch costume to (当たり判定壁 v)\n    if <touching (ステージ当たり判定 v)?> then\n        change y by (([abs v] of ([cos v] of ([direction v] of [坂道判定 v]) ) ) * (([abs v] of (x移動速度) ) * (-1)))\n        change y by (-1)\n        if <(x移動速度) < [0]> then\n            位置調整x [1]\n        else\n            位置調整x [-1]\n        end\n        set [x移動速度 v] to [0]\n    end\nend\n\ndefine 位置調整y (調整)\nswitch costume to (当たり判定 v)\nset [カウント v] to [0]\nrepeat until <<not <touching (ステージ当たり判定 v)?>> or <((([abs v] of (y移動速度) ) + (1)) * (2)) < ([abs v] of (カウント) )>>\n    change y by (調整)\n    change [カウント v] by (調整)\nend\nif <((([abs v] of (y移動速度) ) + (1)) * (2)) < ([abs v] of (カウント) )> then\n    set [やられた v] to [1]\nend\n\ndefine 位置調整x (調整)\nswitch costume to (当たり判定 v)\nset [カウント v] to [0]\nrepeat until <<not <touching (ステージ当たり判定 v)?>> or <((([abs v] of (x移動速度) ) + (10)) * (2)) < ([abs v] of (カウント) )>>\n    change x by (調整)\n    change [カウント v] by (調整)\nend\nif <((([abs v] of (x移動速度) ) + (10)) * (2)) < ([abs v] of (カウント) )> then\n    change y by (5)\n    if <touching (ステージ当たり判定 v)?> then\n        set [やられた v] to [1]\n    end\nend\n\ndefine ステージに配置\nset [滞空時間 v] to [0]\nset [y移動速度 v] to [0]\nswitch costume to (当たり判定 v)\nrepeat until <touching (ステージ当たり判定 v)?>\n    change y by (-20)\nend\nrepeat (21)\n    if <touching (ステージ当たり判定 v)?> then\n        change y by (1)\n    end\nend\nif <touching (ステージ当たり判定 v)?> then\n    change y by (-20)\n    ステージに配置\nend\n\ndefine 端に触れたら戻る\nif <[230] < ([abs v] of (x position) )> then\n    if <[0] < (x position)> then\n        broadcast (次のステージ v)\n        go to x: (-185) y: (180)\n        リスタート\n    else\n        set x to (-230)\n        set [向き v] to [90]\n    end\n    change y by (-10)\n    if <touching (ステージ当たり判定 v)?> then\n        ステージに配置\n        change y by (1)\n    else\n        change y by (20)\n        if <touching (ステージ当たり判定 v)?> then\n            ステージに配置\n            change y by (1)\n        else\n            change y by (-10)\n        end\n    end\nend\nif <[180] < (y position)> then\n    set y to (180)\nend\nif <(y position) < [-179]> then\n    set y to (-180)\n    point in direction (90)\n    change [やられた v] by (1)\nend\n\nwhen I receive [スタート v]\nclear graphic effects\nshow\nリスタート\nforever\n    point in direction (90)\n    switch costume to (当たり判定 v)\n    go to [back v] layer\n    横移動\n    縦移動\n    if <(滞空時間) < [3]> then\n        if <(向き) < [0]> then\n            set [向き v] to [180]\n        end\n        if <[180] < (向き)> then\n            set [向き v] to [0]\n        end\n        change [向き v] by ((([direction v] of [坂道判定 v]) - (向き)) / (1.5))\n    else\n        change [向き v] by (((90) - (向き)) / (20))\n        if <[1] < (x移動速度)> then\n            change [向き v] by (20)\n        end\n        if <(x移動速度) < [-1]> then\n            change [向き v] by (-20)\n        end\n    end\n    端に触れたら戻る\n    point in direction (向き)\n    switch costume to (コスチューム1 v)\n    if <(滞空時間) < [1]> then\n        change [x移動速度 v] by (([cos v] of ([direction v] of [坂道判定 v]) ) * (-2))\n        change [y移動速度 v] by (([sin v] of ([direction v] of [坂道判定 v]) ) * (-2))\n    end\n    次回、じょうのうち、しす！\nend\n\ndefine 歩く (スピード)\nset [右左 v] to (ジョイスティックｘ)\nif <[30] < ([abs v] of (([direction v] of [坂道判定 v]) - (90)) )> then\n    change [x移動速度 v] by ((右左) * ((スピード) * (1.5)))\nelse\n    change [x移動速度 v] by ((右左) * (スピード))\nend\n\ndefine 次回、じょうのうち、しす！\nif <(やられた) = [1]> then\n    start sound [Crunch v]\n    switch costume to (コスチューム2 v)\n    set [y移動速度 v] to [21]\n    repeat (20)\n        go to [front v] layer\n        change [y移動速度 v] by (-2)\n        change y by (y移動速度)\n        turn right (18) degrees\n    end\n    set [やられた v] to [2]\n    set [ghost v] effect to (100)\n    wait (0.5) seconds\n    broadcast (再配置 v)\n    リスタート\n    switch costume to (コスチューム1 v)\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nend\n\ndefine リスタート\ngo to x: (-185) y: (180)\nステージに配置\nset [x移動速度 v] to [0]\nset [y移動速度 v] to [0]\nset [やられた v] to [0]\nset [向き v] to [90]\npoint in direction (90)\n\nwhen I receive [トゲ v]\nif <(やられた) = [0]> then\n    set [やられた v] to [1]\nend\n\nwhen flag clicked\nhide\n\nwhen [0 v] key pressed\nif <(やられた) = [0]> then\n    set [やられた v] to [1]\nend\n\nwhen [1 v] key pressed\nif <(username) = [b-coffee]> then\n    broadcast (ステージスキップ v)\nend\n\nwhen I receive [ステージスキップ v]\ngo to x: (250) y: (150)\n\n@プレイヤー影\n\ndefine 位置調整y (調整)\nswitch costume to (当たり判定 v)\nset [カウント v] to [0]\nrepeat until <<not <touching (ステージ当たり判定 v)?>> or <((([abs v] of (y移動速度) ) + (1)) * (2)) < ([abs v] of (カウント) )>>\n    change y by (調整)\n    change [カウント v] by (調整)\nend\nif <((([abs v] of (y移動速度) ) + (1)) * (2)) < ([abs v] of (カウント) )> then\n    set [やられた v] to [1]\nend\n\ndefine 位置調整x (調整)\nswitch costume to (当たり判定 v)\nset [カウント v] to [0]\nrepeat until <<not <touching (ステージ当たり判定 v)?>> or <((([abs v] of (x移動速度) ) + (10)) * (2)) < ([abs v] of (カウント) )>>\n    change x by (調整)\n    change [カウント v] by (調整)\nend\nif <((([abs v] of (x移動速度) ) + (10)) * (2)) < ([abs v] of (カウント) )> then\n    set [やられた v] to [1]\nend\n\nwhen I receive [スタート v]\nclear graphic effects\nforever\n    if <([やられた v] of [プレイヤー v]) = [0]> then\n        go to (プレイヤー v)\n        point in direction ([direction v] of [プレイヤー v])\n        switch costume to (当たり判定 v)\n        show\n        if <<touching (ステージ v)?> or <touching (光 v)?>> then\n            switch costume to (コスチューム1 v)\n            show\n            go to [front v] layer\n            set [ghost v] effect to (25)\n        else\n            switch costume to (コスチューム1 v)\n            set [ghost v] effect to (75)\n        end\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nhide\n\n@ステージ当たり判定\n\nwhen flag clicked\nset [全ステ v] to [11]\nhide\n\nwhen I receive [次のステージ v]\nnext costume\nchange [ステージ v] by (1)\n\nbroadcast (スタート v)\n\nwhen I receive [スタート v]\nswitch costume to (コスチューム1 v)\nshow\nset [ghost v] effect to (100)\nset [ステージ v] to [1]\n\n@ステージ\n\nwhen flag clicked\nhide\n\nwhen I receive [スタート v]\nshow\ngo to [front v] layer\ngo [backward v] (1) layers\nforever\n    switch costume to ([costume # v] of [ステージ当たり判定 v])\nend\n\n@チェックポイント\n\nwhen I receive [スタート v]\nshow\ngo to [front v] layer\ngo [backward v] (1) layers\nforever\n    switch costume to ([costume # v] of [ステージ当たり判定 v])\n    set [ghost v] effect to (100)\n    if <touching (プレイヤー影 v)?> then\n        change [ロウソク v] by (((100) - (ロウソク)) / (3))\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [スタート v]\nset [プレゼント v] to [0]\nforever\n    wait until <<touching (プレイヤー v)?> and <(プレゼント) < ([costume # v] of [ステージ当たり判定 v])>>\n    set [プレゼント v] to ([costume # v] of [ステージ当たり判定 v])\n    start sound [決定ボタンを押す23 v]\nend\n\n@坂道判定\n\ndefine 傾き\nif <not <<(x position) = ([x position v] of [プレイヤー v])> and <(y position) = ([y position v] of [プレイヤー v])>>> then\n    point in direction (90)\n    go to (プレイヤー v)\n    change y by (-16)\n    set [ｙ v] to [0]\n    set [カウント v] to [0]\n    repeat until <<not <touching (ステージ当たり判定 v)?>> or <[10] < (ｙ)>>\n        change [カウント v] by (1)\n        turn right (10) degrees\n        if <[36] < (カウント)> then\n            change [ｙ v] by (1)\n            set [カウント v] to [0]\n            change y by (2)\n        end\n    end\n    set [右回り角度 v] to (direction)\n    point in direction (90)\n    go to (プレイヤー v)\n    change y by (-16)\n    set [ｙ v] to [0]\n    set [カウント v] to [0]\n    repeat until <<not <touching (ステージ当たり判定 v)?>> or <[10] < (ｙ)>>\n        change [カウント v] by (1)\n        turn left (10) degrees\n        if <[36] < (カウント)> then\n            change [ｙ v] by (1)\n            set [カウント v] to [0]\n            change y by (2)\n        end\n    end\n    set [左回り角度 v] to (direction)\n    point in direction (((右回り角度) + ((左回り角度) mod (360))) / (2))\nend\nif <touching (_edge_ v)?> then\n    if <[60] < ([abs v] of ((direction) - (90)) )> then\n        point in direction (90)\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [スタート v]\nwait (0) seconds\ngo to (プレイヤー v)\npoint in direction (90)\nshow\nset [右回り角度 v] to [90]\nset [左回り角度 v] to [90]\nforever\n    if <([やられた v] of [プレイヤー v]) = [0]> then\n        set [ghost v] effect to (100)\n        傾き\n        go to [front v] layer\n    end\nend\n\n@トゲ\n\nwhen I receive [スタート v]\nwait (0) seconds\n配置\n\ndefine 配置\n\nif <(ステージ) = [1]> then\n    トゲ配置|座標 [150] , [80] 種類 [1] 周期 []\n    トゲ配置|座標 [225] , [-70] 種類 [1] 周期 []\nelse\n    if <(ステージ) = [2]> then\n        トゲ配置|座標 [120] , [-10] 種類 [1] 周期 []\n    else\n        if <(ステージ) = [3]> then\n            トゲ配置|座標 [200] , [-10] 種類 [1] 周期 []\n        else\n            if <(ステージ) = [7]> then\n                トゲ配置|座標 [-120] , [-170] 種類 [2] 周期 [1]\n                トゲ配置|座標 [-40] , [-170] 種類 [2] 周期 [2]\n                トゲ配置|座標 [0] , [-170] 種類 [2] 周期 [1]\n                トゲ配置|座標 [80] , [-170] 種類 [2] 周期 [2]\n                トゲ配置|座標 [120] , [-170] 種類 [2] 周期 [1]\n                トゲ配置|座標 [200] , [-170] 種類 [2] 周期 [2]\n            else\n                if <(ステージ) = [8]> then\n                    トゲ配置|座標 [175] , [-160] 種類 [1] 周期 []\n                else\n                    if <(ステージ) = [9]> then\n                        トゲ配置|座標 [220] , [-150] 種類 [1] 周期 []\n                        トゲ配置|座標 [220] , [-70] 種類 [1] 周期 []\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    forever\n        hide\n        set size to (20) %\n        wait until <<(y position) < ([y position v] of [プレイヤー v])> and <(distance to [プレイヤー v]) < [50]>>\n        show\n        repeat (2)\n            change size by (40)\n        end\n        wait until <not <<(y position) < ([y position v] of [プレイヤー v])> and <(distance to [プレイヤー v]) < [150]>>>\n        repeat (2)\n            change size by (-40)\n        end\n    end\nelse\n    if <(costume [number v]) = [2]> then\n        wait (0) seconds\n        forever\n            show\n            set size to ((85) + (([sin v] of ((timer) * ((360) * (周期))) ) * (65))) %\n        end\n    end\nend\n\ndefine トゲ配置|座標 (x) , (y) 種類 (種類) 周期 (周期)\ngo to x: (x) y: (y)\nswitch costume to (種類)\nset [周期 v] to (周期)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nwait (0) seconds\nforever\n    set [brightness v] effect to (-50)\n    go to [back v] layer\n    if <[20] < (size)> then\n        if <touching (プレイヤー影 v)?> then\n            broadcast (トゲ v)\n        end\n    end\nend\n\nwhen I receive [次のステージ v]\nwait (0) seconds\n配置\n\nwhen I receive [再配置 v]\n配置\n\n@光\n\nwhen flag clicked\nhide\n\nwhen I receive [スタート v]\ngo to [front v] layer\nforever\n    switch costume to (big v)\n    go to (プレイヤー v)\n    switch costume to ( v)\n    set size to (300) %\n    switch costume to (コスチューム1 v)\n    show\n    set [fisheye v] effect to ((([sin v] of ((timer) * (180)) ) * (2)) + ((ロウソク) - (90)))\n    set [ghost v] effect to (20)\nend\n\ndefine 光\nswitch costume to ( v)\nshow\nset pen color to (#d5e8f8)\npoint in direction ((timer) * (60))\nset rotation style [don't rotate v]\nrepeat (6)\n    repeat (10)\n        go to (プレイヤー v)\n        set pen (transparency v) to (99)\n        set [カウント v] to [0]\n        repeat until <<<touching (_edge_ v)?> and <[250] < ([abs v] of (x position) )>> or <<<touching (ステージ当たり判定 v)?> or <touching (トゲ v)?>> or <[10] < (カウント)>>>\n            change [カウント v] by (1)\n            set pen size to (20)\n            pen down\n            move (8) steps\n        end\n        move (4) steps\n        turn right (3) degrees\n        pen up\n    end\n    turn right (30) degrees\nend\nhide\n\nwhen I receive [スタート v]\nset [ロウソク v] to [100]\nforever\n    change [ロウソク v] by (-0.05)\n    if <(ロウソク) < [0]> then\n        set [カウント v] to [0]\n    end\n    if <[100] < (ロウソク)> then\n        set [ロウソク v] to [100]\n    end\n    if <((全ステ) - (1)) < (ステージ)> then\n        set [ロウソク v] to [200]\n    end\nend\n\n@こなーゆきー\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nset [ghost v] effect to (20)\nshow\ngo to [back v] layer\ngo to x: (150) y: (360)\nglide (4) secs to x: (0) y: (0)\ncreate clone of (_myself_ v)\nglide (4) secs to x: (-150) y: (-360)\ndelete this clone\n\nwhen I receive [スタート v]\nset [ghost v] effect to (20)\nshow\ngo to [back v] layer\ncreate clone of (_myself_ v)\ngo to x: (0) y: (0)\nglide (4) secs to x: (-150) y: (-360)\nhide\n\n@スプライト1\n\nwhen flag clicked\nhide\n\nwhen I receive [スタート v]\nforever\n    go to x: (180) y: (-150)\n    set [ghost v] effect to (10)\n    hide\n    if <(ステージ) < (全ステ)> then\n        show\n    end\n    go to [front v] layer\n    say []\n    if <[0] < (ステージスキップ:あと)> then\n        set [brightness v] effect to (10)\n    else\n        set [brightness v] effect to (-10)\n        if <touching (mouse-pointer v)?> then\n            say [ステージスキップ不可　（♥と★で解放）]\n        end\n    end\n    if <touching (プレイヤー v)?> then\n        set [ghost v] effect to (30)\n    end\nend\n\nwhen this sprite clicked\nif <[0] < (ステージスキップ:あと)> then\n    change [ステージスキップ:あと v] by (-1)\n    broadcast (ステージスキップ v)\n    wait until <not <mouse down?>>\nend\n\n@ハート星探知機\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (100)\nif <(costume [number v]) = [1]> then\n    forever\n        if <touching (mouse-pointer v)?> then\n            change [ハート v] by (1)\n            if <[5] < (ハート)> then\n                start sound [決定ボタンを押す v]\n                stop [this script v]\n            end\n        end\n    end\nend\nif <(costume [number v]) = [2]> then\n    forever\n        if <touching (mouse-pointer v)?> then\n            change [星 v] by (1)\n            if <[5] < (星)> then\n                start sound [決定ボタンを押す v]\n                stop [this script v]\n            end\n        end\n    end\nend\n\nwhen flag clicked\nset [ステージスキップ:あと v] to [0]\nhide\ngo to x: (0) y: (0)\nswitch costume to (ハート v)\ncreate clone of (_myself_ v)\nswitch costume to (星 v)\ncreate clone of (_myself_ v)\nwait until <[9] < ((星) + (ハート))>\nchange [ステージスキップ:あと v] by (3)\nbroadcast (ステージスキップ権 v)\n\nwhen [2 v] key pressed\nset [ハート v] to [0]\nset [星 v] to [0]\nif <(username) = [b-coffee]> then\n    set [☁ 最高記録 v] to [10000]\nend\n\n@骨井ジョイスティックB-\n\nwhen I start as a clone\nset rotation style [don't rotate v]\nset size to (50) %\nforever\n    set [ghost v] effect to (30)\n    switch costume to (骨井2 v)\n    if <(画面押されている？) = [1]> then\n        show\n        go to [front v] layer\n        go to (骨井ジョイスティックb- v)\n        point towards (mouse-pointer v)\n        if <(distance to [mouse-pointer v]) < [40]> then\n            move (distance to [mouse-pointer v]) steps\n        else\n            move (40) steps\n        end\n        set [ジョイスティックｘ v] to (((x position) - ([x position v] of [骨井ジョイスティックb- v])) / (30))\n        set [ジョイスティックｙ v] to (((y position) - ([y position v] of [骨井ジョイスティックb- v])) / (30))\n    else\n        set [ジョイスティックｘ v] to (<key (right arrow v) pressed?> - <key (left arrow v) pressed?>)\n        set [ジョイスティックｙ v] to (<key (up arrow v) pressed?> - <key (down arrow v) pressed?>)\n        hide\n    end\nend\n\nwhen flag clicked\nset size to (100) %\ncreate clone of (_myself_ v)\nforever\n    switch costume to (骨井 v)\n    set [ghost v] effect to (30)\n    if <mouse down?> then\n        go to (mouse-pointer v)\n        show\n        set [画面押されている？ v] to [1]\n        repeat until <not <mouse down?>>\n            go to [front v] layer\n        end\n    else\n        set [画面押されている？ v] to [0]\n        hide\n    end\nend\n\nwhen I receive [ゲームクリア v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\n