Pen Platformer Generator v1.8


@Stage\n\nwhen flag clicked\nwait (0.3) seconds\nforever\n    play sound [Gerudo Valley v] until done\nend\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\n\nwhen I receive [color found v]\nswitch backdrop to (backdrop2 v)\n\n@Player\n\nwhen flag clicked\nswitch costume to (1 v)\ngo to x: (-210) y: (0)\nshow\nset size to (95) %\ngo to [front v] layer\nshow\nset [x v] to [0]\nset [y v] to [0]\npoint in direction (90)\ngo to x: (-201) y: (0)\ngo to x: (-213) y: (0)\nforever\n    set rotation style [left-right v]\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<(mouse x) < (x position)> and <mouse down?>>> then\n        switch costume to (3 v)\n        change [x2 v] by (-0.9)\n    end\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<(x position) < (mouse x)> and <mouse down?>>> then\n        switch costume to (2 v)\n        change [x2 v] by (0.9)\n    end\n    if <not <<<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> or <<key (a v) pressed?> or <key (d v) pressed?>>>> then\n        switch costume to (1 v)\n    end\n    set [x2 v] to ((X2) * (0.9))\n    change x by (X2)\n    if <touching (ground v)?> then\n        change y by (4)\n        if <touching (ground v)?> then\n            change y by (1)\n            if <touching (ground v)?> then\n                change y by (1)\n                if <touching (ground v)?> then\n                    change y by (1)\n                    if <touching (ground v)?> then\n                        change y by (1)\n                        if <touching (ground v)?> then\n                            change x by ((X2) * (-1))\n                            change y by (-1)\n                            if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<[0] < (mouse y)> and <mouse down?>>> then\n                                if <(X2) > [0]> then\n                                    set [x2 v] to [-10]\n                                else\n                                    set [x2 v] to [7]\n                                end\n                                set [y2 v] to [12]\n                            else\n                                set [x2 v] to [0.0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (-1)\n    if <<touching (ground v)?> or <<touching (ground v)?> or <touching (動く地面 v)?>>> then\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<(y position) < (mouse y)> and <mouse down?>>> then\n            start sound [JUMP v]\n            set [y2 v] to [15]\n        end\n    end\n    change y by (1)\n    change [y2 v] by (-1)\n    change y by (Y2)\n    if <<touching (ground v)?> or <touching (ground v)?>> then\n        change y by ((Y2) * (-1))\n        set [y2 v] to [0]\n    end\n    if <(x position) > [230]> then\n        change [stage v] by (1)\n        broadcast (次 v)\n        hide\n        set [x2 v] to [0]\n        go to x: (-201) y: (0)\n        show\n    end\n    if <<<touching (spikes/lava v)?> or <touching ( 8 v)?>> or <(y position) < [-174]>> then\n        set [x2 v] to [0]\n        set [y2 v] to [0]\n        start sound [Crunch v]\n        repeat (20)\n            change [ghost v] effect by (20)\n        end\n        go to x: (-201) y: (-50)\n        repeat (10)\n            change [ghost v] effect by (-40)\n        end\n    end\n    if <<touching ( 4 v)?> or <<touching ( 5 v)?> or <<touching ( 6 v)?> or <touching ( 7 v)?>>>> then\n        set [y2 v] to [20]\n    end\nend\n\n@ground\n\nwhen flag clicked\nset [stage v] to [1]\nforever\n    switch costume to (Stage)\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [15]> then\n        broadcast (color found v)\n    end\nend\n\n@spikes/lava\n\nwhen flag clicked\nset [stage v] to [1]\nforever\n    go to [back v] layer\n    switch costume to (Stage)\nend\n\n@Trail\n\nwhen I start as a clone\nswitch costume to (trail v)\nrepeat (7)\n    change size by (-4.7)\n    change [ghost v] effect by (7)\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    go to (player v)\n    create clone of (_myself_ v)\nend\n\n@text for bg\n\nwhen flag clicked\ngo to [front v] layer\nset [stage v] to [1]\nforever\n    switch costume to (Stage)\nend\n\n@Sun\n\nwhen flag clicked\nhide\n\nwhen I receive [color found v]\nshow\ngo to [back v] layer\nset size to (100) %\ngo to x: (-230) y: (160)\nforever\n    change [size change v] by (5)\n    change size by ([cos v] of ((Size change) * (1)) )\nend\n\ngo [backward v] (1) layers\n\n@stars\n\nwhen I start as a clone\nif <(pick random (1) to (4)) = [1]> then\n    set [v v] to (pick random (5.0) to (7.0))\nelse\n    set [v v] to (pick random (0.6) to (2.0))\nend\nrepeat until <(y position) > [179]>\n    change y by (v)\nend\ndelete this clone\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (pick random (30) to (80))\nswitch costume to (resize v)\nset size to (pick random (40) to (100)) %\nswitch costume to (pick random (1) to (2))\nforever\n    if <(pick random (1) to (0)) = [1]> then\n        wait (pick random (12) to (5)) seconds\n    else\n        wait (pick random (0.1) to (0.3)) seconds\n    end\n    repeat (3)\n        change [ghost v] effect by (10)\n    end\n    repeat (3)\n        change [ghost v] effect by (-10)\n    end\nend\n\nwhen I receive [start v]\nforever\n    go to x: (pick random (-240) to (240)) y: (-100)\n    create clone of (_myself_ v)\n    wait (0.4) seconds\nend\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nbroadcast (Start v)\n\nwhen backdrop switches to [backdrop13 v]\nforever\n    hide\nend\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    show\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\n