Fire - A Platformer [pt.2]
@Stage\n\n@Platforms\n\nwhen I receive [next level v]\nif <(costume [number v]) = [10]> then\n    stop [other scripts in sprite v]\nelse\n    next costume\nend\n\nwhen flag clicked\nswitch costume to (level 1 v)\ngo to x: (0) y: (0)\n\n@Player\n\nwhen [r v] key pressed\nbroadcast (Restart v)\n\nwhen I receive [next level v]\nbroadcast (Restart v)\n\nwhen I receive [restart v]\nif <([costume # v] of [platforms v]) = [8]> then\n    go to x: (-213) y: (107)\nelse\n    go to x: (-220) y: (-30)\nend\nset [y v] to [0]\n\nwhen flag clicked\nbroadcast (Restart v)\nswitch costume to (fire v)\nshow\nset [x v] to [0]\nset [y v] to [0]\nforever\n    go to [front v] layer\n    if <touching (ladders v)?> then\n        set [y v] to [0]\n        if  then\n            change [y v] by (8)\n        end\n        if <<key (down arrow v) pressed?> or <<mouse down?> and <(y position) > (mouse y)>>> then\n            change [y v] by (-8)\n        end\n        if <not <touching (ladders v)?>> then\n            set [y v] to [15]\n        end\n    else\n        change [y v] by (-1)\n    end\n    if <<key (left arrow v) pressed?> or <<mouse down?> and <(y position) > (mouse y)>>> then\n        change [x v] by (-1)\n        point in direction (-90)\n    end\n    if <<key (right arrow v) pressed?> or <<mouse down?> and <(y position) > (mouse y)>>> then\n        change [x v] by (1)\n        point in direction (90)\n    end\n    set [x v] to ((X) * (0.9))\n    change x by (X)\n    if <touching (platforms v)?> then\n        change y by (1)\n    end\n    if <touching (platforms v)?> then\n        change y by (1)\n    end\n    if <touching (platforms v)?> then\n        change y by (1)\n    end\n    if <touching (platforms v)?> then\n        change y by (1)\n    end\n    if <touching (platforms v)?> then\n        change y by (-4)\n        change x by ((X) * (-1))\n        if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            set [y v] to [15]\n            if <([abs v] of (X) ) = (X)> then\n                set [x v] to [-10]\n            else\n                set [x v] to [10]\n            end\n        else\n            set [x v] to [0]\n        end\n    end\n    change y by (Y)\n    if <touching (platforms v)?> then\n        change y by ((Y) - ((Y) * (2)))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> and <touching (platforms v)?>> then\n        set [y v] to [15]\n    end\n    change y by (1)\nend\n\nwhen flag clicked\nshow\nforever\n    if <<(x position) > [230]> and <touching (_edge_ v)?>> then\n        broadcast (Next level v)\n    end\n    if <<touching (spikes v)?> or <<touching (lava v)?> or <<(y position) < [-170]> and <touching (_edge_ v)?>>>> then\n        broadcast (Restart v)\n    end\n    if <touching (bounce v)?> then\n        set [y v] to [20]\n    end\nend\n\nwhen flag clicked\nplay sound [Hello - OMFG \(Piano Version\) v] until done\n\n@Spikes\n\nwhen flag clicked\nforever\n    switch costume to ([costume # v] of [platforms v])\nend\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\nwhen flag clicked\ngo to [front v] layer\nforever\n    switch costume to ([costume # v] of [platforms v])\nend\n\n@FireCrystal\n\nwhen flag clicked\nshow\nforever\n    switch costume to ([costume # v] of [platforms v])\nend\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        play sound [Collect v] until done\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        hide\n    end\nend\n\n@Lava\n\nwhen flag clicked\nforever\n    switch costume to ([costume # v] of [platforms v])\nend\n\n@Thumb\n\nwhen flag clicked\ngo to [front v] layer\nhide\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.001)\nshow\ngo to [front v] layer\ngo to x: (0) y: (375)\nrepeat until <(y position) = [0]>\n    change y by (((y position) / (5)) * (-1))\nend\n\n@detector\n\nwhen flag clicked\nhide\nset [faved___ v] to [0]\nset [loved__ v] to [0]\nset [clone id v] to [0]\ncreate clone of (_myself_ v)\nwait (0.2) seconds\nset [clone id v] to [1]\ncreate clone of (_myself_ v)\nwait until <<(LOVED__) = [1]> and <(FAVED___) = [1]>>\nwait (1) seconds\nshow\ngo to x: (0) y: (50)\nreset timer\nswitch costume to (pick random (1) to (4))\nset [ghost v] effect to (100)\nrepeat until <(timer) > [3.5]>\n    change y by ((y position) / (-15))\n    change [ghost v] effect by (-3)\nend\nwait (0) seconds\nreset timer\nrepeat until <(timer) > [3.5]>\n    change y by (((y position) - (-100)) / (-15))\n    change [ghost v] effect by (10)\nend\n\nwhen I start as a clone\nif <(clone id) = [0]> then\n    go to x: (-15) y: (0)\n    set [loved__ v] to [0]\n    switch costume to (love v)\n    forever\n        set [love? v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [loved__ v] to [1]\n        end\n    end\nend\nif <(clone id) = [1]> then\n    go to x: (0) y: (0)\n    switch costume to (fave v)\n    set [faved___ v] to [0]\n    forever\n        set [fav v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [faved___ v] to [1]\n        end\n    end\nend\n\n
This is my second platformer!\n\nFirst platformer: https://scratch.mit.edu/projects/484220454/\nPlatformer 3 - https://scratch.mit.edu/projects/486419716/\nAnother Game you may like: \nhttps://scratch.mit.edu/projects/485796562/\nAll levels are possible.\n\nSTORY\nYou have retrieved the Earth Crystal. The Fire Crystal is next. Go to the Burned Lands and find it!\n\n• Arrow keys to move on PC\n• R to restart (If for some reason you get stuck somewhere)\n\nOTHER INFO\n• There are ten levels.\n• NO ADVERTISING OR SPAMMING (All comments of that type WILL be deleted and reported. You may do that if I don't do it first.)\n• Please don't say stuff like, "That was REALLY easy", "This is stupid", or "This game sucks". Those comments will be deleted.