Strange [Platformer]
@Stage\n\n@Thumbnail\n\ngo to [front v] layer\nshow\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\n@Player\n\nwhen flag clicked\nset [levelnumber v] to [1]\nforever\n    set [levelnumber v] to (backdrop [number v])\nend\n\nwhen flag clicked\nforever\n    wait until <<(x position) = [237]> or <(x position) > [237]>>\n    change [levels beaten v] by (1)\n    wait (2) seconds\nend\n\nwhen I receive [resetplayer v]\ngo to x: (-205) y: (-80)\n\nwhen I receive [startgame v]\nforever\n    if <<<(PlatformerMode) = [Platformer]> or <(PlatformerMode) = [PlatformerInfinity]>> and <(DisablePlatformer) = [False]>> then\n        go to x: (-205) y: (-80)\n        show\n        switch costume to (default v)\n        set [yvelocity v] to [0]\n        set [xvelocity v] to [0]\n        forever\n            if <<touching color (#ff0000)?> or <(y position) < [-180]>> then\n                start sound [Lose v]\n                change [deathcounter v] by (1)\n                broadcast (ResetPlayer v)\n            end\n            if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <(Stick X) < [0]>> then\n                change [xvelocity v] by (-0.75)\n            end\n            if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <(Stick X) > [0]>> then\n                change [xvelocity v] by (0.75)\n            end\n            change x by (XVelocity)\n            set [xvelocity v] to ((XVelocity) * (0.85))\n            if <touching color (#000000)?> then\n                change y by (0.5)\n                if <touching color (#000000)?> then\n                    change y by (0.5)\n                    if <touching color (#000000)?> then\n                        change y by (0.5)\n                        if <touching color (#000000)?> then\n                            change y by (0.5)\n                            if <touching color (#000000)?> then\n                                change y by (0.5)\n                                if <touching color (#000000)?> then\n                                    change y by (0.5)\n                                    if <touching color (#000000)?> then\n                                        change y by (0.5)\n                                        if <touching color (#000000)?> then\n                                            change y by (0.5)\n                                            if <touching color (#000000)?> then\n                                                if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <(Stick Button) > [0]>> then\n                                                    if <(XVelocity) > [0]> then\n                                                        set [xvelocity v] to [-10]\n                                                    else\n                                                        set [xvelocity v] to [10]\n                                                    end\n                                                    set [yvelocity v] to [8]\n                                                else\n                                                    set [xvelocity v] to ((XVelocity) * (-1.3))\n                                                    change x by (XVelocity)\n                                                    set [xvelocity v] to [0]\n                                                    change x by ((XVelocity) / (5))\n                                                end\n                                                change y by (-4)\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n            change [yvelocity v] by (-0.5)\n            change y by (YVelocity)\n            if <touching color (#000000)?> then\n                set [yvelocity v] to ((YVelocity) * (-0.25))\n                change y by (YVelocity)\n                if <touching color (#000000)?> then\n                    change y by (YVelocity)\n                    if <touching color (#000000)?> then\n                        change y by (YVelocity)\n                        if <touching color (#000000)?> then\n                            change y by (YVelocity)\n                        end\n                    end\n                end\n            end\n            change y by (-1)\n            if <<touching color (#000000)?> and <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <(Stick Button) > [0]>>> then\n                start sound [Jump v]\n                set [yvelocity v] to [8]\n            end\n            change y by (1)\n        end\n    end\nend\n\nwhen I receive [startgame v]\nforever\n    if <<(x position) = [237]> or <(x position) > [237]>> then\n        start sound [Win v]\n        if <(backdrop [name v]) = [StageLast]> then\n            set [platformermode v] to [PlatformerInfinity]\n            switch backdrop to (pick random (6) to (NumberofLevels))\n            go to x: (-205) y: (-74)\n        else\n            go to x: (-205) y: (-74)\n            if <(PlatformerMode) = [Platformer]> then\n                switch backdrop to (next backdrop v)\n            else\n                if <(PlatformerMode) = [PlatformerInfinity]> then\n                    switch backdrop to (pick random (6) to (NumberofLevels))\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nset [deathcounter v] to [0]\nset [numberoflevels v] to [184]\nset [platformermode v] to [Platformer]\nset [levels beaten v] to [0]\nswitch backdrop to (stage1 v)\nswitch costume to (default v)\nset size to (100) %\nclear graphic effects\ngo to x: (0) y: (-50)\npoint in direction (-75)\nset rotation style [don't rotate v]\nshow\nbroadcast (StartGame v)\n\nwhen [r v] key pressed\nbroadcast (ResetPlayer v)\n\nwhen [t v] key pressed\ngo to x: (-205) y: (-80)\nif <(PlatformerMode) = [Platformer]> then\n    switch backdrop to (next backdrop v)\nelse\n    if <(PlatformerMode) = [PlatformerInfinity]> then\n        switch backdrop to (pick random (6) to (NumberofLevels))\n    end\nend\n\nwhen [y v] key pressed\nnext costume\n\n@Menu\n\nwhen flag clicked\nset [disableplatformer v] to [False]\nhide variable [deathcounter v]\nhide variable [levels beaten v]\ngo to x: (0) y: (0)\ngo to [front v] layer\nhide\nforever\n    if <key (m v) pressed?> then\n        broadcast (ResetPlayer v)\n        set [disableplatformer v] to [True]\n        show variable [deathcounter v]\n        show variable [levels beaten v]\n        go to [front v] layer\n        show\n        wait until <not <key (m v) pressed?>>\n        set [disableplatformer v] to [False]\n        hide\n        hide variable [deathcounter v]\n        hide variable [levels beaten v]\n    end\nend\n\n@Stick\n\nwhen flag clicked\ngo to [front v] layer\nset size to (80) %\nset [ghost v] effect to (80)\nset [range v] to ((size) / (2.5))\nforever\n    switch costume to (base v)\n    go to x: (-177) y: (-121)\n    repeat until <not <mouse down?>>\n        Keyboard Controls\n    end\n    repeat until <mouse down?>\n        Keyboard Controls\n    end\n    if <(distance to [mouse-pointer v]) < (size)> then\n        Stick Active\n    end\nend\n\ndefine Keyboard Controls\nset [stick x v] to <<key (right arrow v) pressed?> or <key (d v) pressed?>>\nchange [stick x v] by ((0) - <<key (left arrow v) pressed?> or <key (a v) pressed?>>)\nset [stick y v] to <<key (up arrow v) pressed?> or <key (w v) pressed?>>\nchange [stick y v] by ((0) - <<key (down arrow v) pressed?> or <key (s v) pressed?>>)\nif <key (space v) pressed?> then\n    change [stick button v] by (1)\nelse\n    set [stick button v] to [0]\nend\n\ndefine Stick Active\ngo to (mouse-pointer v)\nswitch costume to (ready v)\ncreate clone of (_myself_ v)\nswitch costume to (stick v)\ncreate clone of (_myself_ v)\nswitch costume to (base active v)\nset [stick button v] to []\nrepeat until <(distance to [mouse-pointer v]) > ((size) * (1.5))>\n    Detect Stick Movement\n    Detect Stick Button\nend\nbroadcast (Deactivate Stick v)\n\ndefine Detect Stick Movement\nset [stick x v] to (((mouse x) - (x position)) / (Range))\nset [stick y v] to (((mouse y) - (y position)) / (Range))\nif <([abs v] of (Stick X) ) > [1]> then\n    set [stick x v] to ((Stick X) / ([abs v] of (Stick X) ))\nend\nif <([abs v] of (Stick Y) ) > [1]> then\n    set [stick y v] to ((Stick Y) / ([abs v] of (Stick Y) ))\nend\n\ndefine Detect Stick Button\nif <mouse down?> then\n    if <(Stick Button) > []> then\n        change [stick button v] by (1)\n    end\nelse\n    set [stick button v] to [0]\nend\n\nwhen I receive [deactivate stick v]\ndelete this clone\n\nwhen I start as a clone\nif <(costume [name v]) = [Stick]> then\n    go [backward v] (1) layers\n    set [ghost v] effect to (0)\n    forever\n        go to (stick v)\n        change x by ((Stick X) * (Range))\n        change y by ((Stick Y) * (Range))\n    end\nend\ngo to x: (177) y: (-121)\nwait until <not <mouse down?>>\nswitch costume to (base active v)\nforever\n    if <mouse down?> then\n        set [ghost v] effect to (25)\n    else\n        set [ghost v] effect to (75)\n    end\nend\n\nwhen flag clicked\nshow\nset [ismobile v] to [True]\nforever\n    if <<key (w v) pressed?> or <<key (a v) pressed?> or <<key (d v) pressed?> or <<key (space v) pressed?> or <<key (left arrow v) pressed?> or <<key (up arrow v) pressed?> or <key (right arrow v) pressed?>>>>>>> then\n        set [ismobile v] to [False]\n        if <(IsMobile) = [False]> then\n            hide\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(IsMobile) = [False]> then\n        delete this clone\n    end\nend\n\n
再共有です