Pacman Platformer

Instructions: ▼ Arrow keys to move\n★ Read what to do in the project\n\nUPDATE 24/01/16: 93 views? In one week?\nUPDATE 1/08/16: 316 views?! Holy cow!\nAnd 58 likes!\nUPDATE 23/08/16: 502 views?! OMG!!!\nAnd 86 LIKES!!!!!!!!!! Howwww?! Thank you sooooo much!\nUPDATE 28/08/16 92 likes! I'm obsessed with updating!\nUPDATE 120 likes! Thanks so much! (And 824 views! XD)\nUPDATE 30/12/16 220 likes! Thank you so much!\nUPDATE 25/3/17 366 likes! This is amazing! Thank you!\nUPDATE 31/8/17 We are almost at 5000 views! That is insane! Thank you all so much!\nUPDATE 7/10/17 Thank you for 5000 views and 600 likes!

@Stage\n\n@Blank\n\n@Cube\n\nwhen flag clicked\ngo to [front v] layer\nswitch costume to (cube v)\nshow\nforever\n    set [x speed v] to [0]\n    set [y speed v] to [0]\n    set [jump v] to [0]\n    go to x: (-210) y: (-20)\n    repeat until <<(x position) > [240]> or <<<(y position) < [-180]> or <(y position) = [-180]>> or <touching (spikes v)?>>>\n        change [x speed v] by (<<<key (right arrow v) pressed?> or <<(mouse x) > ((x position) + (15))> and <mouse down?>>> or <key (d v) pressed?>> - <<<<(mouse x) < ((x position) + (-15))> and <mouse down?>> or <key (left arrow v) pressed?>> or <key (a v) pressed?>>)\n        set [x speed v] to ((X Speed) * (0.9))\n        create clone of (_myself_ v)\n        change x by (round (X Speed))\n        if <touching (floor2 v)?> then\n            change x by (round ((X Speed) * (-1)))\n            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<(mouse y) > ((y position) + (20))> and <mouse down?>>> then\n                if <(X Speed) > [0]> then\n                    set [x speed v] to [-8]\n                else\n                    set [x speed v] to [8]\n                end\n                set [jump v] to [0]\n            else\n                set [x speed v] to [0]\n            end\n        end\n        change [y speed v] by (-1)\n        change y by (Y Speed)\n        if <touching (floor2 v)?> then\n            change y by ((Y Speed) * (-1))\n            if <(Y Speed) < [0]> then\n                set [jump v] to [0]\n            end\n            set [y speed v] to [0]\n        end\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<(mouse y) > ((y position) + (20))> and <mouse down?>>> then\n            if <(Jump) = [0]> then\n                set [y speed v] to [15]\n                set [jump v] to [1]\n            end\n        end\n    end\n    if <(x position) > [240]> then\n        broadcast (Next Bild  v)\n        broadcast (Next Level v)\n    end\nend\n\nwhen I start as a clone\nswitch costume to (cube v)\nrepeat (10)\n    change size by (-5)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I receive [golden v]\nset [color v] effect to (0)\nforever\n    change [color v] effect by (0.5)\nend\n\nwhen I receive [skip v]\ngo to x: (-210) y: (-20)\n\n@Spikes\n\nwhen flag clicked\nswitch costume to (1 v)\n\nwhen flag clicked\ngo to [front v] layer\nshow\n\nhide\n\nwhen I receive [next bild  v]\nnext costume\n\n@Figur1\n\nwhen flag clicked\nswitch costume to (kostüm1 v)\nset [werbe stopp 🛑 v] to [0]\nhide\nforever\n    if <not <(Werbe Stopp 🛑) = [1]>> then\n        show\n        wait (2) seconds\n        hide\n        wait (pick random (10) to (20)) seconds\n    else\n        hide\n    end\nend\n\nwhen I receive [golden v]\nset [werbe stopp 🛑 v] to [1]\n\nwhen flag clicked\n\nforever\n    wait (0.9999999999999999999999999999999999) seconds\nend\n\nchange [☁ world record time v] by (1)\n\n@Floor2\n\nwhen flag clicked\nset [nervt v] to [1]\nwait until <(nervt) = [0]>\nwait until <(time end) = [1]>\nif <(☁ time) > (time)> then\n    set [☁ time v] to (time)\n    set [☁ players v] to (username)\nend\nif <(☁ time) = [0]> then\n    set [☁ time v] to [63]\n    set [☁ players v] to [drachenzahn123]\nend\n\nreset timer\n\nwhen flag clicked\nshow\n\nwhen flag clicked\nhide variable [☁ time v]\nhide variable [☁ players v]\nset [time v] to [0]\nset [time end v] to [0]\nset [nervt v] to [0]\nwait until <(costume [name v]) = [15]>\nshow variable [☁ time v]\nset [time end v] to [1]\nshow variable [☁ players v]\n\nrepeat until \nend\n\nwhen flag clicked\nrepeat until <(time end) = [1]>\n    wait (0.9999999999999999999999999) seconds\n    change [time v] by (1)\nend\n\nwhen I receive [next bild  v]\nnext costume\n\nwhen flag clicked\nswitch costume to (1 v)\ngo to [back v] layer\nforever\n    go to x: (0) y: (0)\nend\n\nset [☁ time v] to [132]\n\nwhen flag clicked\nset [☁ time v] to (☁ time)\n\n@Figur2\n\nwhen I start as a clone\ngo to [back v] layer\nforever\n    hide\n    go to x: (250) y: (pick random (50) to (150))\n    wait (pick random (2.5) to (15)) seconds\n    show\n    switch costume to (pick random (1) to (3))\n    repeat until <[-250] > (x position)>\n        change x by (-4)\n    end\nend\n\nwhen flag clicked\nrepeat (8)\n    hide\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\n@Figur3\n\nwhen flag clicked\nhide\n\n@Figur4\n\nwhen flag clicked\nwait (1) seconds\nrepeat until <(time end) = [1]>\n    if <<key (x v) pressed?> or <<touching (mouse-pointer v)?> and <mouse down?>>> then\n        broadcast (Next Bild  v)\n        change [time v] by (10)\n        broadcast (Skip v)\n        wait (10) seconds\n    end\nend\n\n@Text Engine\n\ndefine Write Text (text) At X: (x) Y: (y) | Width: (width) Size: (size) Colour: (clr) Brightness: (bright)\nset size to (size) %\nset [color v] effect to (clr)\nset [brightness v] effect to (bright)\nset [i v] to [1]\nset [x v] to (x)\nset [y v] to (y)\nforever\n    Position\n    set [new i v] to (i)\n    repeat until <<(letter (new i) of (text)) = [ ]> or <(new i) > (length of (text))>>\n        set [id v] to (letter (new i) of (text))\n        switch costume to (id)\n        change x by (10)\n        change [new i v] by (((item (costume [number v]) of [letter width v]) - (2)) * ((size) / (100)))\n    end\n    if <(x position) > ((x) + (width))> then\n        set [x v] to (x)\n        change [y v] by (0)\n    end\n    repeat until <(letter (i) of (text)) = [ ]>\n        Position\n        set [id v] to (letter (i) of (text))\n        if <<(x position) > ((x) + ((width) + (30)))> or <(id) = [|]>> then\n            set [x v] to (x)\n            change [y v] by ((-22) * ((size) / (100)))\n        end\n        if <not <(id) = [|]>> then\n            create clone of (_myself_ v)\n            switch costume to (id)\n            change [x v] by (((item (costume [number v]) of [letter width v]) - (2)) * ((size) / (100)))\n        end\n        change [i v] by (1)\n        if <(i) > (length of (text))> then\n            stop [this script v]\n        end\n    end\n    change [x v] by (((item (length of [letter width v]) of [letter width v]) - (2)) * ((size) / (100)))\n    change [i v] by (1)\n    if <(i) > (length of (text))> then\n        stop [this script v]\n    end\nend\n\nwhen I start as a clone\nswitch costume to (id)\ngo to [front v] layer\nPosition\nchange y by ()\nset [ghost v] effect to (100)\nshow\nrepeat ([floor v] of ((i) / (1.4)) )\nrepeat (20)\n    go to [front v] layer\n    change [ghost v] effect by (-5)\n    change y by ()\nend\nset [ghost v] effect to (0)\nforever\n    Position\nend\n\nwhen I receive [delete text clones v]\ndelete this clone\n\ndefine Position\ngo to x: (x) y: (160)\n\ndefine Next slide\nchange [_slide v] by (1)\nbroadcast (DELETE TEXT CLONES v) and wait\nbroadcast (_NEXT SLIDE v)\n\nwhen I receive [_next slide v]\nbroadcast (DELETE TEXT CLONES v) and wait\nstart sound [High Whoosh v]\n\ndefine back Slide\nchange [_slide v] by (-1)\nbroadcast (DELETE TEXT CLONES v) and wait\nbroadcast (_NEXT SLIDE v)\n\nwhen flag clicked\nset [_slide v] to [1]\nbroadcast (DELETE TEXT CLONES v) and wait\nbroadcast (_NEXT SLIDE v)\n\nforever\n    if <mouse down?> then\n        if <(mouse x) > [0]> then\n            wait until <not <mouse down?>>\n            Next slide\n        else\n            wait until <not <mouse down?>>\n            back Slide\n        end\n    else\n        if <key (right arrow v) pressed?> then\n            wait until <not <key (right arrow v) pressed?>>\n            Next slide\n        else\n            if <key (left arrow v) pressed?> then\n                wait until <not <key (left arrow v) pressed?>>\n                back Slide\n            end\n        end\n    end\nend\n\n\n\nwhen flag clicked\nforever\n    if <(_SLIDE) = [1]> then\n        Write Text (time) At X: [-190] Y: [] | Width: [] Size: [120] Colour: [0] Brightness: []\n        wait (1) seconds\n        broadcast (DELETE TEXT CLONES v)\n    end\nend\n\nbroadcast (intro v)\nstop [other scripts in sprite v]\nstop [this script v]\n\nif <(_SLIDE) > [0]> then\n\n@detector\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\nset [actions \(love/fave\) v] to [0]\nforever\n    set [touching v] to [none]\n    Detect [love] at [-201] [-220]\n    Detect [fave] at [-201] [-220]\nend\n\ndefine Detect (thing) at (x) (y)\nswitch costume to (empty v)\nset size to (27000) %\ngo to x: (x) y: (y)\nset size to (100) %\nswitch costume to (thing)\nif <touching (mouse-pointer v)?> then\n    set [touching v] to (costume [name v])\nend\n\nwhen flag clicked\nforever\n    wait until <(touching) = [love]>\n    wait (0.2) seconds\n    if <(touching) = [love]> then\n        change [actions \(love/fave\) v] by (1)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    wait until <(touching) = [fave]>\n    wait (0.2) seconds\n    if <(touching) = [fave]> then\n        change [actions \(love/fave\) v] by (1)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nwait until <(Actions \(love/fave\)) = [2]>\nbroadcast (Golden v)\n\nif  then\nend\n\n