Sword Platformer/剣プラットフォーマー

Instructions: https://scratch.mit.edu/projects/946227514\n↑new work/新作\n日本語説明は下↓（見ないと損します）\n❑English\nhttps://scratch.mit.edu/projects/889230555\n↑Please advertise here.\nPress the flag twice.\nArrow keys, wad, tap to move\nSpace key or z key, tap to swing sword\nMight be difficult on mobile.\nTime was abolished because it was bug.\nThere is no concept of HP. One hit is the end of the game.\nIf you hit an enemy, a needle, or fall down, you die.\nEnemies can be defeated by cutting them with the sword or dropping them down. You cannot be killed by a needle.\nYou don't have to defeat the enemy to move on.\nPlease heart, star, follow and spread the word!!\n❑Memo\nFirst new work in a month.\nA work that attempts to introduce the enemy.\nThere is no New Year's element.\nWe look forward to working with you again this year.\n\n❑日本語\nhttps://scratch.mit.edu/projects/889230555\n↑宣伝はこちらでお願いします\n旗を二回押して下さい\n矢印キー、wad、タップで移動\nスペースキーかzキー、タップで剣を振る\nモバイルだと難しいかもしれません\nバグるのでタイムは廃止しました\nHPの概念はないです。一発当たったらおしまいです\n敵に当たるか針に当たるか下に落ちると死にます\n敵は剣で切ったり、下に落とすと倒せます。針で倒すことはできません\n敵は倒さなくても進めます\nハート、星、フォロー、拡散よろしくお願いします!!\n❑メモ\n・1ヶ月ぶりの新作\n・敵の導入を試みた作品\n・正月要素はない\n・今年もよろしくお願いします\n\n\n\n\n\n\n\n\n\n\n\n\n\n❑Challenge mission/チャレンジミッション\nTry clearing it unkillable.\n不殺でクリアしてみてね

