Volcano || A Scrolling Platformer

Instructions: Welcome to the land of volcanoes! In the extreme heat, can you find your way to the end? *DISCLAIMER*\n* this is hard, and there are no check points *\n\nCONTROLS:\nClick bell to see achievements\nArrow keys\n\n(not mobile-friendly)

@Stage\n\nwhen [space v] key pressed\nset [mouse v] to (join ((mouse x) + (SCROLL X)) (join [, ] ((mouse y) + (SCROLL Y))))\nshow variable [mouse v]\nwait until <not <key (space v) pressed?>>\nhide variable [mouse v]\n\n@transition\n\nwhen flag clicked\ngo to x: (217) y: (180)\nset pen size to (50)\npen up\nset [transitioning v] to [1]\nrepeat (12)\n    change pen (saturation v) by (0)\n    create clone of (_myself_ v)\n    set y to (180)\n    change x by (-40)\n    wait (0.1) seconds\nend\n\nwhen I start as a clone\nhide\nset pen color to (#005bab)\nset [individual pen size v] to [50]\nset [start y v] to [180]\nset [end y v] to [180]\npen down\nrepeat until <(end y) < [-180]>\n    set [end y v] to ((end y) + (((-190) - (end y)) / (10)))\n    set y to (start y)\n    pen down\n    set y to (end y)\nend\nrepeat until <(transitioning) = [0]>\n    set y to (start y)\n    pen down\n    set y to (end y)\nend\nrepeat until <(start y) < [-180]>\n    set [start y v] to ((start y) + (((-200) - (start y)) / (10)))\n    set y to (start y)\n    pen down\n    set y to (end y)\nend\nset [individual pen size v] to [40]\nrepeat (51)\n    pen down\n    set [individual pen size v] to ((individual pen size) + (((0) - (individual pen size)) / (10)))\n    set pen size to (individual pen size)\nend\n\ngo to x: (170) y: (180)\n\nset x to (170)\n\nwhen flag clicked\nforever\n    erase all\n    set pen color to (#6c8390)\nend\n\nset pen color to (#2a546c)\n\nwhen I receive [erase v]\nforever\n    erase all\nend\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\nplay sound [Cradles v] until done\n\nwhen I receive [erase v]\nswitch backdrop to (backdrop1 v)\n\nwhen I receive [green flag v]\n\n@Transition\n\nwhen flag clicked\nset [ghost v] effect to (0)\ngo to [front v] layer\ngo to x: (585) y: (0)\nwait (9.19) seconds\nglide (.3) secs to x: (0) y: (0)\nbroadcast (Erase v)\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nbroadcast (Intro v) and wait\n\nset [collected v] to [3]\n\n@Logo name2\n\ndefine Smooth Glide to x (x) y (y) Speed (s)\nrepeat until <<(round (x position)) = (x)> and <(round (y position)) = (y)>>\n    change x by (((x) - (x position)) / (s))\n    change y by (((y) - (y position)) / (s))\nend\ngo to x: (x) y: (y)\n\nwhen flag clicked\ngo to x: (-88888) y: (-125)\nhide\n\nwhen I receive [size up v]\nset [sine v] to [0]\nshow\nSmooth Glide to x [7] y [-125] Speed [6]\nforever\n    change [sine v] by (7.5)\n    point in direction ((([sin v] of (sine) ) * (2)) + (90))\nend\n\nwhen I receive [erase v]\nhide\n\n@Logo\n\nwhen flag clicked\nset volume to (100) %\ngo to x: (0) y: (30)\nset [sine v] to [0]\npoint in direction (90)\nwait (3.21) seconds\nbroadcast (Size Up v)\nforever\n    change [sine v] by (7.5)\n    point in direction ((([sin v] of (sine) ) * (15)) + (90))\nend\n\nwhen I receive [erase v]\nhide\n\nwhen flag clicked\ngo to x: (0) y: (30)\nhide\n\nwhen I receive [size up v]\nshow\nrepeat (10)\n    change size by (10)\nend\n\nwhen flag clicked\nset size to (100) %\nset size to (0) %\nwait (3.20) seconds\nrepeat until <(@IntroBroad) = [3]>\n    point in direction ((90) + ((5) * ([cos v] of ((timer) * (200)) )))\n    set [i v] to (((i) * (.8)) + (((130) - (size)) / (5)))\n    change size by (i)\n    if <<<(Better timer :P) > [5]> and <(Better timer :P) < [5.05]>> or <<<(Better timer :P) > [6]> and <(Better timer :P) < [6.05]>> or <<(Better timer :P) > [8]> and <(Better timer :P) < [8.05]>>>> then\n        set size to (180) %\n    end\nend\nrepeat (10)\n    set [i v] to (((i) * (.8)) + (((130) - (size)) / (5)))\n    change size by (i)\n    change y by (((300) - (y position)) / (4))\n    change [ghost v] effect by (10)\nend\nset [@introbroad v] to [0]\ndelete this clone\n\nwhen I receive [erase v]\nrepeat (10)\n    change volume by (-15)\nend\n\n@Player\n\nwhen flag clicked\nhide\n\nwhen I receive [green flag v]\nbroadcast (Play v) and wait\nshow\n\nwhen I receive [green flag v]\ngo to [front v] layer\n\nwhen I receive [play v]\nset [level v] to [1]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    Game On\n    repeat until <(EXIT) > []>\n        Tick\n        broadcast (Tick v)\n    end\n    if <(EXIT) = [win]> then\n        Game - Win\n    else\n        Game - Die\n    end\nend\n\nbroadcast (Tick v) and wait\n\ndefine Game On\nset [x v] to (CHECKPOINT)\nset [y v] to [0]\nset [sy v] to [0]\nset [in air? v] to [0]\nset [exit v] to []\nset [ghost v] effect to (0)\nset size to (100) %\nshow\n\ndefine Tick\nif <key (left arrow v) pressed?> then\n    Change player x by: [-8]\nend\nif <key (right arrow v) pressed?> then\n    Change player x by: [8]\nend\nif <key (up arrow v) pressed?> then\n    if <(in air?) < [4]> then\n        set [sy v] to [16]\n    end\nend\nchange [sy v] by (-2)\nChange player y: (sy)\nset [scroll x v] to (x)\nPosition\n\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\n\nchange [scroll y v] by (1)\nPosition\n\ndefine Change player y: (sy)\nchange [y v] by (sy)\nchange [in air? v] by (1)\nPosition\nTest - Die\nrepeat until <not <touching (platforms v)?>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air? v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine Change player x by: (sx)\nchange [x v] by (sx)\nPosition\nTest - Die\nif <touching (platforms v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (platforms v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    repeat until <not <touching (platforms v)?>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Game - Die\ncreate clone of (_myself_ v)\nhide\n\nwhen I start as a clone\nset rotation style [all around v]\nset [ghost v] effect to (50)\ngo to [back v] layer\ngo [forward v] (20) layers\nrepeat (50)\n    turn right (5) degrees\n    change y by (3)\nend\nbroadcast (Die v)\ndelete this clone\n\nwhen I receive [die v]\nset [exit v] to []\n\ndefine Test - Die\nif <touching color (#fff000)?> then\n    set [exit v] to [die]\n    change [lava? v] by (1)\nend\n\nwait (0.5) seconds\n\ndefine Game - Win\nrepeat (50)\n    point towards (portal v)\n    turn right (65) degrees\n    move ((distance to [portal v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (2)\nend\nhide\nchange [level v] by (1)\nwait (1) seconds\n\nset [scroll y v] to [0]\n\nwhen flag clicked\nset [player v] to [0]\n\nwhen I receive [green flag v]\nset [checkpoint v] to [0]\n\nforever\nend\n\nwhen I receive [green flag v]\nshow variable [timer v]\nset [timer v] to [0]\nrepeat until <(x) > [5853]>\n    wait (0.01) seconds\n    change [timer v] by (0.01)\n    if <(x) > [5853]> then\n        stop [this script v]\n    end\nend\n\nset [checkpoint v] to [2646]\n\nwhen I receive [die v]\nset [x v] to (CHECKPOINT)\n\nwhen I receive [checkpoint1 v]\nset [checkpoint v] to [2646]\n\nwhen I receive [checkpoint2 v]\nset [checkpoint v] to [4901]\n\nwhen I receive [tick v]\nif <touching color (#2d00cc)?> then\n    broadcast (Checkpoint1 v)\nend\nif <<touching color (#8f00cc)?> or <touching color (#b100f3)?>> then\n    broadcast (Checkpoint2 v)\nend\n\n@Platforms\n\nwhen flag clicked\nhide\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (1 v)\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\nelse\n    delete this clone\nend\n\ndefine Position: (x) y: (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nset [collected v] to [3]\nbroadcast (Open v)\n\nswitch costume to (5 v)\n\nset [y v] to [0]\n\n@Platforms2\n\nwhen flag clicked\ngo to [back v] layer\nhide\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [tick v]\nClone x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 v)\ncreate clone of (_myself_ v)\nchange [x v] by (460)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (460)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (460)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (460)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (460)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (460)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (460)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (460)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (460)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (460)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (460)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (460)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (460)\nnext costume\n\ndefine Clone x: (x) y: (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nnext costume\n\n@Gems\n\nwhen flag clicked\nhide\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    change [collected v] by (1)\n    change [coin? v] by (1)\n    if <(COLLECTED) = (COLLECTED MAX)> then\n        broadcast (Open v)\n    end\n    delete this clone\nend\n\nwhen I receive [setup v]\nhide\nset [collected v] to [0]\nset [collected max v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    Clone at x: [534] y: [34]\n    Clone at x: [691] y: [-129]\n    Clone at x: [1102] y: [148]\nend\nset [x v] to [-9999999999999999999]\n\ndefine Position: (x) y: (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\nchange [collected max v] by (1)\nswitch costume to (pick random (1) to (3))\ncreate clone of (_myself_ v)\n\n@Portal\n\nwhen flag clicked\nhide variable [timer v]\nhide variable [collected v]\nhide\n\nwhen I receive [tick v]\nPosition: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\nif <<touching (player v)?> and <(costume [number v]) = [2]>> then\n    set [exit v] to [win]\nend\n\nwhen I receive [setup v]\nhide\nset [collected v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (closed v)\n    Position at x: [999999999999999999999] y: [27]\nelse\n    Position at x: [999999999999] y: [27]\n    hide\nend\n\ndefine Position: (x) y: (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Position at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\n\nwhen I receive [open v]\nswitch costume to (open v)\n\nset [collected v] to [3]\n\nchange [collected v] by (-2)\n\nshow variable [collected v]\n\n@Start\n\nwhen flag clicked\nhide\n\nwhen I receive [intro v]\nshow\n\nwhen this sprite clicked\nbroadcast (Green Flag v)\nhide\nforever\n    play sound [Inferno v] until done\nend\n\n@menu\n\nwhen flag clicked\nhide\n\nwhen I receive [intro v]\nshow\n\nwhen I receive [green flag v]\nhide\n\n@achievement\n\nwhen flag clicked\nset [coin? v] to [0]\nset [lava? v] to [0]\nhide\n\nwhen I receive [achievement v]\ngo to [front v] layer\nclear graphic effects\ngo to x: (0) y: (-99999999999999)\nset size to (50) %\nshow\nglide (1) secs to x: (0) y: (0)\nrepeat (10)\n    change size by (10)\nend\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [green flag v]\ndelete all of [achievements unlocked v]\nhide\n\nwhen I receive [tick v]\nif <(lava?) = [1]> then\n    switch costume to (lava v)\n    broadcast (Achievement v)\n    add [Hot, Hot, Hot!] to [achievements unlocked v]\n    change [lava? v] by (1)\nend\nif <(coin?) = [1]> then\n    switch costume to (coin v)\n    broadcast (Achievement v)\n    add [ummmm....rich.....] to [achievements unlocked v]\n    change [coin? v] by (1)\nend\n\n@bell\n\nwhen flag clicked\nset [coin? v] to [0]\nset [lava? v] to [0]\nhide\n\nwhen I receive [green flag v]\ngo to [front v] layer\nshow\nforever\n    if <(length of [achievements unlocked v]) > [1]> then\n        switch costume to (costume4 v)\n    else\n        if <<(length of [achievements unlocked v]) > [0]> and <(length of [achievements unlocked v]) < [2]>> then\n            switch costume to (costume2 v)\n        else\n            switch costume to (costume3 v)\n        end\n    end\nend\n\nwhen this sprite clicked\nhide list [achievements unlocked v]\nwait (1) seconds\nshow list [achievements unlocked v]\n\nwhen I receive [tick v]\ngo to [front v] layer\ngo [forward v] (1) layers\n\n@Sprite1\n\nwhen flag clicked\nforever\n    change [ghost v] effect by (100)\n    go to [front v] layer\nend\n\n