Platformer BT21
@Stage\n\n@Objeto1\n\nwhen I start as a clone\nswitch costume to (disfraz2 v)\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-9)\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    set [x vel v] to [0]\n    set [y vel v] to [0]\n    set [jump v] to [0]\n    go to x: (-210) y: (-55)\n    repeat until <<(x position) > [240]> or <touching (danger v)?>>\n        change [x vel v] by (<key (right arrow v) pressed?> - <key (left arrow v) pressed?>)\n        set [x vel v] to ((X Vel) * (0.9))\n        create clone of (_myself_ v)\n        change x by (round (X Vel))\n        if <touching (platform v)?> then\n            change x by (round ((X Vel) * (-1)))\n            if <key (up arrow v) pressed?> then\n                if <(X Vel) > [0]> then\n                    set [x vel v] to [-8]\n                else\n                    set [x vel v] to [8]\n                end\n                set [jump v] to [0]\n            else\n                set [x vel v] to [0]\n            end\n        end\n        change [y vel v] by (-1)\n        change y by (Y Vel)\n        if <touching (platform v)?> then\n            change y by ((Y Vel) * (-1))\n            if <(Y Vel) < [0]> then\n                set [jump v] to [0]\n            end\n            set [y vel v] to [0]\n        end\n        if <key (up arrow v) pressed?> then\n            if <(Jump) = [0]> then\n                set [y vel v] to [15]\n                set [jump v] to [1]\n            end\n        end\n    end\n    if <(x position) > [240]> then\n        broadcast (Next level v)\n    end\nend\n\n\n\nwhen flag clicked\nforever\n    play sound [title v] until done\nend\n\n@Danger\n\nwhen flag clicked\nswitch costume to (danger v)\n\nwhen I receive [next level v]\nnext costume\n\n@Platform\n\nwhen flag clicked\nswitch costume to (disfraz1 v)\n\nwhen I receive [next level v]\nnext costume\n\n@Objeto2\n\nwhen flag clicked\nhide\ngo to [front v] layer\nforever\n    wait (pick random (3) to (5)) seconds\n    switch costume to (button3-b v)\n    go to x: (0) y: (105)\n    show\n    go to [front v] layer\n    repeat (9)\n        change y by (-6)\n    end\n    repeat (5)\n        change y by (3)\n    end\n    repeat (5)\n        change y by (-1)\n    end\n    wait (2) seconds\n    repeat (15)\n        change y by (7)\n    end\n    hide\nend\n\nwhen flag clicked\nhide\ngo to x: (-6) y: (105)\n\n
Use the arrows