@Stage\n\nwhen flag clicked\nswitch backdrop to (https___scratch v)\n\n@スプライト1\n\n@Player/プレイヤー\n\nwhen flag clicked\nset [ステージ v] to [1]\nforever\n    if <(x position) = [240]> then\n        change [ステージ v] by (1)\n        初期位置\n    end\nend\n\nwhen flag clicked\nforever\n    if <<touching (ground/地面 v)?> or <touching (extra v)?>> then\n        change y by (1)\n        if <<touching (ground/地面 v)?> or <touching (extra v)?>> then\n            change y by (1)\n            if <<touching (ground/地面 v)?> or <touching (extra v)?>> then\n                change y by (1)\n                if <<touching (ground/地面 v)?> or <touching (extra v)?>> then\n                    change y by (1)\n                    if <<touching (ground/地面 v)?> or <touching (extra v)?>> then\n                        change y by (1)\n                        if <<touching (ground/地面 v)?> or <touching (extra v)?>> then\n                            change y by (1)\n                            if <<touching (ground/地面 v)?> or <touching (extra v)?>> then\n                                change x by ((x) * (-1.2))\n                                change y by (-6)\n                                if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<(mouse y) > (y position)> and <mouse down?>>> then\n                                    if <(x) > [0]> then\n                                        set [x v] to [-6]\n                                    else\n                                        set [x v] to [6]\n                                    end\n                                    start sound [壁キック v]\n                                    set [y v] to [13]\n                                else\n                                    set [x v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (-1)\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<[0] < (mouse y)> and <mouse down?>>> then\n        if <<touching (ground/地面 v)?> or <touching (extra v)?>> then\n            start sound [Jump♪ Jump♪ v]\n            set [y v] to [13]\n        end\n    end\n    change y by (y)\n    change [y v] by (-1)\n    if <<touching (ground/地面 v)?> or <touching (extra v)?>> then\n        change y by ((y) * (-1))\n        set [y v] to [0]\n    end\nend\n\nwhen flag clicked\n初期位置\nforever\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<[0] < (mouse x)> and <mouse down?>>> then\n        change [x v] by (1)\n        point in direction (90)\n        switch costume to (コスチューム1 v)\n    end\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<(mouse x) < [0]> and <mouse down?>>> then\n        change [x v] by (-1)\n        point in direction (-90)\n        switch costume to (コスチューム2 v)\n    end\n    change x by (x)\n    set [x v] to ((x) * (0.9))\nend\n\ndefine 初期位置\nset rotation style [don't rotate v]\npoint in direction (90)\ngo to x: (-220) y: (-82)\nset size to (70) %\nswitch costume to (コスチューム1 v)\nset [x v] to [0]\nset [y v] to [0]\nhide variable [☁ 不殺でクリアした人 v]\nshow\nwait (0) seconds\nbroadcast (build v)\n\nwhen flag clicked\nforever\n    set [プレイヤーのx v] to (x position)\n    set [プレイヤーのy v] to (y position)\n    set [向き v] to (direction)\nend\n\nwhen flag clicked\nwait (0.4) seconds\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nwait (0.01) seconds\nrepeat (9)\n    change [ghost v] effect by (10)\n    change size by (-5)\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    if <key (r v) pressed?> then\n        start sound [〇んだときの音 v]\n        初期位置\n    end\n    if <touching (enemy/敵 v)?> then\n        start sound [〇んだときの音 v]\n        初期位置\n    end\n    if <touching (needle/針 v)?> then\n        start sound [〇んだときの音 v]\n        初期位置\n    end\n    if <(y position) = [-180]> then\n        start sound [〇んだときの音 v]\n        初期位置\n    end\nend\n\nwhen flag clicked\nforever\n    if <(ステージ) = [14]> then\n        change [☁ 不殺でクリアした人 v] by (1)\n        show variable [☁ 不殺でクリアした人 v]\n        stop [this script v]\n    end\nend\n\n@Ground/地面\n\nwhen flag clicked\nswitch costume to (コスチューム1 v)\ngo to x: (0) y: (0)\nshow\nforever\n    switch costume to (ステージ)\nend\n\n@Enemy/敵\n\nwhen I start as a clone\npoint in direction (90)\nshow\nset rotation style [all around v]\nset size to (75) %\nforever\n    if <(x position) < (プレイヤーのx)> then\n        change [敵のx v] by (0.8)\n        set rotation style [all around v]\n        point in direction (90)\n    else\n        change [敵のx v] by (-0.8)\n        set rotation style [left-right v]\n        point in direction (-90)\n    end\n    set [敵のx v] to ((敵のx) * (0.8))\n    change x by (敵のx)\n    if <touching (ground/地面 v)?> then\n        change x by ((敵のx) * (-1))\n        change y by (-1)\n        if <touching (ground/地面 v)?> then\n            set [敵のy v] to [14]\n        end\n        change y by (1)\n    end\n    change [敵のy v] by (-1)\n    change y by (敵のy)\n    if <touching (ground/地面 v)?> then\n        change y by ((敵のy) * (-1))\n        set [敵のy v] to [0]\n    end\nend\n\nwhen I receive [build v]\ndelete this clone\n\nwhen I receive [build v]\nif <(ステージ) = [2]> then\n    set [敵hp v] to [100]\n    詳細 [1] [210] [-70]\nend\nif <(ステージ) = [3]> then\n    set [敵hp v] to [100]\n    詳細 [1] [210] [-70]\nend\nif <(ステージ) = [4]> then\n    set [敵hp v] to [250]\n    詳細 [2] [213] [12]\nend\nif <(ステージ) = [5]> then\n    set [敵hp v] to [350]\n    詳細 [2] [213] [-72]\nend\nif <(ステージ) = [6]> then\n    set [敵hp v] to [450]\n    詳細 [3] [213] [-72]\nend\nif <(ステージ) = [7]> then\n    set [敵hp v] to [450]\n    詳細 [3] [215] [-16]\nend\nif <(ステージ) = [8]> then\n    set [敵hp v] to [250]\n    詳細 [2] [214] [-71]\nend\nif <(ステージ) = [9]> then\n    set [敵hp v] to [450]\n    詳細 [3] [214] [-71]\nend\nif <(ステージ) = [10]> then\n    set [敵hp v] to [450]\n    詳細 [3] [213] [134]\nend\nif <(ステージ) = [11]> then\n    set [敵hp v] to [100]\n    詳細 [1] [211] [162]\nend\nif <(ステージ) = [12]> then\n    set [敵hp v] to [250]\n    詳細 [2] [211] [150]\nend\nif <(ステージ) = [13]> then\n    hide\n    delete this clone\nend\n\nwhen flag clicked\nhide\nhide variable [敵を倒した数 v]\nset [敵のx v] to [0]\nset [敵のy v] to [0]\nset [敵を倒した数 v] to [0]\n\nwhen I start as a clone\nforever\n    if <<not <([costume # v] of [sword/剣 v]) = [1]>> and <touching (sword/剣 v)?>> then\n        change [敵hp v] by (-10)\n        if <(敵HP) < [1]> then\n            change [敵を倒した数 v] by (1)\n            start sound [やられた音 v]\n            delete this clone\n        end\n    end\n    if <(costume [number v]) = [3]> then\n        if <(y position) = [-184]> then\n            change [敵を倒した数 v] by (1)\n            start sound [やられた音 v]\n            delete this clone\n        end\n    else\n        if <(y position) = [-181]> then\n            change [敵を倒した数 v] by (1)\n            start sound [やられた音 v]\n            delete this clone\n        end\n    end\nend\n\ndefine 詳細 (型) (x) (y)\ngo to x: (x) y: (y)\nswitch costume to (型)\ncreate clone of (_myself_ v)\n\n@Music/音楽\n\nwhen flag clicked\nshow\ngo to x: (-196) y: (153)\nswitch costume to (button3-a \(1\) v)\nset volume to (100) %\nforever\n    play sound [Solar Man Stage v] until done\nend\n\nwhen this sprite clicked\nnext costume\n\nwhen flag clicked\nforever\n    if <(ステージ) = [2]> then\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [1]> then\n        set volume to (100) %\n    end\n    if <(costume [number v]) = [2]> then\n        set volume to (0) %\n    end\nend\n\n@Sword/剣\n\nwhen flag clicked\nforever\n    装填\nend\n\ndefine 装填\ngo to (player/プレイヤー v)\nset size to (100) %\nset rotation style [left-right v]\npoint in direction ([direction v] of [player/プレイヤー v])\nmove (20) steps\n\nwhen flag clicked\nshow\nforever\n    if <<<key (space v) pressed?> or <key (z v) pressed?>> or <mouse down?>> then\n        start sound [srash v]\n        switch costume to (真ん中 v)\n        wait (0) seconds\n        switch costume to (下 v)\n        wait (0) seconds\n        switch costume to (デフォルト v)\n    end\nend\n\n@Needle/針\n\nwhen flag clicked\nhide\ngo to x: (87) y: (-68)\nswitch costume to (針 v)\nforever\n    if <(ステージ) = [3]> then\n        show\n    end\n    if <(ステージ) = [4]> then\n        hide\n    end\n    if <(ステージ) = [8]> then\n        switch costume to (針2 v)\n        go to x: (40) y: (-68)\n        show\n    end\n    if <(ステージ) = [9]> then\n        switch costume to (針3 v)\n        go to x: (22) y: (-65)\n        show\n    end\n    if <(ステージ) = [10]> then\n        hide\n    end\nend\n\n@ＴＵＲＢＯ ＯＮ\n\nwhen flag clicked\nforever\n    wait (0.5) seconds\n    set [ターボ v] to [0]\nend\n\nwhen flag clicked\nreset timer\nswitch costume to (コスチューム1 v)\nset [ターボ v] to [0]\nset [ghost v] effect to (100)\nforever\n    switch costume to (コスチューム1 v)\n    go to [front v] layer\n    set size to (100) %\n    change [ターボ v] by (1)\n    wait () seconds\nend\n\nwhen flag clicked\nforever\n    if <[25] < (ターボ)> then\n        broadcast (a v)\n        stop [all v]\n    end\nend\n\n@Sentence/文章\n\nwhen flag clicked\ngo to x: (-78) y: (148)\nset size to (80) %\nswitch costume to (コスチューム1 v)\ngo to [front v] layer\nshow\nforever\n    if <(ステージ) = [1]> then\n        go to x: (-78) y: (148)\n        switch costume to (コスチューム1 v)\n    end\n    if <(ステージ) = [2]> then\n        go to x: (-97) y: (133)\n        switch costume to (コスチューム2 v)\n    end\n    if <(ステージ) = [3]> then\n        go to x: (-80) y: (-11)\n        switch costume to (コスチューム3 v)\n    end\n    if <(ステージ) = [4]> then\n        go to x: (-77) y: (144)\n        switch costume to (コスチューム4 v)\n    end\n    if <(ステージ) = [5]> then\n        go to x: (-26) y: (-120)\n        switch costume to (コスチューム5 v)\n    end\n    if <(ステージ) = [6]> then\n        go to x: (-164) y: (155)\n        switch costume to (コスチューム6 v)\n    end\n    if <(ステージ) = [7]> then\n        go to x: (-108) y: (158)\n        switch costume to (コスチューム7 v)\n    end\n    if <(ステージ) = [8]> then\n        go to x: (-192) y: (157)\n        switch costume to (コスチューム8 v)\n    end\n    if <(ステージ) = [9]> then\n        go to x: (-147) y: (153)\n        switch costume to (コスチューム9 v)\n    end\n    if <(ステージ) = [10]> then\n        go to x: (-119) y: (148)\n        switch costume to (コスチューム10 v)\n    end\n    if <(ステージ) = [11]> then\n        go to x: (-115) y: (0)\n        switch costume to (コスチューム11 v)\n    end\n    if <(ステージ) = [12]> then\n        go to x: (-198) y: (149)\n        switch costume to (コスチューム12 v)\n    end\n    if <(ステージ) = [13]> then\n        go to [back v] layer\n        go to x: (-7) y: (98)\n        switch costume to (コスチューム13 v)\n    end\n    if <(ステージ) = [14]> then\n        go to x: (-7) y: (118)\n        switch costume to (コスチューム14 v)\n    end\nend\n\n@Hidden passage/隠し通路\n\nwhen flag clicked\ngo to x: (36) y: (28)\nset [ghost v] effect to (0)\nhide\nforever\n    if <(ステージ) = [11]> then\n        show\n        go to [front v] layer\n    end\n    if <(ステージ) = [12]> then\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(ステージ) = [11]> and <touching (player/プレイヤー v)?>> then\n        set [ghost v] effect to (40)\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\n@Extra\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    if <(ステージ) = [13]> then\n        show\n        if <(敵を倒した数) = [0]> then\n            glide (1) secs to x: (0) y: (300)\n        end\n    else\n        hide\n    end\nend\n\n@Thumbnail/サムネ\n\nwhen flag clicked\nstop all sounds\nshow\nhide\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.0001)\nset [あ v] to [-25]\ngo to [front v] layer\nshow\ngo to x: (0) y: (287)\nrepeat (10)\n    change y by (あ)\n    change [あ v] by (1.5)\nend\nrepeat (20)\n    change y by (あ)\n    change [あ v] by (0.5)\nend\n\n@Star heart follow/星ハートフォロー\n\nwhen flag clicked\nhide\nforever\n    wait (pick random (2.5) to (5)) seconds\n    show\n    go to [front v] layer\n    start sound [ポップ v]\n    wait (5) seconds\n    hide\nend\n\n