Platformer
@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop2 v)\n\nwhen I receive [message1 v]\nswitch backdrop to (backdrop3 v)\n\nwhen I receive [start v]\nswitch backdrop to (dark blue v)\n\n@Bat\n\ndefine platform (gravity)\nchange [yvelocity v] by (gravity)\nchange y by (yVelocity)\nif <<touching (under ground v)?> or <touching (under ground2 v)?>> then\n    repeat until <not <<touching (under ground v)?> or <touching (under ground2 v)?>>>\n        change y by ((([abs v] of (yVelocity) ) / (yVelocity)) * (-1))\n    end\n    set [yvelocity v] to [0]\n    if <<key (up arrow v) pressed?> or > then\n        set [yvelocity v] to [15]\n    end\nend\n\nwhen flag clicked\nhide\ngo to x: (-201) y: (0)\npoint in direction (90)\nset size to (50) %\nstart sound [bootup v]\nwait (1) seconds\nerase all\nset [jump v] to [30]\nrepeat (50)\n    change [jump v] by (1)\n    play note ((jump)) for (0.1) beats\nend\nrepeat (50)\n    change [jump v] by (-1)\n    play note ((jump)) for (0.1) beats\nend\nbroadcast (Start v)\nshow\nforever\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n        play note (66) for (0.01) beats\n        move (10) steps\n    end\n    if <key (left arrow v) pressed?> then\n        point in direction (-90)\n        play note (54) for (0.01) beats\n        move (10) steps\n    end\n    platform [-1]\n    if  then\n        play note (((yVelocity) * (5))) for (0.01) beats\n    end\nend\n\nbroadcast (message1 v)\nplay note (66) for (0.25) beats\nplay note (66) for (0.25) beats\nplay note (68) for (0.25) beats\nplay note (66) for (0.25) beats\nplay note (70) for (0.25) beats\nplay note (68) for (0.25) beats\nwait (0.3) seconds\nplay note (68) for (0.25) beats\nplay note (66) for (0.25) beats\nwait (0.3) seconds\nplay note (66) for (0.25) beats\nplay note (70) for (0.25) beats\nwait (0.1) seconds\nplay note (54) for (0.25) beats\n\nwhen flag clicked\nset tempo to (90)\nset [score v] to [0]\n\nwhen flag clicked\n\n@under ground\n\nwhen I receive [start v]\nshow\n\nwhen flag clicked\nhide\n\n