MATH // A Scrolling Platformer

Instructions: 数学(算数)を舞台にしたplatformerです！\n♥と★をよろしくお願いします!!!!!\nplease ♥ and ★!!!\n\n◣操作方法/How to play◢\n←→で移動/←→keys to move\n↑でジャンプ/↑key to jump\nモバイル対応！\nmobile friendly!\n\nクリアしたらコメントで教えてね！(裏クリも)\nネタバレは禁止！\n@lightblue012 さんが前に裏ゴールを作っていたので僕も真似して作ってみました！裏ゴール分かりやすい\nです！\n今回は前回のより短いかも!?\n@lightblue012さんと@TNTendさんに♥と★つけてもらえた！\nゲーム2ページ目！

@Stage\n\nwhen I receive [プログラム6 v]\nset [クリあ？ v] to [1]\nstop all sounds\nstart sound [win v]\n\nwhen I receive [ゲームok v]\nset [クリあ？ v] to [0]\nswitch backdrop to (game v)\nset volume to (60) %\n\nwhen I receive [ゲームok v]\nplay sound [Jim Yosef - Firefly pt v] until done\nif <(クリあ？) = [0]> then\n    play sound [Jim Yosef - Firefly pt v] until done\nend\nif <(クリあ？) = [0]> then\n    play sound [Jim Yosef - Firefly pt v] until done\nend\n\n@player\n\ndefine 位置補正y (向き) (回数)\nif <(Yv) = [0]> then\n    stop [this script v]\nend\nset [α v] to [0]\nrepeat until <<not <touching (stage v)?>> or <(α) = (回数)>>\n    change [α v] by (1)\n    change y by (向き)\nend\nchange y by (() - ((向き) * ((回数) * <<(α) = (回数)> and <touching (stage v)?>>)))\nset [yv v] to [0]\n\nwhen flag clicked\nshow\npoint in direction (90)\ngo to [front v] layer\ngo to x: (0) y: (-20)\nset [動作 v] to [1]\nset [xv v] to [0]\nset [yv v] to [0]\nset [x v] to [-20]\nset [y v] to [20]\nset [スクロールx v] to [-20]\nset [スクロールy v] to [20]\nset [復活x v] to [-20]\nset [復活y v] to [20]\nset [プログラム3　送った？ v] to [1]\nset [ステージ v] to [1]\nset [プログラム3　送った？ v] to [0]\n\nwhen I receive [プログラム1 v]\nshow\n動作\n\ndefine 動作\nset rotation style [left-right v]\nif <(動作) = [1]> then\n    switch costume to (player v)\n    change [yv v] by (-1.2)\n    if <<<key (right arrow v) pressed?> or <<mouse down?> and <(x position) < (mouse x)>>> or <key (d v) pressed?>> then\n        change [xv v] by (1.3)\n        point in direction (90)\n    end\n    if <<<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> or <key (a v) pressed?>> then\n        change [xv v] by (-1.3)\n        point in direction (-90)\n    end\n    set [xv v] to ((Xv) * (0.88))\n    change x by (Xv)\n    repeat (6)\n        if <touching (stage v)?> then\n            change y by (1)\n        end\n    end\n    if <touching (stage v)?> then\n        change y by (-6)\n        change x by ((0) - (Xv))\n        if <<<key (up arrow v) pressed?> or <<mouse down?> and <(y position) < (mouse y)>>> or <key (w v) pressed?>> then\n            set [xv v] to ((7) - (<[0] < (Xv)> * (14)))\n            set [yv v] to [12]\n        else\n            set [xv v] to [0]\n        end\n    end\n    if <[-20] < (Yv)> then\n        change y by (Yv)\n        if <touching (stage v)?> then\n            位置補正y ((0) - ((Yv) / ([abs v] of (Yv) ))) ([ceiling v] of ([abs v] of (Yv) ) )\n        end\n    else\n        change y by ((Yv) / (2))\n        if <touching (stage v)?> then\n            位置補正y ((0) - ((Yv) / ([abs v] of (Yv) ))) ([ceiling v] of ([abs v] of (Yv) ) )\n        end\n        change y by ((Yv) / (2))\n        if <touching (stage v)?> then\n            位置補正y ((0) - ((Yv) / ([abs v] of (Yv) ))) ([ceiling v] of ([abs v] of (Yv) ) )\n        end\n    end\n    if <<(Y) < [-400]> or <touching (stage5 v)?>> then\n        start sound [Bite v]\n        初期位置\n    end\n    change y by (-1)\n    if <<touching (stage v)?> and <<<key (up arrow v) pressed?> or <<mouse down?> and <(y position) < (mouse y)>>> or <key (w v) pressed?>>> then\n        set [yv v] to [16]\n    end\n    change y by (1)\n    if <touching (stage3 v)?> then\n        if <(プログラム3　送った？) = [0]> then\n            broadcast (プログラム3 v)\n            set [プログラム3　送った？ v] to [1]\n        end\n    end\n    if <touching (stage6 v)?> then\n        set [yv v] to [25]\n    end\n    処理\n    broadcast (プログラム2 v)\nend\n\ndefine 初期位置\ngo to x: (0) y: (-20)\nset [xv v] to [0]\nset [yv v] to [0]\nset [x v] to (復活X)\nset [y v] to (復活Y)\nset [スクロールx v] to (復活X)\nset [スクロールy v] to (復活Y)\n\ndefine 処理\nchange [x v] by ((x position) - ((X) - (スクロールX)))\nchange [y v] by ((y position) - (((Y) - (スクロールY)) - (20)))\nchange [スクロールx v] by ([floor v] of (((X) - (スクロールX)) * (0.1)) )\nchange [スクロールy v] by ([floor v] of (((Y) - (スクロールY)) * (0.3)) )\nset x to ((X) - (スクロールX))\nset y to (((Y) - (スクロールY)) - (20))\n\nwhen I receive [プログラム5 v]\nchange y by (Y　記憶　送信)\n\nwhen I receive [プログラム6 v]\nset [動作 v] to [0]\nhide\n\nwhen flag clicked\nhide\n\nset [スクロールy v] to [400]\n\n@stage\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\nwhen I receive [プログラム2 v]\nif <(costume [number v]) = [1]> then\n    broadcast (プログラム1 v)\nelse\n    移動 ((my x) - (スクロールX)) ((my y) - (スクロールY))\nend\n\ndefine 移動 (x) (y)\nswitch costume to (none v)\ngo to x: (x) y: (y)\nif <<(([abs v] of (x) ) - (0)) > ([abs v] of (x position) )> or <(([abs v] of (y) ) - (0)) > ([abs v] of (y position) )>> then\n    hide\nelse\n    show\nend\nswitch costume to (my n)\n\nwhen I start as a clone\nshow\n\nwhen I receive [プログラム6 v]\nhide\n\nwhen I receive [ゲームok v]\nhide\nステージ配置 [0] [0] [1]\nステージ配置 [480] [0] [2]\nステージ配置 [960] [0] [3]\nステージ配置 [1440] [0] [4]\nステージ配置 [1920] [0] [5]\nステージ配置 [2400] [0] [6]\nステージ配置 [2880] [0] [7]\nステージ配置 [3360] [0] [8]\nステージ配置 [3840] [0] [9]\nステージ配置 [4320] [0] [10]\nステージ配置 [4800] [0] [11]\nステージ配置 [5280] [0] [12]\nステージ配置 [5760] [0] [13]\nステージ配置 [5280] [360] [14]\nステージ配置 [5760] [720] [15]\nswitch costume to (none v)\nbroadcast (プログラム1 v)\n\nwhen flag clicked\nhide\n\n@stage2\n\nwhen flag clicked\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\nwhen I receive [プログラム2 v]\nif <(costume [number v]) = [1]> then\n\ndefine 移動 (x) (y)\nswitch costume to (none v)\ngo to x: (x) y: (y)\nif <<(([abs v] of (x) ) - (0)) > ([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 start as a clone\nshow\n\nbroadcast (プログラム1 v)\n\nwhen I receive [プログラム6 v]\nhide\n\nwhen I receive [ゲームok v]\nhide\nステージ配置 [-122] [-80] [1]\nswitch costume to (none v)\n\n@stage3\n\ndefine ステージ配置 (x座標) (y座標) (clone id) (ステージ番号)\nswitch costume to (none v)\nset [my x v] to (x座標)\nset [my y v] to (y座標)\nadd (x座標) to [checkpoints x v]\nadd (y座標) to [checkpoints y v]\nset [clone id v] to (clone id)\nswitch costume to ((ステージ番号) + (1))\ncreate clone of (_myself_ v)\n\nwhen I receive [プログラム2 v]\nif <(costume [number v]) = [1]> then\n\ndefine 移動 (x) (y)\nswitch costume to (none v)\ngo to x: (x) y: (y)\nif <<(([abs v] of (x) ) - (0)) > ([abs v] of (x position) )> or <([abs v] of (y) ) > ([abs v] of (y position) )>> then\n    hide\nelse\n    show\nend\nif <[4] > (clone ID)> then\n    if <(item (clone ID) of [ステージ　クリア状況 v]) = [1]> then\n        switch costume to (stage2 v)\n    else\n        switch costume to (stage1 v)\n    end\nelse\n    if <[5] > (clone ID)> then\n        switch costume to (stage3 v)\n    else\n        switch costume to (stage4 v)\n    end\nend\n\nwhen I start as a clone\nshow\n\nwhen I receive [プログラム3 v]\nif <<(costume [number v]) = [2]> and <<([abs v] of ((0) - (x position)) ) < [200]> and <([abs v] of ((0) - (y position)) ) < [200]>>> then\n    start sound [Collect v]\n    switch costume to (stage2 v)\n    if <(clone ID) > (ステージクリア状況)> then\n        set [復活x v] to (item (clone ID) of [checkpoints x v])\n        set [復活y v] to ((item (clone ID) of [checkpoints y v]) + (40))\n        set [ステージクリア状況 v] to (clone ID)\n    end\n    replace item (clone ID) of [ステージ　クリア状況 v] with [1]\n    set [パーティクル用　チェックポイントx v] to (x position)\n    set [パーティクル用　チェックポイントy v] to (y position)\n    set [プログラム3　送った？ v] to [0]\n    broadcast (プログラム4 v)\nelse\n    if <<(costume [number v]) = [4]> and <<([abs v] of ((0) - (x position)) ) < [200]> and <([abs v] of ((0) - (y position)) ) < [200]>>> then\n        set [プログラム3　送った？ v] to [0]\n        set [クリア裏か？ v] to [0]\n        broadcast (プログラム6 v)\n    else\n        if <<(costume [number v]) = [5]> and <<([abs v] of ((0) - (x position)) ) < [200]> and <([abs v] of ((0) - (y position)) ) < [200]>>> then\n            set [プログラム3　送った？ v] to [0]\n            set [クリア裏か？ v] to [1]\n            broadcast (プログラム6 v)\n        end\n    end\nend\nset [プログラム3　送った？ v] to [0]\n\nwhen I receive [プログラム6 v]\nhide\n\nwhen I receive [ゲームok v]\nset [ステージクリア状況 v] to [0]\nset [プログラム3　送った？ v] to [0]\nset [パーティクル用　チェックポイントx v] to [0]\nset [パーティクル用　チェックポイントy v] to [0]\ndelete all of [checkpoints x v]\ndelete all of [checkpoints y v]\ndelete all of [ステージ　クリア状況 v]\nrepeat (4)\n    add [0] to [ステージ　クリア状況 v]\nend\nset [2 v] to [0]\nhide\nステージ配置 [1402] [2] [1] [1]\nステージ配置 [2660] [280] [2] [1]\nステージ配置 [4475] [-12] [3] [1]\nステージ配置 [6020] [75] [4] [3]\nステージ配置 [5840] [555] [5] [4]\nswitch costume to (none v)\n\n@stage4\n\ndefine ステージ配置 (x座標) (y座標)\nswitch costume to (none v)\nset [my x v] to (x座標)\nset [my y v] to (y座標)\nswitch costume to (舞わーん v)\ncreate clone of (_myself_ v)\n\nwhen I receive [プログラム2 v]\nif <(costume [number v]) = [1]> then\n    broadcast (プログラム1 v)\nelse\n    移動 ((my x) - (スクロールX)) ((my y) - (スクロールY))\nend\n\ndefine 移動 (x) (y)\nswitch costume to (none v)\ngo to x: (x) y: (y)\nif <<(([abs v] of (x) ) - (0)) > ([abs v] of (x position) )> or <(([abs v] of (y) ) - (0)) > ([abs v] of (y position) )>> then\n    hide\nend\nswitch costume to (舞わーん v)\n\nwhen I start as a clone\nshow\n\nwhen I receive [プログラム4 v]\nif <(costume [number v]) = [1]> then\n\nwhen I receive [プログラム6 v]\nhide\n\nwhen I receive [ゲームok v]\nset size to (20) %\nhide\nステージ配置 [1402] [5]\nステージ配置 [2660] [283]\nステージ配置 [4475] [-9]\nswitch costume to (none v)\n\n@stage5\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\nwhen I receive [プログラム2 v]\nif <(costume [number v]) = [1]> then\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 start as a clone\nshow\n\nwhen I receive [プログラム6 v]\nhide\n\nwhen I receive [ゲームok v]\nset [1 v] to [0]\nhide\nステージ配置 [2400] [0] [1]\nステージ配置 [2880] [0] [2]\nステージ配置 [3360] [0] [3]\nステージ配置 [4800] [0] [4]\nステージ配置 [5280] [0] [5]\nswitch costume to (none v)\n\n@a\n\nwhen [1 v] key pressed\nif <(username) = [pokosuke0825]> then\n    set [スクロールx v] to [1300]\n    set [スクロールy v] to [200]\nend\n\nwhen [2 v] key pressed\nif <(username) = [pokosuke0825]> then\n    set [スクロールx v] to [2500]\n    set [スクロールy v] to [150]\nend\n\nwhen [3 v] key pressed\nif <(username) = [pokosuke0825]> then\n    set [スクロールx v] to [2871]\n    set [スクロールy v] to [20]\nend\n\nwhen [4 v] key pressed\nif <(username) = [pokosuke0825]> then\n    set [スクロールx v] to [4361]\n    set [スクロールy v] to [20]\nend\n\nwhen [5 v] key pressed\nif <(username) = [pokosuke0825]> then\n    set [スクロールx v] to [5200]\n    set [スクロールy v] to [20]\nend\n\nwhen [6 v] key pressed\nif <(username) = [pokosuke0825]> then\n    set [スクロールx v] to [5838]\n    set [スクロールy v] to [100]\nend\n\n@end\n\nwhen I receive [プログラム6 v]\nswitch costume to ((クリア裏か？) + (1))\ngo to [front v] layer\nshow\nrepeat (4)\n    change [ghost v] effect by (-25)\n    set x to (-10)\n    set y to (10)\n    wait (0.1) seconds\n    set x to (10)\n    set y to (-10)\n    wait (0.1) seconds\nend\nrepeat (3)\n    set x to (-10)\n    set y to (10)\n    wait (0.1) seconds\n    set x to (10)\n    set y to (-10)\n    wait (0.1) seconds\nend\n\nwhen flag clicked\nclear graphic effects\nset [ghost v] effect to (100)\nhide\n\nwhen flag clicked\nforever\n    change x by (((0) - (x position)) / (1.2))\n    change y by (((0) - (y position)) / (1.2))\nend\n\n@寒くね？\n\nwhen flag clicked\nset [ghost v] effect to (100)\nrepeat (10)\n    go to [front v] layer\nend\n\n@スプライト1\n\nwhen flag clicked\nreset timer\ngo to x: (0) y: (0)\nhide\nswitch costume to (コスチューム1 v)\ncreate clone of (_myself_ v)\nswitch costume to (icon v)\ncreate clone of (_myself_ v)\nwait until <not <(timer) < [1.154]>>\nswitch costume to (コスチューム2 v)\ncreate clone of (_myself_ v)\nswitch costume to (コスチューム11 v)\ncreate clone of (_myself_ v)\na\nswitch costume to (コスチューム12 v)\ncreate clone of (_myself_ v)\nwait until <not <(timer) < [1.8]>>\nb\nwait until <not <(timer) < [2]>>\nb\nwait until <not <(timer) < [2.4]>>\nb\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    show\n    switch costume to (bit v)\n    set size to (1000) %\n    switch costume to (icon v)\n    point in direction (-179)\n    set [ghost v] effect to (100)\n    set [pixelate v] effect to (100)\n    repeat (20)\n        change [ghost v] effect by (-5)\n        change [pixelate v] effect by (-5)\n        set size to ((((size) - (100)) * (0.8)) + (100)) %\n        point in direction ((((direction) - (90)) * (0.8)) + (90))\n    end\n    set [変数 v] to [-40]\n    repeat (40)\n        set size to ((((size) - (20)) * (0.9)) + (20)) %\n        turn right (3) degrees\n        change x by (変数)\n        change [変数 v] by (8)\n    end\n    delete this clone\nend\nif <(costume [number v]) = [2]> then\n    point in direction (90)\n    set size to (100) %\n    show\n    repeat (20)\n        switch costume to (bit v)\n        set size to ((((size) - (600)) * (0.8)) + (600)) %\n        switch costume to (コスチューム1 v)\n    end\n    wait until <not <(timer) < [1.5]>>\n    delete this clone\nend\nif <(costume [number v]) = [4]> then\n    go to x: (240) y: (0)\n    point in direction (90)\n    set size to (100) %\n    show\n    wait until <not <(timer) < [1.8]>>\n    set [fisheye v] effect to (1)\n    set [変数 v] to [10]\n    switch costume to (bit v)\n    set size to (1200) %\n    switch costume to (コスチューム2 v)\n    wait until <not <(timer) < [2]>>\n    set [fisheye v] effect to (1)\n    set [変数 v] to [10]\n    switch costume to (bit v)\n    set size to (1200) %\n    switch costume to (コスチューム2 v)\n    wait until <not <(timer) < [2.4]>>\n    set [fisheye v] effect to (1)\n    set [変数 v] to [10]\n    switch costume to (bit v)\n    set size to (1200) %\n    switch costume to (コスチューム2 v)\n    wait until <not <(timer) < [2.9]>>\n    stop [other scripts in sprite v]\n    go to x: (0) y: (0)\n    switch costume to (bit v)\n    repeat (20)\n        switch costume to (bit v)\n        set size to ((((size) - (9000)) * (0.8)) + (9000)) %\n        switch costume to (コスチューム15 v)\n    end\n    delete this clone\nend\nif <(costume [number v]) = [5]> then\n    set size to (100) %\n    show\n    repeat (6)\n        move (10) steps\n        next costume\n        wait (0) seconds\n    end\n    delete this clone\nend\nif <(costume [number v]) = [13]> then\n    point in direction (90)\n    set size to (120) %\n    set [fisheye v] effect to (3)\n    set [変数 v] to [10]\n    go to x: (0) y: (0)\n    show\n    wait until <not <(timer) < [1.8]>>\n    switch costume to (コスチューム13 v)\n    set size to (120) %\n    set [fisheye v] effect to (3)\n    set [変数 v] to [10]\n    wait until <not <(timer) < [2]>>\n    switch costume to (コスチューム14 v)\n    set size to (120) %\n    set [fisheye v] effect to (3)\n    set [変数 v] to [10]\n    wait until <not <(timer) < [2.4]>>\n    switch costume to (コスチューム12 v)\n    set size to (120) %\n    set [fisheye v] effect to (3)\n    set [変数 v] to [10]\n    wait until <not <(timer) < [2.9]>>\n    delete this clone\nend\nif <(costume [number v]) = [14]> then\n    go to x: (0) y: (0)\n    point in direction (90)\n    set size to (100) %\n    show\n    repeat (5)\n        change [ghost v] effect by (20)\n    end\n    delete this clone\nend\n\ndefine a\ngo to x: (240) y: (0)\npoint in direction (-30)\nswitch costume to (コスチューム3 v)\ncreate clone of (_myself_ v)\npoint in direction (-60)\nswitch costume to (コスチューム3 v)\ncreate clone of (_myself_ v)\npoint in direction (-90)\nswitch costume to (コスチューム3 v)\ncreate clone of (_myself_ v)\npoint in direction (-120)\nswitch costume to (コスチューム3 v)\ncreate clone of (_myself_ v)\npoint in direction (-150)\nswitch costume to (コスチューム3 v)\ncreate clone of (_myself_ v)\nswitch costume to (コスチューム11 v)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(costume [number v]) = [13]> then\n    forever\n        set size to ((((size) - (100)) * (0.9)) + (100)) %\n        set [変数 v] to ((変数) * (0.9))\n        set [fisheye v] effect to (変数)\n    end\nend\nif <(costume [number v]) = [4]> then\n    forever\n        switch costume to (bit v)\n        set size to ((((size) - (1000)) * (0.8)) + (1000)) %\n        switch costume to (コスチューム2 v)\n        set [変数 v] to ((変数) * (0.9))\n        set [fisheye v] effect to (変数)\n    end\nend\n\ndefine b\ngo to (random position v)\nswitch costume to (コスチューム3 v)\npoint in direction (90)\nrepeat (12)\n    create clone of (_myself_ v)\n    turn left (30) degrees\nend\nswitch costume to (コスチューム11 v)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nplay sound [TheFatRat - Solitude v] until done\nbroadcast (ゲームok v)\n\n@背景\n\nwhen I receive [ゲームok v]\ngo to [back v] layer\nshow\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\n@stage6\n\ndefine ステージ配置 (x座標) (y座標)\nswitch costume to (none v)\nset [my x v] to (x座標)\nset [my y v] to (y座標)\nswitch costume to (π\(ばね） v)\ncreate clone of (_myself_ v)\n\nwhen I receive [プログラム2 v]\nif <(costume [number v]) = [1]> then\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 (π\(ばね） v)\n\nwhen I start as a clone\nshow\n\nwhen I receive [プログラム6 v]\nhide\n\nwhen I receive [ゲームok v]\nset [1 v] to [0]\nhide\nステージ配置 [5050] [-45]\nステージ配置 [5350] [-45]\nステージ配置 [5500] [-45]\nswitch costume to (none v)\n\n