Platformer || Join Scratch Writing Camp
@Stage\n\nwhen I receive [startplatformer v]\nnext backdrop\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nset [ghost v] effect to (0)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nset [ghost v] effect to (100)\n\n@Join SWCSprite1\n\nwhen flag clicked\nshow\nset size to (100) %\nswitch costume to (costume0 v)\nrepeat (4)\n    wait (.3) seconds\n    next costume\nend\nwait (.4) seconds\nbroadcast (PlayButton v)\nforever\n    switch costume to (costume1 v)\n    wait (.4) seconds\n    switch costume to (costume5 v)\n    wait (.4) seconds\nend\n\nwhen I receive [startplatformer v]\nrepeat (5)\n    change [ghost v] effect by (20)\nend\nhide\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\n\nwhen I receive [playbutton v]\nshow\nrepeat (25)\n    change [ghost v] effect by (-4)\nend\nset size to (100) %\nswitch costume to (costume2 v)\nrepeat until <<touching (mouse-pointer v)?> and <mouse down?>>\n    switch costume to (costume3 v)\n    repeat (3)\n        change size by (1)\n    end\n    wait (.1) seconds\n    repeat (3)\n        change size by (-1)\n    end\n    wait (.1) seconds\nend\n\nwhen this sprite clicked\nrepeat (5)\n    change [ghost v] effect by (20)\nend\nhide\nbroadcast (StartPlatformer v)\n\n@Player\n\ndefine Restart\nset [x v] to [0]\nset [y v] to [0]\ngo to x: (-165) y: (0)\n\ndefine Physics\nif <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>>> then\n    change [x v] by (2)\n    switch costume to (smt v)\nend\nif <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>>> then\n    change [x v] by (-2)\n    switch costume to (smt2 v)\nend\nchange x by (x)\nif <touching (level v)?> then\n    change x by ((x) * (-1))\n    if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n        if <(x) > [0]> then\n            set [x v] to [-10]\n            set [y v] to [10]\n        else\n            set [x v] to [10]\n            set [y v] to [10]\n        end\n    else\n        set [x v] to [0]\n    end\nelse\n    set [x v] to ((x) * (0.8))\nend\nchange y by (y)\nif <touching (level v)?> then\n    change y by ((y) * (-1))\n    set [y v] to [0]\n    if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n        if <(Jumping?) = [y]> then\n            set [y v] to [12]\n            set [jumping? v] to [n]\n        end\n    end\nelse\n    change [y v] by (-1)\n    set [jumping? v] to [y]\nend\nif <(x position) > [225]> then\n    change [level v] by (1)\n    Restart\nend\nif <(x position) < [-230]> then\n    change [level v] by (-1)\n    RestartBackwards\nend\n\ndefine Slope Detection\nset [slope v] to [0]\nrepeat until <<(Slope) = [8]> or <not <touching (level v)?>>>\n    change y by (1)\n    change [slope v] by (1)\nend\nif <touching (level v)?> then\n    change y by (-8)\nend\n\nwhen I receive [startplatformer v]\nRestart\nshow\nset [level v] to [1]\nforever\n    Physics\nend\n\nwhen flag clicked\nhide\n\ndefine RestartBackwards\nset [x v] to [0]\nset [y v] to [0]\ngo to x: (165) y: (0)\n\n@Level\n\nwhen I receive [startplatformer v]\nswitch costume to (costume1 v)\nset [ghost v] effect to (100)\nrepeat (5)\n    change [ghost v] effect by (-20)\nend\ngo to x: (0) y: (0)\nshow\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\n\n@mute/unmute button\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nswitch costume to (costume1 v)\nrepeat (100)\n    play sound [PromotionalMusic v] until done\nend\n\nwhen this sprite clicked\nnext costume\nforever\n    if <(costume [number v]) = [1]> then\n        play sound [PromotionalMusic v] until done\n    else\n        stop all sounds\n    end\nend\n\nwhen flag clicked\nforever\n    glide (.7) secs to x: (0) y: (5)\n    glide (.7) secs to x: (0) y: (0)\n    wait (.5) seconds\nend\n\n@Information\n\nwhen I receive [startplatformer v]\nswitch costume to (costume1 v)\nset [ghost v] effect to (100)\nrepeat (5)\n    change [ghost v] effect by (-20)\nend\ngo to x: (0) y: (0)\ngo to [back v] layer\nshow\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\n\n