Climb to the Rhythm!   #games #platformer #music
@Stage\n\nwhen I receive [music v]\nstop all sounds\nset volume to (100) %\nstart sound [pictogram 2 v]\n\nwhen I receive [music v]\nreset timer\nif <(mode) = [1]> then\n    broadcast (Check v)\n    forever\n        wait until <<[flags v] contains ([floor v] of ((timer) * (2)) )?> and <not <([floor v] of ((timer) * (2)) ) = (Time)>>>\n        broadcast (Check v)\n        set [time v] to ([floor v] of ((timer) * (2)) )\n    end\nend\n\nwhen I receive [game over v]\nstop [other scripts in sprite v]\nrepeat (20)\n    change volume by (-5)\nend\n\nwhen flag clicked\nset volume to (100) %\nstart sound [pictogram 1 v]\n\nwhen I receive [play v]\nrepeat (20)\n    change volume by (-5)\nend\n\n@block\n\ndefine 描画\nerase all\nif <((0.5) - (((y) / (30)) mod (1))) < [0.02]> then\n    broadcast (Revision v)\nend\nset [k v] to ((round ((x) / (30))) + ((Max. of x) * (round ((y) / (30)))))\nset y to ((-165) - ((y) - ((round ((y) / (30))) * (30))))\nrepeat (12)\n    set x to ((-225) - ((x) - ((round ((x) / (30))) * (30))))\n    repeat (16)\n        change [k v] by (1)\n        if <(item (k) of [stage v]) > [0]> then\n            if <<(item (k) of [stage v]) = [1]> and <(item ((k) + (Max. of x)) of [stage v]) = [1]>> then\n                switch costume to (1a v)\n            else\n                if <<(item (k) of [stage v]) = [2]> and <(item ((k) + (Max. of x)) of [stage v]) = [2]>> then\n                    switch costume to (2a v)\n                else\n                    if <<(item (k) of [stage v]) = [6]> and <not <(item ((k) + (Max. of x)) of [stage v]) = [0]>>> then\n                        if <(item ((k) - (1)) of [stage v]) = [0]> then\n                            switch costume to (6a v)\n                        else\n                            if <(item ((k) + (1)) of [stage v]) = [0]> then\n                                switch costume to (6b v)\n                            else\n                                switch costume to (6c v)\n                            end\n                        end\n                    else\n                        if <(item (k) of [stage v]) = [7]> then\n                            switch costume to (7a v)\n                        else\n                            if <<(item (k) of [stage v]) = [x]> and <not <(flags) = [50]>>> then\n                                switch costume to (7a v)\n                            else\n                                switch costume to (item (k) of [stage v])\n                            end\n                        end\n                    end\n                end\n            end\n            stamp\n        end\n        change x by (30)\n    end\n    change [k v] by ((Max. of x) - (16))\n    change y by (30)\nend\n\ndefine データ処理\nset [work 1 v] to [1]\nset [max. of x v] to []\nrepeat until <(letter (work 1) of (code)) = [_]>\n    set [max. of x v] to (join (Max. of x) (letter (work 1) of (code)))\n    change [work 1 v] by (1)\nend\nchange [work 1 v] by (1)\ndelete all of [respawn v]\nrepeat (4)\n    set [work 2 v] to []\n    repeat until <(letter (work 1) of (code)) = [_]>\n        set [work 2 v] to (join (work 2) (letter (work 1) of (code)))\n        change [work 1 v] by (1)\n    end\n    add (work 2) to [respawn v]\n    change [work 1 v] by (1)\nend\ndelete all of [stage v]\nrepeat ((((length of (code)) - (work 1)) + (1)) / (2))\n    repeat ((letter ((work 1) + (1)) of (code)) + (1))\n        add (letter (work 1) of (code)) to [stage v]\n    end\n    change [work 1 v] by (2)\nend\n\nwhen I receive [prepare v]\nset [code v] to (item (1) of [displaying v])\nデータ処理\nbroadcast (Play v)\nforever\n    描画\nend\n\nwhen flag clicked\nhide variable [x v]\nhide variable [y v]\nhide variable [max. of x v]\nshow list [displaying v]\nerase all\n\nwhen I receive [process v]\n描画\n\nadd (code) to [displaying v]\n\n@player\n\ndefine 移動\nif <mouse down?> then\n    if <(x position) > (mouse x)> then\n        change [x' v] by (-1)\n        point in direction (-90)\n    else\n        change [x' v] by (1)\n        point in direction (90)\n    end\nend\nif <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n    change [x' v] by (-1)\n    point in direction (-90)\nend\nif <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n    change [x' v] by (1)\n    point in direction (90)\nend\nif <([abs v] of (x') ) > [17]> then\n    set [x' v] to ((17) * ((x') / ([abs v] of (x') )))\nend\nchange y by (-1)\nif <touching color (#ff00c9)?> then\n    if <(x') < [0]> then\n        set [x' v] to (((x') + (1)) / (1.07))\n    else\n        change [x' v] by (0.5)\n    end\nelse\n    if <touching color (#ff00e2)?> then\n        if <(x') > [0]> then\n            set [x' v] to (((x') - (1)) / (1.07))\n        else\n            change [x' v] by (-0.5)\n        end\n    else\n        if <not <touching color (#00ffff)?>> then\n            if <([abs v] of (x') ) > [2]> then\n                set [x' v] to ((x') * (0.91))\n            else\n                set [x' v] to ((x') * (0.6))\n            end\n        end\n    end\nend\nif <<<<touching color (#e58900)?> or <touching color (#00ff1b)?>> or <touching color (#00ffff)?>> or <<touching color (#ff00c9)?> or <touching color (#ff00e2)?>>> then\n    if <<<mouse down?> and <(y position) < (mouse y)>> or <<key (w v) pressed?> or <key (up arrow v) pressed?>>> then\n        set [y' v] to [15]\n    end\nend\nchange y by (1)\nchange x by (x')\n位置調整 [1]\nif <(作業1) = [20]> then\n    change x by ((x') * (-1))\n    if <<<mouse down?> and <(y position) < (mouse y)>> or <<key (w v) pressed?> or <key (up arrow v) pressed?>>> then\n        if <(x') > [0]> then\n            set [x' v] to [-8]\n        else\n            set [x' v] to [8]\n        end\n        set [y' v] to [10]\n    else\n        set [x' v] to [0]\n    end\nend\nif <(y') > [-20]> then\n    change [y' v] by (-1)\nend\nchange y by (y')\nif <<<<touching color (#e58900)?> or <touching color (#00ff1b)?>> or <touching color (#00ffff)?>> or <<touching color (#ff00c9)?> or <touching color (#ff00e2)?>>> then\n    change y by ((y') * (-1))\n    set [y' v] to [0]\n    位置調整 [-1]\nend\nif <<(y position) < [-170]> or <<<touching color (#ff0000)?> or <touching color (#e50000)?>> or <<touching color (#999999)?> or <touching color (#666666)?>>>> then\n    go to x: (item (3) of [respawn v]) y: (item (4) of [respawn v])\n    set [x v] to (item (1) of [respawn v])\n    set [y v] to (item (2) of [respawn v])\n    set [x' v] to [0]\n    set [y' v] to [0]\nend\nif <touching color (#001aff)?> then\n    set [y' v] to [20]\nend\nif <(y') > [0]> then\n    判定 (((x) + (x position)) + (255)) (((y) + (y position)) + (165)) [789] [7] [7b] [20]\n    if <(作業1) = [1]> then\n        change y by ((y') * (-1))\n        set [y' v] to [0]\n    end\nend\nif <touching color (#83ff00)?> then\n    if <(flags) = [0]> then\n        broadcast (Music v)\n    end\n    if <(mode) = [2]> then\n        判定 (((x) + (x position)) + (255)) (((y) + (y position)) + (165)) [123456789] [5] [5a] [15]\n        if <(作業1) = [1]> then\n            delete all of [respawn v]\n            add (x) to [respawn v]\n            add (y) to [respawn v]\n            add (x position) to [respawn v]\n            add (y position) to [respawn v]\n            change [flags v] by (1)\n        end\n    end\nend\n\nwhen I receive [play v]\ngo to x: (item (3) of [respawn v]) y: (item (4) of [respawn v])\npoint in direction (90)\nset rotation style [left-right v]\ngo to [front v] layer\nset size to (160) %\nshow\nset [flags v] to [0]\nset [x v] to (item (1) of [respawn v])\nset [y v] to (item (2) of [respawn v])\nset [x' v] to [0]\nset [y' v] to [0]\nforever\n    移動\n    カメラ移動\nend\n\ndefine カメラ移動\nif <(x) < ((0) - ((x position) / (2)))> then\n    if <([abs v] of (x position) ) > [2]> then\n        set [x v] to [0]\n    end\nelse\n    if <((((Max. of x) - (16)) * (30)) - ((x position) / (2))) < (x)> then\n        set [x v] to (((Max. of x) - (16)) * (30))\n    else\n        change [x v] by ((x position) / (2))\n        set x to ((x position) / (2))\n    end\nend\nif <(y) < ((0) - ((y position) / (2)))> then\n    set [y v] to [0]\nelse\n    if <([abs v] of (y position) ) > [2]> then\n        change [y v] by ((y position) / (2))\n        set y to ((y position) / (2))\n    end\nend\n\ndefine 位置調整 (y)\nset [作業1 v] to [0]\nrepeat until <<not <<<<touching color (#e58900)?> or <touching color (#00ff1b)?>> or <touching color (#00ffff)?>> or <<touching color (#ff00c9)?> or <touching color (#ff00e2)?>>>> or <(作業1) = [20]>>\n    change [作業1 v] by (1)\n    change y by (y)\nend\nif <(作業1) = [20]> then\n    change y by ((-20) * (y))\nend\n\nwhen I receive [revision v]\nif <(y') < [3]> then\n    change [y v] by (2)\n    change y by (-2)\nend\n\ndefine 判定 (x) (y) (場所) (検索) (変更) (距離)\nset [作業1 v] to [0]\nif < (場所) contains [1]?> then\n    if <(item ((round (((x) - (距離)) / (30))) + ((Max. of x) * (round (((y) - (距離)) / (30))))) of [stage v]) = (検索)> then\n        replace item ((round (((x) - (距離)) / (30))) + ((Max. of x) * (round (((y) - (距離)) / (30))))) of [stage v] with (変更)\n        set [作業1 v] to [1]\n    end\nend\nif < (場所) contains [2]?> then\n    if <(item ((round ((x) / (30))) + ((Max. of x) * (round (((y) - (距離)) / (30))))) of [stage v]) = (検索)> then\n        replace item ((round ((x) / (30))) + ((Max. of x) * (round (((y) - (距離)) / (30))))) of [stage v] with (変更)\n        set [作業1 v] to [1]\n    end\nend\nif < (場所) contains [3]?> then\n    if <(item ((round (((x) + (距離)) / (30))) + ((Max. of x) * (round (((y) - (距離)) / (30))))) of [stage v]) = (検索)> then\n        replace item ((round (((x) + (距離)) / (30))) + ((Max. of x) * (round (((y) - (距離)) / (30))))) of [stage v] with (変更)\n        set [作業1 v] to [1]\n    end\nend\nif < (場所) contains [4]?> then\n    if <(item ((round (((x) - (距離)) / (30))) + ((Max. of x) * (round ((y) / (30))))) of [stage v]) = (検索)> then\n        replace item ((round (((x) - (距離)) / (30))) + ((Max. of x) * (round ((y) / (30))))) of [stage v] with (変更)\n        set [作業1 v] to [1]\n    end\nend\nif < (場所) contains [5]?> then\n    if <(item ((round ((x) / (30))) + ((Max. of x) * (round ((y) / (30))))) of [stage v]) = (検索)> then\n        replace item ((round ((x) / (30))) + ((Max. of x) * (round ((y) / (30))))) of [stage v] with (変更)\n        set [作業1 v] to [1]\n    end\nend\nif < (場所) contains [6]?> then\n    if <(item ((round (((x) + (距離)) / (30))) + ((Max. of x) * (round ((y) / (30))))) of [stage v]) = (検索)> then\n        replace item ((round (((x) + (距離)) / (30))) + ((Max. of x) * (round ((y) / (30))))) of [stage v] with (変更)\n        set [作業1 v] to [1]\n    end\nend\nif < (場所) contains [7]?> then\n    if <(item ((round (((x) - (距離)) / (30))) + ((Max. of x) * (round (((y) + (距離)) / (30))))) of [stage v]) = (検索)> then\n        replace item ((round (((x) - (距離)) / (30))) + ((Max. of x) * (round (((y) + (距離)) / (30))))) of [stage v] with (変更)\n        set [作業1 v] to [1]\n    end\nend\nif < (場所) contains [8]?> then\n    if <(item ((round ((x) / (30))) + ((Max. of x) * (round (((y) + (距離)) / (30))))) of [stage v]) = (検索)> then\n        replace item ((round ((x) / (30))) + ((Max. of x) * (round (((y) + (距離)) / (30))))) of [stage v] with (変更)\n        set [作業1 v] to [1]\n    end\nend\nif < (場所) contains [9]?> then\n    if <(item ((round (((x) + (距離)) / (30))) + ((Max. of x) * (round (((y) + (距離)) / (30))))) of [stage v]) = (検索)> then\n        replace item ((round (((x) + (距離)) / (30))) + ((Max. of x) * (round (((y) + (距離)) / (30))))) of [stage v] with (変更)\n        set [作業1 v] to [1]\n    end\nend\n\nwhen I receive [prepare v]\ngo to x: (item (1) of [respawn v]) y: (item (2) of [respawn v])\ndelete (1) of [respawn v]\ndelete (1) of [respawn v]\n\nwhen I receive [check v]\nif <touching color (#83ff00)?> then\n    判定 (((x) + (x position)) + (255)) (((y) + (y position)) + (165)) [123456789] [5] [5a] [15]\n    if <(作業1) = [1]> then\n        delete all of [respawn v]\n        add (x) to [respawn v]\n        add (y) to [respawn v]\n        add (x position) to [respawn v]\n        add (y position) to [respawn v]\n        change [flags v] by (1)\n        if <(flags) = [50]> then\n            say [おめでとう！あなたはこのコースを制覇しました！/Congratulations! You have conquered this course! ]\n        end\n    end\nelse\n    stop [other scripts in sprite v]\n    broadcast (Game Over v)\nend\n\nwhen flag clicked\nhide\n\n@message\n\nwhen flag clicked\nset [flags v] to [0]\nswitch costume to (cloud  v)\ngo to x: (0) y: (0)\nset [brightness v] effect to (100)\nset [ghost v] effect to (100)\nset size to (250) %\nshow\nrepeat (25)\n    change [ghost v] effect by (-4)\n    change size by (((70) - (size)) * (0.15))\nend\nwait (0.5) seconds\nrepeat (25)\n    change [brightness v] effect by (-4)\n    change size by (((100) - (size)) * (0.15))\nend\nset size to (100) %\nwait (0.5) seconds\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nset size to (100) %\nswitch costume to (click v)\ngo to x: (0) y: (-180)\nclear graphic effects\nshow\nrepeat (5)\n    change y by (4)\nend\nrepeat until <not <<mouse down?> or <key (any v) pressed?>>>\nrepeat until <<mouse down?> or <key (any v) pressed?>>\nif <(flags) = [0]> then\n    broadcast (explain v)\nelse\n    broadcast (Prepare v)\nend\n\nwhen I receive [prepare v]\ndelete this clone\n\nwhen I receive [game over v]\ngo to x: (0) y: (100)\nswitch costume to (game over v)\nset size to (200) %\nset [ghost v] effect to (100)\nshow\ngo to [front v] layer\nrepeat (20)\n    change size by (((size) - (100)) * (-0.2))\n    change [ghost v] effect by (-5)\n    change y by ((y position) * (-0.2))\nend\ncreate clone of (_myself_ v)\n\nwhen I receive [play v]\ngo to x: (-190) y: (140)\nset size to (35) %\nset [ghost v] effect to (100)\nswitch costume to (cloud  v)\nshow\nrepeat (16)\n    change [ghost v] effect by (-5)\nend\n\nwhen I receive [explain v]\nhide\ndelete this clone\n\n@number\n\nwhen I start as a clone\ngo to [front v] layer\nforever\n    最大の桁数… [2] の数字 (flags) の (Clone number) 番目を描画\nend\n\ndefine 最大の桁数… (桁) の数字 (数字) の (番目) 番目を描画\nif <(length of (数字)) > ((桁) - (番目))> then\n    show\n    switch costume to (letter ((番目) - ((桁) - (length of (数字)))) of (数字))\nelse\n    hide\nend\n\nwhen I receive [play v]\nswitch costume to (1 v)\nset size to (60) %\nhide\ngo to x: (180) y: (140)\nset [clone number v] to [0]\ngo to [front v] layer\nrepeat (2)\n    change [clone number v] by (1)\n    create clone of (_myself_ v)\n    change x by (30)\nend\ngo to x: (0) y: (0)\nset size to (100) %\nswitch costume to (black point v)\nshow\n\nwhen flag clicked\nhide\n\nwhen I receive [play v]\ndelete this clone\n\n@thumbnail\n\nwhen flag clicked\nswitch costume to (platform2 v)\nset [ghost v] effect to (100)\nset size to (100) %\nswitch costume to (platform v)\nshow\nforever\n    go to [front v] layer\nend\n\n@Image\n\nwhen flag clicked\ngo to x: (0) y: (60)\nset size to (60) %\nhide\n\nwhen I receive [explain v]\nwait (1) seconds\nswitch costume to (1 v)\nset [brightness v] effect to (100)\nshow\nrepeat (4)\n    repeat (10)\n        change [brightness v] effect by (-10)\n    end\n    repeat until <not <<mouse down?> or <key (any v) pressed?>>>\n    repeat until <<mouse down?> or <key (any v) pressed?>>\n    broadcast (next v)\n    repeat (10)\n        change [brightness v] effect by (10)\n    end\n    next costume\nend\nhide\nbroadcast (Select v)\n\n@Blue\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [explain v]\nswitch costume to (2 v)\nset [ghost v] effect to (100)\ngo to [back v] layer\nswitch costume to (1 v)\nshow\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\n\nwhen I receive [prepare v]\nhide\n\nwhen I receive [next v]\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nnext costume\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\n@Button3\n\nwhen flag clicked\nset [mode v] to [0]\nhide\n\nwhen I receive [select v]\nswitch costume to (challenge mode v)\nset size to (200) %\ngo to x: (0) y: (0)\nrepeat (2)\n    create clone of (_myself_ v)\n    change y by (-100)\n    next costume\nend\n\nwhen I start as a clone\nshow\n\nwhen this sprite clicked\nif <(mode) = [0]> then\n    set [mode v] to (costume [number v])\n    broadcast (Prepare v)\nend\n\nwhen I receive [prepare v]\ndelete this clone\n\nwhen I receive [play v]\nif <(mode) = [2]> then\n    go to x: (-80) y: (140)\n    set size to (120) %\n    set [ghost v] effect to (100)\n    switch costume to (trial mode v)\n    show\n    repeat (16)\n        change [ghost v] effect by (-5)\n    end\nend\n\n