Lava Islands || A Scrolling Platformer
@Stage\n\nwhen flag clicked\nforever\n    play sound [New Life v] until done\nend\n\nset [speedboost? v] to [1]\n\nset [jumpboost? v] to [1]\n\n@Blank\n\n@Start Screen\n\nwhen flag clicked\nhide\ngo to x: (0) y: (103)\ncreate clone of (_myself_ v)\nset [clone id v] to [start]\nswitch costume to (title v)\n\nwhen I start as a clone\nif <(Clone ID) = [start]> then\n    show\n    switch costume to (start button v)\n    go to x: (0) y: (-120)\n    point in direction (90)\n    forever\n        point in direction ((90) + (([sin v] of ((timer) * (500)) ) * (5)))\n        if <touching (mouse-pointer v)?> then\n            repeat until <(size) = [120]>\n                change size by (5)\n                change [brightness v] effect by (5)\n            end\n        else\n            repeat until <(size) = [100]>\n                change size by (-5)\n                change [brightness v] effect by (-5)\n            end\n        end\n    end\nend\n\nwhen I receive [play game v]\nforever\n    hide\nend\n\nwhen I start as a clone\nif <(Clone ID) = [start]> then\n    forever\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            start sound [Wood Tap v]\n            repeat until <(size) = [100]>\n                change size by (-10)\n            end\n            broadcast (Play game v)\n        end\n    end\nend\n\nwhen I receive [play game v]\nstop [other scripts in sprite v]\n\n@Player\n\nchange [sx v] by ((2) * (<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<((mouse x) - (20)) > (x position)> and <mouse down?>>> - <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<((mouse x) + (20)) < (x position)> and <mouse down?>>>))\nset [sx v] to ((sx) * (0.75))\n\nif <(in air) < [-2]> then\n    if <(JumpBoost?) = [1]> then\n        set [sy v] to [20]\n    else\n        set [sy v] to [16]\n    end\nend\n\nif <(sy) > [-2]> then\n\ndefine Game on\nswitch costume to (front v)\nset rotation style [left-right v]\npoint in direction (-90)\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [x v] to [-180]\nset [y v] to [80]\nset [sy v] to [0]\nset [sx v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset size to (100) %\nset [ghost v] effect to (0)\nshow\n\ndefine Tick\nswitch costume to (front v)\npoint in direction (90)\nif <(SpeedBoost?) = [1]> then\n    change [sx v] by ((-1.3) * <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<((mouse x) - (20)) > (x position)> and <mouse down?>>>)\n    change [sx v] by ((1.3) * <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<((mouse x) - (20)) > (x position)> and <mouse down?>>>)\nend\nif <<not <(Touching?) = [1]>> and <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [sx v] by (2)\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [sx v] by (2)\n    switch costume to (right v)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [sx v] by (-2)\n    switch costume to (left v)\nend\nif <<not <(Touching?) = [1]>> and <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [sx v] by (-2)\nend\nset [sx v] to ((sx) * (0.8))\nif <([abs v] of (sx) ) > [0.9]> then\n    Change player x by (round (sx))\nend\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(y position) < (mouse y)>>> then\n    if <(sy) > [-2]> then\n        if <(In air) < [4]> then\n            set [sy v] to [16]\n            if <(JumpBoost?) = [1]> then\n                set [sy v] to [20]\n            else\n                if <(In air) < [4]> then\n                    set [sy v] to [16]\n                end\n            end\n        end\n    end\nend\nif <(sy) > [-20]> then\n    change [sy v] by (-1.5)\nend\nChange player y by (sy)\nDie\nchange [scroll x v] by (round (((x) - (SCROLL X)) / (8)))\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (8)))\nPosition\nif <touching (trampoline v)?> then\n    set [sy v] to [30]\nend\nif <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>>> then\n    switch costume to (right v)\nelse\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        switch costume to (left v)\n    else\n        switch costume to (front v)\n    end\nend\n\ndefine Change player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\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\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    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        if <(sx) > [0]> then\n            set [sx v] to [-8]\n        else\n            set [sx v] to [16]\n        end\n        set [in air v] to [0]\n    else\n        set [sx v] to [0]\n    end\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\nset [death v] to [1]\nset [ghost v] effect to (0)\nstart sound [Bonk v]\nset [yv v] to [15]\nrepeat until <(y position) < [-90]>\n    set rotation style [all around v]\n    change [ghost v] effect by (3)\n    switch costume to (front v)\n    go to [front v] layer\n    turn right (10) degrees\n    change y by (yv)\n    change [yv v] by (-1)\nend\nrepeat until <(y position) < [-178]>\n    set rotation style [all around v]\n    change [ghost v] effect by (5)\n    go to [front v] layer\n    turn right (10) degrees\n    change y by (yv)\n    change [yv v] by (-1)\nend\nset [death v] to [0]\nhide\n\ndefine Die\nif <<<touching (spikes v)?> or <(SCROLL Y) < [-20]>> or <<touching (saws v)?> or <touching (lava v)?>>> then\n    set [exit v] to [Die]\nend\n\ndefine Win?\nset rotation style [all around v]\nrepeat (20)\n    point towards (portal v)\n    turn right (65) degrees\n    move ((distance to [portal v]) / (2)) steps\n    change size by (-2)\n    change [ghost v] effect by (5)\nend\nchange [level v] by (1)\nset [skip?2 v] to [no]\nhide\nset [ghost v] effect to (0)\nset size to (100) %\n\nif <(EXIT) = [Win]> then\n\nchange [level v] by (1)\nset [skip?2 v] to [no]\nhide\nset [ghost v] effect to (0)\nset size to (100) %\n\nwhen flag clicked\nhide\nset [death v] to [0]\n\nwhen I receive [play game v]\nset [clicked? v] to [0]\nset [level v] to [1]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    show\n    Game on\n    repeat until <(EXIT) > []>\n        broadcast (Tick v)\n        Tick\n    end\n    if <(EXIT) = [Win]> then\n        Win?\n    else\n        Game die\n    end\nend\n\nwait (0.3) seconds\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\nhide\n\nwhen flag clicked\nset [speedboost? v] to [0]\nset [jumpboost? v] to [0]\nset [coins v] to [0]\n\nif <<(EXIT) = [die]> and <(Level) = [1]>> then\n    set [coins v] to [0]\nend\n\nchange [sx v] by ((2) * (<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<((mouse x) - (20)) > (x position)> and <mouse down?>>> - <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<((mouse x) + (20)) < (x position)> and <mouse down?>>>))\nset [sx v] to ((sx) * (0.8))\n\nswitch costume to (front v)\npoint in direction (90)\nif <(SpeedBoost?) = [1]> then\n    change [sx v] by ((1.7) * (<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<((mouse x) - (20)) > (x position)> and <mouse down?>>> - <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<((mouse x) + (20)) < (x position)> and <mouse down?>>>))\n    set [sx v] to ((sx) * (0.95))\nelse\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [sx v] by (2)\n        switch costume to (right v)\n    end\nend\nif <<not <(Touching?) = [1]>> and <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [sx v] by (2)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [sx v] by (-2)\n    switch costume to (left v)\nend\nif <<not <(Touching?) = [1]>> and <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [sx v] by (-2)\nend\nset [sx v] to ((sx) * (0.8))\nif <([abs v] of (sx) ) > [0.9]> then\n    Change player x by (round (sx))\nend\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(y position) < (mouse y)>>> then\n    if <(In air) < [4]> then\n        set [sy v] to [20]\n        if <(sy) > [-2]> then\n            if <(JumpBoost?) = [1]> then\n                set [sy v] to [20]\n            else\n                set [sy v] to [14]\n            end\n        end\n    end\nend\nif <(sy) > [-20]> then\n    change [sy v] by (-1.5)\nend\nChange player y by (sy)\nDie\nchange [scroll x v] by (round (((x) - (SCROLL X)) / (8)))\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (8)))\nPosition\nif <touching (trampoline v)?> then\n    set [sy v] to [30]\nend\nif <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>>> then\n    switch costume to (right v)\nelse\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        switch costume to (left v)\n    else\n        switch costume to (front v)\n    end\nend\n\nset [jumpboost? v] to [1]\n\nset [sx v] to ((sx) * (0.85))\n\n@Platforms\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [y v] to [0]\nset [x v] to [0]\nif <(Level) = [1]> then\n    switch costume to (1-1 v)\n    Position x: [450] y: [0]\n    Position x: [450] y: [0]\nelse\n    if <(Level) = [2]> then\n        switch costume to (2-1 v)\n        Position x: [450] y: [0]\n        Position x: [450] y: [0]\n    else\n        if <(Level) = [3]> then\n            switch costume to (3-1 v)\n            Position x: [450] y: [0]\n            Position x: [450] y: [0]\n        else\n            if <(Level) = [4]> then\n                switch costume to (4-1 v)\n                Position x: [450] y: [0]\n                Position x: [450] y: [0]\n            else\n                if <(Level) = [5]> then\n                    switch costume to (5-1 v)\n                    Position x: [450] y: [0]\n                    Position x: [450] y: [0]\n                else\n                    if <(Level) = [6]> then\n                        switch costume to (6-1 v)\n                        Position x: [450] y: [0]\n                        Position x: [450] y: [0]\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Position (x) (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\nwhen flag clicked\nhide\n\ndefine Position x: (x) y: (y)\nhide\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\n@Lava\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\ngo to [back v] layer\ngo to [back v] layer\ngo to [back v] layer\ngo to [back v] layer\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) (((y) + (([sin v] of (((timer) + (effects)) * (200)) ) * (5))) - (SCROLL Y))\n\ndefine Position (x) (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 [setup v]\nset [y v] to [0]\nset [x v] to [0]\nrepeat (10)\n    Position x: [450] y: [0] [8]\nend\n\ndefine Position x: (x) y: (y) (effects)\nhide\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nchange [effects v] by (effects)\n\nnext costume\n\n@Coins\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    if <touching (player v)?> then\n        change [coins v] by (1)\n        start sound [Collect v]\n        delete this clone\n    end\n    delete this clone\nend\n\nif  then\nend\n\ndefine Position (x) (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 x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [setup v]\nif <<<(EXIT) = [Die]> and <(Level) = [1]>> and <not <<(SpeedBoost?) = [1]> or <(JumpBoost?) = [1]>>>> then\n    set [coins v] to [0]\nelse\n    if <<<(EXIT) = [Die]> and <(Level) = [2]>> and <not <<(SpeedBoost?) = [1]> or <(JumpBoost?) = [1]>>>> then\n        set [coins v] to [6]\n    else\n        if <<<(EXIT) = [Die]> and <(Level) = [3]>> and <not <<(SpeedBoost?) = [1]> or <(JumpBoost?) = [1]>>>> then\n            set [coins v] to [12]\n        else\n            if <<<(EXIT) = [Die]> and <(Level) = [4]>> and <not <<(SpeedBoost?) = [1]> or <(JumpBoost?) = [1]>>>> then\n                set [coins v] to [18]\n            else\n                if <<<(EXIT) = [Die]> and <(Level) = [5]>> and <not <<(SpeedBoost?) = [1]> or <(JumpBoost?) = [1]>>>> then\n                    set [coins v] to [22]\n                else\n                    if <<<(EXIT) = [Die]> and <(Level) = [6]>> and <not <<(SpeedBoost?) = [1]> or <(JumpBoost?) = [1]>>>> then\n                        set [coins v] to [26]\n                    end\n                end\n            end\n        end\n    end\nend\n\nwait (pick random (5) to (8)) seconds\nrepeat (12)\n    next costume\nend\n\nwhen I receive [setup v]\nhide\nset [y v] to [0]\nset [x v] to [0]\nswitch costume to (costume2 v)\nif <(Level) = [1]> then\n    set [max coins v] to [6]\n    Clone x: [214] y: [6]\n    Clone x: [214] y: [-40]\n    Clone x: [464] y: [50]\n    Clone x: [464] y: [98]\n    Clone x: [849] y: [98]\n    Clone x: [919] y: [-30]\nelse\n    if <(Level) = [2]> then\n        set [max coins v] to [12]\n        Clone x: [30] y: [-17]\n        Clone x: [-10] y: [-17]\n        Clone x: [225] y: [240]\n        Clone x: [225] y: [200]\n        Clone x: [703] y: [-20]\n        Clone x: [703] y: [-60]\n    else\n        if <(Level) = [3]> then\n            set [max coins v] to [18]\n            Clone x: [30] y: [40]\n            Clone x: [-10] y: [40]\n            Clone x: [225] y: [240]\n            Clone x: [225] y: [200]\n            Clone x: [434] y: [370]\n            Clone x: [434] y: [330]\n        else\n            if <(Level) = [4]> then\n                set [max coins v] to [22]\n                Clone x: [-6] y: [200]\n                Clone x: [-6] y: [150]\n                Clone x: [810] y: [-70]\n                Clone x: [810] y: [-40]\n            else\n                if <(Level) = [5]> then\n                    set [max coins v] to [26]\n                    Clone x: [-6] y: [200]\n                    Clone x: [-6] y: [150]\n                    Clone x: [810] y: [-70]\n                    Clone x: [810] y: [-40]\n                else\n                    if <(Level) = [6]> then\n                        set [max coins v] to [30]\n                        Clone x: [-6] y: [200]\n                        Clone x: [-6] y: [150]\n                        Clone x: [810] y: [-70]\n                        Clone x: [810] y: [-40]\n                    end\n                end\n            end\n        end\n    end\nend\nset [y v] to [-99999999999]\n\nstop [all v]\n\n@Decor\n\ndefine Position (x) (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 [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\ngo to [back v] layer\ngo [forward v] (1) layers\n\nwhen flag clicked\nhide\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [y v] to [0]\nset [x v] to [0]\nif <(Level) = [1]> then\n    switch costume to (level 1_1 v)\n    Position x: [450] y: [0]\n    Position x: [450] y: [0]\nelse\n    if <(Level) = [2]> then\n        switch costume to (level 2_1 v)\n        Position x: [450] y: [0]\n        Position x: [450] y: [0]\n    else\n        if <(Level) = [3]> then\n            switch costume to (level 3_1 v)\n            Position x: [450] y: [0]\n            Position x: [450] y: [0]\n        else\n            if <(Level) = [4]> then\n                switch costume to (level 4-1 v)\n                Position x: [450] y: [0]\n                Position x: [450] y: [0]\n            else\n                if <(Level) = [5]> then\n                    switch costume to (level 5-1 v)\n                    Position x: [450] y: [0]\n                    Position x: [450] y: [0]\n                else\n                    if <(Level) = [6]> then\n                        switch costume to (level 6-1 v)\n                        Position x: [450] y: [0]\n                        Position x: [450] y: [0]\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Position x: (x) y: (y)\nhide\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\n@Mountains\n\ndefine Position x: (x) y: (y)\nhide\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\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-1 v)\nend\n\nwhen I receive [green flag v]\nhide\ngo to x: (0) y: (-95)\n\nshow\n\nwhen I receive [tick v]\ngo to [back v] layer\ngo to [back v] layer\ngo to [back v] layer\ngo to [back v] layer\nPosition (((x) - (SCROLL X)) / (5)) (((y) - (SCROLL Y)) / (5))\n\ndefine Position (x) (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\nwhen flag clicked\nhide\n\n@Thumb\n\nwhen flag clicked\nshow\ngo to [back v] layer\nclear graphic effects\nforever\n    point in direction ((90) + (([sin v] of ((timer) * (30)) ) * (5)))\nend\n\nwhen I receive [play game v]\nforever\n    show\n    go to [front v] layer\n    go [backward v] (1) layers\n    go to x: (0) y: (0)\n    set [ghost v] effect to (100)\nend\n\n@portal\n\nwhen I receive [tick v]\nswitch costume to (open v)\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <<<(costume [name v]) = [open]> and <touching (player v)?>> and <not <(Level) = [6]>>> then\n    set [exit v] to [Win]\nend\nif <<<(costume [number v]) = [1]> and <touching (player v)?>> and <(Level) = [6]>> then\n    broadcast (win v)\nend\n\nif <(COINS) = (MAX COINS)> then\nelse\n    switch costume to (closed v)\nend\n\ndefine position (x) (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 [green flag v]\nhide\ngo to [back v] layer\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nwait (0) seconds\nif <(Level) = [1]> then\n    Clone at x: [1050] y: [200]\nelse\n    if <(Level) = [2]> then\n        Clone at x: [1050] y: [200]\n    else\n        if <(Level) = [3]> then\n            Clone at x: [1050] y: [100]\n        else\n            if <(Level) = [4]> then\n                Clone at x: [1105] y: [80]\n            else\n                if <(Level) = [5]> then\n                    Clone at x: [1050] y: [80]\n                else\n                    if <(Level) = [6]> then\n                        Clone at x: [1062] y: [400]\n                    else\n                        set [x v] to [-99999]\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Clone at x: (x) y: (y)\nhide\nchange [x v] by (x)\nchange [y v] by (y)\n\nwhen flag clicked\nhide\n\nwhen I receive [play game v]\n\nif <<(costume [number v]) = [1]> and <touching (player v)?>> then\n\nforever\n\n@effects\n\nwhen flag clicked\nhide\nforever\n    create clone of (_myself_ v)\n    wait (pick random (0.2) to (0.3)) seconds\nend\n\nwhen I start as a clone\nshow\ngo to x: (pick random (230) to (-230)) y: (-160)\nset size to (pick random (50) to (90)) %\nset [x clone v] to (pick random (-2) to (2))\nset [y clone v] to (pick random (2) to (4))\nset [effects v] to [0]\nrepeat until <touching (_edge_ v)?>\n    change size by (([cos v] of ((Effects) * (100)) ) * (0.5))\n    change x by (x clone)\n    change y by (y clone)\n    change [effects v] by (0.1)\nend\ndelete this clone\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    go [backward v] (3) layers\nend\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\n@Menu Bar\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    go to [back v] layer\n    set [brightness v] effect to (0)\n    set [ghost v] effect to (70)\nend\n\n@Shop\n\nwhen I receive [play game v]\nshow\ngo to x: (-207) y: (158)\n\nwhen flag clicked\nhide\nset [shop v] to [Closed]\nforever\n    point in direction ((90) + (([sin v] of ((timer) * (500)) ) * (5)))\n    if <touching (mouse-pointer v)?> then\n        repeat until <(size) = [115]>\n            change size by (5)\n            change [brightness v] effect by (5)\n        end\n    else\n        repeat until <(size) = [100]>\n            change size by (-5)\n            change [brightness v] effect by (-5)\n        end\n    end\n    if <touching (mouse-pointer v)?> then\n        if <mouse down?> then\n            broadcast (Shop open v)\n            set [shop v] to [Open]\n            wait until <not <mouse down?>>\n        end\n    end\nend\n\n@Restart\n\nwhen I receive [play game v]\nshow\ngo to x: (-150) y: (158)\n\nwhen flag clicked\nhide\nforever\n    point in direction ((90) + (([sin v] of ((timer) * (500)) ) * (5)))\n    if <touching (mouse-pointer v)?> then\n        repeat until <(size) = [115]>\n            change size by (5)\n            change [brightness v] effect by (5)\n        end\n    else\n        repeat until <(size) = [100]>\n            change size by (-5)\n            change [brightness v] effect by (-5)\n        end\n    end\n    if <touching (mouse-pointer v)?> then\n        if <mouse down?> then\n            play sound [Wood Tap v] until done\n            set [exit v] to [die]\n        end\n    end\nend\n\n@shop\n\nwhen flag clicked\nchange [brightness v] effect by (25)\ngo to [front v] layer\ngo to [front v] layer\nhide\n\nwhen I receive [win v]\nhide\n\nwhen flag clicked\nswitch costume to (shop v)\n\nwhen flag clicked\ndelete this clone\n\nwhen I receive [shop open v]\nrepeat until <(size) = [100]>\n    change size by (((110) - (size)) / (3))\nend\nwait (1) seconds\n\nwhen I receive [shop close v]\nset [shop v] to [Closed]\n\nwhen flag clicked\nset [shop v] to [Closed]\nhide\nforever\n    if <(Shop) = [Open]> then\n        show\n    else\n        hide\n    end\n    if <key (space v) pressed?> then\n        set [shop v] to [Closed]\n        broadcast (Shop Close v)\n        hide\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\nwhen I receive [play game v]\nhide\nset [shop v] to [Closed]\n\n@Transtion\n\nwhen flag clicked\nhide\nforever\n    go to [front v] layer\n    go [forward v] (9999999999999999) layers\nend\n\nwhen I receive [setup v]\nshow\nwait (0.3) seconds\nhide\n\nwhen flag clicked\nset [skip? v] to [no]\nforever\n    if <(Skip?) = [yes]> then\n        show\n        set [skip? v] to [no]\n        wait (1.4) seconds\n        hide\n        wait until <not <(Skip?) = [yes]>>\n    end\nend\n\n@Spikes\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\ngo to [back v] layer\ngo to [back v] layer\ngo to [back v] layer\ngo to [back v] layer\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine Position (x) (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 [setup v]\nset [y v] to [0]\nset [x v] to [0]\nif <(Level) = [1]> then\n    switch costume to (level 1-1 v)\n    Clone x: [480] y: [0]\n    Clone x: [480] y: [0]\n    Clone x: [480] y: [0]\nelse\n    if <(Level) = [2]> then\n        switch costume to (level 2-1 v)\n        Clone x: [480] y: [0]\n        Clone x: [480] y: [0]\n        set [x v] to [-99999999]\n    else\n        if <(Level) = [3]> then\n            switch costume to (level 3-1 v)\n            Clone x: [480] y: [0]\n            Clone x: [480] y: [0]\n            set [x v] to [-99999999]\n        else\n            if <(Level) = [4]> then\n                switch costume to (level 4-1 v)\n                Clone x: [480] y: [0]\n                Clone x: [480] y: [0]\n                set [x v] to [-99999999]\n            else\n                if <(Level) = [5]> then\n                    switch costume to (level 5-1 v)\n                    Clone x: [480] y: [0]\n                    Clone x: [480] y: [0]\n                    set [x v] to [-99999999]\n                else\n                    if <(Level) = [6]> then\n                        switch costume to (level 6-1 v)\n                        Clone x: [480] y: [0]\n                        Clone x: [480] y: [0]\n                        set [x v] to [-99999999]\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Clone x: (x) y: (y)\nhide\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\n@Trampoline\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine position (x) (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\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nif <(Level) = [1]> then\nset [y v] to [-99999999999999999]\n\ndefine Clone at x: (x) y: (y)\nhide\nchange [x v] by (x)\nchange [y v] by (y)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nset size to (100) %\nswitch costume to (1 v)\ngo to [front v] layer\nforever\n    if <touching (player v)?> then\n        switch costume to (1 v)\n        repeat (5)\n            next costume\n        end\n        wait (0) seconds\n        repeat (5)\n            switch costume to ((costume [number v]) - (1))\n        end\n        switch costume to (1 v)\n        wait (0) seconds\n    end\nend\n\nwhen flag clicked\nhide\n\n@Win\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [win v]\nshow\n\n@Coin_counter\n\nwhen I start as a clone\nshow\nforever\n    go to x: (((clone#) * (15)) - (-180)) y: (155)\n    if <(length of (COINS)) < (clone#)> then\n        hide\n    else\n        show\n        switch costume to (letter (clone#) of (COINS))\n    end\nend\n\nwhen I receive [win v]\nhide\ndelete this clone\n\nwhen flag clicked\nhide\ndelete this clone\n\nwhen I receive [play game v]\nset size to (110) %\nset [clone# v] to [1]\nrepeat (30)\n    create clone of (_myself_ v)\n    change [clone# v] by (1)\nend\nhide\n\n@Coins:\n\nwhen flag clicked\nhide\n\nwhen I receive [play game v]\nshow\n\nwhen I receive [win v]\nhide\n\n@jumpboost\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    go to x: (-100) y: (-50)\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\n    if <(Shop) = [Open]> then\n        show\n    end\n    if <(Shop) = [Closed]> then\n        hide\n    end\n    if <touching (mouse-pointer v)?> then\n        set [touching? v] to [1]\n        set [brightness v] effect to (30)\n    else\n        set [touching? v] to [0]\n        clear graphic effects\n    end\n    if <<<touching (mouse-pointer v)?> and <mouse down?>> and <not <(JumpBoost?) = [1]>>> then\n        if <(COINS) > [9]> then\n            play sound [Register v] until done\n            change [coins v] by (-10)\n            set [jumpboost? v] to [1]\n            wait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n        end\n    end\nend\n\nchange [brightness v] effect by (25)\n\n@speedboost\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    go to x: (100) y: (-50)\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\n    if <(Shop) = [Open]> then\n        show\n    end\n    if <(Shop) = [Closed]> then\n        hide\n    end\n    if <touching (mouse-pointer v)?> then\n        set [touching? v] to [1]\n        set [brightness v] effect to (30)\n    else\n        set [touching? v] to [0]\n        clear graphic effects\n    end\n    if <<<touching (mouse-pointer v)?> and <mouse down?>> and <not <(SpeedBoost?) = [1]>>> then\n        if <(COINS) > [9]> then\n            play sound [Register v] until done\n            change [coins v] by (-10)\n            set [speedboost? v] to [1]\n            wait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n        end\n    end\nend\n\n@Shop Info2\n\nwhen flag clicked\ngo to [front v] layer\nhide\nforever\n    if <(Shop) = [Open]> then\n        if <(touching?) = [1]> then\n            go to (mouse-pointer v)\n            set [ghost v] effect to (30)\n            go to [front v] layer\n            show\n        else\n            hide\n        end\n    end\nend\n\nwhen I receive [shop close v]\nhide\n\n@Shop Info1\n\nwhen flag clicked\ngo to [front v] layer\nhide\nforever\n    if <(Shop) = [Open]> then\n        if <(Touching?) = [1]> then\n            go to (mouse-pointer v)\n            set [ghost v] effect to (30)\n            go to [front v] layer\n            show\n        else\n            hide\n        end\n    end\nend\n\nwhen I receive [shop close v]\nhide\n\n
Lava Islands\nA Scrolling Platformer\n\nHow to play\n➡ Use Arrow keys, WASD, or tap to use (Mobile)\n➡ Watch out for spikes and lava\n \nOther info\n➡ There are six levels (i think)\n➡ Collect coins to buy skins and powerups from the shop\n➡ Took roughly 30+ hours to make which was spread over about three weeks