Mountain　Platformer
@Stage\n\nwhen I receive [start v]\nswitch backdrop to (背景1 v)\nwait (0.1) seconds\nforever\n    play sound [NCS BGM v] until done\nend\n\nwhen flag clicked\nswitch backdrop to (背景2 v)\n\n@スプライト4\n\n@スプライト1\n\nwhen flag clicked\nhide\n\nwhen I receive [ステージ切り替え完了 v]\nset [ｘ v] to [0]\nset [ｙ v] to [0]\ngo to x: (-205) y: (40)\npoint in direction (90)\n\nwhen I receive [start v]\nset rotation style [left-right v]\npoint in direction (90)\nset size to (100) %\nshow\ngo to x: (-205) y: (40)\nset [ｘ v] to [0]\nset [ｙ v] to [0]\nset rotation style [left-right v]\nforever\n    if <<key (left arrow v) pressed?> or <<(mouse x) < (x position)> and <mouse down?>>> then\n        change [ｘ v] by (-1)\n        point in direction (-90)\n    end\n    if <<key (right arrow v) pressed?> or <<(x position) < (mouse x)> and <mouse down?>>> then\n        change [ｘ v] by (1)\n        point in direction (90)\n    end\n    set [ｘ v] to ((ｘ) * (0.9))\n    change x by (ｘ)\n    if <<touching color (#6d3900)?> or <<touching color (#009212)?> or <touching color (#00c217)?>>> then\n        change y by (1)\n        if <<touching color (#6d3900)?> or <<touching color (#009212)?> or <touching color (#00c217)?>>> then\n            change y by (1)\n            if <<touching color (#6d3900)?> or <<touching color (#009212)?> or <touching color (#00c217)?>>> then\n                change y by (1)\n                if <<touching color (#6d3900)?> or <<touching color (#009212)?> or <touching color (#00c217)?>>> then\n                    change y by (1)\n                    if <<touching color (#6d3900)?> or <<touching color (#009212)?> or <touching color (#00c217)?>>> then\n                        change y by (1)\n                        if <<touching color (#6d3900)?> or <<touching color (#009212)?> or <touching color (#00c217)?>>> then\n                            change x by ((ｘ) * (-1))\n                            change y by (-5)\n                            if <<key (up arrow v) pressed?> or <<[-45] < (mouse y)> and <mouse down?>>> then\n                                if <(ｘ) > [0]> then\n                                    set [ｘ v] to [-9]\n                                else\n                                    set [ｘ v] to [9]\n                                end\n                                set [ｙ v] to [15]\n                            else\n                                set [ｘ v] to [0]\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 <<[-45] < (mouse y)> and <mouse down?>>> then\n        if <<touching color (#6d3900)?> or <<touching color (#009212)?> or <touching color (#00c217)?>>> then\n            set [ｙ v] to [15]\n        end\n    end\n    change y by (ｙ)\n    change [ｙ v] by (-1)\n    if <<touching color (#6d3900)?> or <<touching color (#009212)?> or <touching color (#00c217)?>>> then\n        change y by ((ｙ) * (-1))\n        set [ｙ v] to [0]\n    end\n    if <<touching color (#ff6666)?> or <touching color (#ff0000)?>> then\n        set rotation style [all around v]\n        if <[90] = (direction)> then\n            repeat (10)\n                turn left (3) degrees\n                change [ghost v] effect by (5)\n            end\n            set rotation style [left-right v]\n            go to x: (-205) y: (40)\n            point in direction (90)\n            set [ghost v] effect to (0)\n        else\n            switch costume to (コスチューム2 v)\n            repeat (10)\n                turn right (3) degrees\n                change [ghost v] effect by (5)\n            end\n            switch costume to (コスチューム1 v)\n            set rotation style [left-right v]\n            go to x: (-205) y: (40)\n            point in direction (90)\n            set [ghost v] effect to (0)\n        end\n    end\n    if <[235] < (x position)> then\n        broadcast (ステージ切り替えはじめ v)\n    end\n    if <touching color (#0800c2)?> then\n        set [ｙ v] to [20]\n    end\n    if <touching color (#fff500)?> then\n        set [ｘ v] to [20]\n    end\n    if <(y position) < [-180]> then\n        set [ｘ v] to [0]\n        set [ｙ v] to [0]\n        go to x: (-205) y: (40)\n        point in direction (90)\n    end\nend\n\n@スプライト2\n\nwhen I receive [ステージ切り替え v]\nnext costume\n\nwhen flag clicked\nhide\nswitch costume to (コスチューム1 v)\nforever\n    if <(costume [number v]) = [19]> then\n        broadcast (ゴール v)\n    end\nend\n\nwhen I receive [start v]\nshow\n\n@スプライト3\n\nwhen I receive [ステージ切り替えはじめ v]\ngo to [front v] layer\nset [幕 v] to [0]\nshow\ngo to x: (0) y: (0)\ngo to [front v] layer\nrepeat until <(y position) < [-350]>\n    change [幕 v] by (-1)\n    broadcast (ステージ切り替え完了 v)\nend\nbroadcast (ステージ切り替え v)\nrepeat until <(y position) < [-720]>\n    change [幕 v] by (-1)\n    broadcast (ステージ切り替え完了 v)\nend\nset [幕 v] to [0]\nhide\n\nwhen flag clicked\nforever\n    change y by (幕)\nend\n\nchange [color v] effect by (1)\n\nchange x by (10)\n\nrepeat until <(x position) < [-220]>\n    broadcast (初期位置 v)\n    change [幕 v] by (-1)\nend\n\n@サムネイル\n\nwhen flag clicked\nhide\n\n@遊んでくれてありがとう\n\nwhen I receive [ゴール v]\nshow\n\nwhen flag clicked\nhide\nforever\n    glide (1) secs to x: (36) y: (8)\n    glide (1) secs to x: (36) y: (28)\nend\n\n@intro\n\nwhen flag clicked\nhide\npen up\nset [w v] to [0]\nerase all\nstart sound [Unlimited v]\nwait (3.5) seconds\nset [w v] to [1]\nswitch costume to (1 v)\ncreate clone of (_myself_ v)\nswitch costume to (2 v)\ncreate clone of (_myself_ v)\nset [w v] to [0]\nswitch costume to (logo v)\nwait until <(timer) > [6]>\nset [b v] to [1]\nrepeat until <[1000] < (b)>\n    change [b v] by ((b) / (3))\n    set pen size to (b)\n    set pen color to (#63ddd9)\n    pen up\n    go to x: (183) y: (180)\n    pen down\n    go to x: (-212) y: (-180)\n    pen up\n    set pen size to ((b) / (2))\n    set pen color to (#ff8da8)\n    go to x: (183) y: (180)\n    pen down\n    go to x: (-212) y: (-180)\n    pen up\nend\nset [b v] to [1]\nwait (0.25) seconds\nrepeat until <[600] < (b)>\n    change [b v] by ((b) / (3))\n    set pen size to (b)\n    set pen color to (#ffffff)\n    pen up\n    go to x: (183) y: (180)\n    pen down\n    go to x: (-212) y: (-180)\n    pen up\nend\nbroadcast (start v)\nerase all\n\nwhen I start as a clone\ngo to x: (0) y: (0)\nshow\nif <(costume [number v]) = [1]> then\n    set size to (130) %\n    go to x: (183) y: (180)\n    set [delta_x v] to ((0) - (x position))\n    set [delta_y v] to ((0) - (y position))\n    if <(delta_y) = [0]> then\n        if <(delta_x) < [0]> then\n            point in direction (-90)\n        else\n            point in direction (90)\n        end\n    else\n        if <(delta_y) < [0]> then\n            point in direction ((180) + ([atan v] of ((delta_x) / (delta_y)) ))\n        else\n            point in direction ([atan v] of ((delta_x) / (delta_y)) )\n        end\n    end\n    repeat until <[1] > ([abs v] of ([sqrt v] of (((x position) * (x position)) + ((y position) * (y position))) ) )>\n        move (([sqrt v] of (((x position) * (x position)) + ((y position) * (y position))) ) / (5)) steps\n    end\nelse\n    if <(costume [number v]) = [2]> then\n        set size to (130) %\n        go to x: (-212) y: (-180)\n        set [delta_x v] to ((0) - (x position))\n        set [delta_y v] to ((0) - (y position))\n        if <(delta_y) = [0]> then\n            if <(delta_x) < [0]> then\n                point in direction (-90)\n            else\n                point in direction (90)\n            end\n        else\n            if <(delta_y) < [0]> then\n                point in direction ((180) + ([atan v] of ((delta_x) / (delta_y)) ))\n            else\n                point in direction ([atan v] of ((delta_x) / (delta_y)) )\n            end\n        end\n        repeat until <[1] > ([abs v] of ([sqrt v] of (((x position) * (x position)) + ((y position) * (y position))) ) )>\n            move (([sqrt v] of (((x position) * (x position)) + ((y position) * (y position))) ) / (5)) steps\n        end\n    else\n        if <(costume [number v]) = [3]> then\n            set [w v] to [5]\n            hide\n            set rotation style [all around v]\n            go to x: (pick random (200) to (-150)) y: (-180)\n            set size to (1) %\n            set [b v] to (pick random (1) to (60))\n            point in direction (-130.99)\n            turn right (180) degrees\n            show\n            repeat until <<(x position) > [235]> or <(y position) > [175]>>\n                change size by (((b) - (size)) / (5))\n                move (w) steps\n                change [w v] by (1)\n            end\n        else\n            if <(costume [number v]) = [4]> then\n                set [w v] to [5]\n                hide\n                set rotation style [all around v]\n                go to x: (pick random (150) to (-200)) y: (180)\n                set [b v] to (pick random (1) to (60))\n                set size to (1) %\n                point in direction (-130.99)\n                show\n                repeat until <<[-235] > (x position)> or <[-175] > (y position)>>\n                    change size by (((b) - (size)) / (5))\n                    move (w) steps\n                    change [w v] by (1)\n                end\n            end\n        end\n    end\nend\nif <(costume [number v]) < [3]> then\n    go to x: (0) y: (0)\n    wait until <(timer) > [6]>\n    set [b v] to [0.1]\n    repeat until <touching (_edge_ v)?>\n        move (b) steps\n        change [b v] by ((b) / (3))\n    end\nend\ndelete this clone\n\nwhen flag clicked\nreset timer\nreset timer\nreset timer\nreset timer\nrepeat until <(timer) > [6]>\n    switch costume to (3 v)\n    create clone of (_myself_ v)\n    switch costume to (4 v)\n    create clone of (_myself_ v)\nend\n\n