Volcano: Scrolling platformer
@Stage\n\nwhen [down arrow v] key pressed\nset [mouse v] to (join ((mouse x) + (SCROLLX)) (join [                                                                                                   ] ((mouse y) + (SCROLLY))))\n\nwhen flag clicked\nforever\n    play sound [huh v] until done\nend\n\n@platform\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLLX)) ((y) - (SCROLLY))\n\nwhen I receive [setup v]\nshow\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (1 1 v)\n    create clone at X: [500] Y: [0]\n    create clone at X: [500] Y: [0]\n    create clone at X: [450] Y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (2 1 v)\n        create clone at X: [450] Y: [0]\n        create clone at X: [480] Y: [0]\n        create clone at X: [500] Y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (3 1 v)\n            create clone at X: [500] Y: [0]\n            create clone at X: [500] Y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (4 1 v)\n                create clone at X: [600] Y: [0]\n                create clone at X: [500] Y: [0]\n                create clone at X: [0] Y: [400]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (5 1 v)\n                    create clone at X: [700] Y: [0]\n                    create clone at X: [750] Y: [0]\n                else\n                    switch costume to (win v)\n                end\n            end\n        end\n    end\nend\n\ndefine create clone at X: (xpos) Y: (ypos)\ncreate clone of (_myself_ v)\nbroadcast (tick v)\nchange [x v] by (xpos)\nchange [y v] by (ypos)\nnext costume\n\nwhen I receive [reset v]\ndelete this clone\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 start as a clone\nshow\n\nwhen [s v] key pressed\nif <<(username) = [poliakoff]> and <not <(LEVEL) = [6]>>> then\n    set [exit v] to [win]\nend\n\nif <(costume [number v]) = [17]> then\n    change y by (10)\nend\n\nwhen flag clicked\npoint in direction (90)\n\ngo to x: () y: ()\n\n@lava\n\nwhen I receive [tick v]\nblock name ((y) - (SCROLLY))\n\ndefine block name (number or text)\nset [ghost v] effect to (30)\ngo to x: (0) y: (number or text)\nswitch costume to (costume1 v)\nshow\ngo to [front v] layer\nchange [y v] by (y speed)\nif <(y) > [-35]> then\n    change [y speed v] by (-0.2)\nelse\n    change [y speed v] by (0.2)\nend\n\nset y to (0)\n\nwhen I receive [reset v]\npoint in direction (90)\nset [y speed v] to [5]\nhide\nset [y v] to [-20]\n\nif <(number or text) = (y position)> then\n\n@jump monsters\n\ndefine position (x) (y)\ngo to [back v] layer\nswitch costume to (hit v)\ngo to x: (x) y: (y)\nif <(y speed) > [-1]> then\n    point in direction (90)\nelse\n    point in direction (-90)\nend\nif <touching (sprite1 v)?> then\n    set [exit v] to [die]\nend\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\nchange [y speed v] by (-1)\nif <(y speed) < [-30]> then\n    set [y speed v] to [30]\nend\nswitch costume to (costume1 v)\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [tick v]\nchange [y v] by (y speed)\nposition ((x) - (SCROLLX)) ((y) - (SCROLLY))\n\nwhen I receive [green flag v]\nhide\n\ndefine create clone at X: (xpos) Y: (ypos)\nset [x v] to (xpos)\nset [y v] to (ypos)\ngo to x: (250) y: (-151)\ncreate clone of (_myself_ v)\n\nbroadcast (tick v)\n\nwhen I receive [setup v]\nshow\nset [x v] to [0]\nset [y v] to [0]\nset [y speed v] to [10]\nif <(LEVEL) = [1]> then\n    create clone at X: [500] Y: [0]\n    create clone at X: [1125] Y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        create clone at X: [590] Y: [0]\n        create clone at X: [1200] Y: [100]\n        create clone at X: [1320] Y: [100]\n    else\n        if <(LEVEL) = [3]> then\n            create clone at X: [299] Y: [-100]\n            create clone at X: [1125] Y: [-30]\n        else\n            if <(LEVEL) = [4]> then\n                create clone at X: [890] Y: [0]\n            else\n                if <(LEVEL) = [5]> then\n                    create clone at X: [100] Y: [0]\n                    create clone at X: [1430] Y: [80]\n                    create clone at X: [1500] Y: [80]\n                    create clone at X: [1570] Y: [80]\n                else\n                end\n            end\n        end\n    end\nend\nset [x v] to [-1000]\nset [y v] to [0]\nshow\n\n@enemy!!\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [tick v]\nif <(LEVEL) > [4.5]> then\n    position (((x) + ((Added position) / (1.5))) - (SCROLLX)) ((y) - (SCROLLY))\nelse\n    position (((x) + (Added position)) - (SCROLLX)) ((y) - (SCROLLY))\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\ndefine create clone at X: (xpos) Y: (ypos)\nset [x v] to (xpos)\nset [y v] to (ypos)\ncreate clone of (_myself_ v)\nbroadcast (tick v)\n\nwhen I receive [setup v]\nshow\nset [x v] to [0]\nset [y v] to [0]\nset [added position v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (1 v)\n    create clone at X: [1465] Y: [-50]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (1 v)\n        create clone at X: [1000] Y: [105]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (1 v)\n        else\n            if <(LEVEL) = [5]> then\n                switch costume to (1 v)\n                create clone at X: [750] Y: [-105]\n            else\n                if <(LEVEL) = [6]> then\n                    switch costume to (1 v)\n                    create clone at X: [0] Y: [100]\n                end\n            end\n        end\n    end\nend\ncreate clone at X: [-100000] Y: [1000000000000000]\n\nwhen I start as a clone\nswitch costume to (1 v)\nset [added position v] to [120]\nforever\n    repeat (80)\n        change [added position v] by (-3)\n    end\n    set [added position v] to [-120]\n    repeat (80)\n        change [added position v] by (3)\n    end\n    set [added position v] to [120]\nend\n\ndefine clone die\nbroadcast (bounce player v)\nrepeat (4)\n    next costume\nend\n\nwait (0.001) seconds\n\nwhen I start as a clone\nforever\n    if <touching (sprite1 v)?> then\n        if <<([y position v] of [sprite1 v]) > ((y position) + (15))> and <([sy v] of [sprite1 v]) < [-1]>> then\n            clone die\n            delete this clone\n        else\n            set [exit v] to [die]\n        end\n    end\nend\n\n@portal\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <not <(costume [number v]) = [1]>> then\nend\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\n    set [portalshowing v] to [1]\nelse\n    hide\n    set [portalshowing v] to [0]\nend\nif <(costume [number v]) = [2]> then\n    turn left (3) degrees\n    set size to ((120) - (([abs v] of (direction) ) / (3))) %\nelse\n    if <(costume [number v]) = [3]> then\n        turn right (3) degrees\n        set size to ((120) - (([abs v] of (direction) ) / (3))) %\n    end\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [reset v]\nhide\nset [x v] to [-10000000]\nset [y v] to [0]\ndelete this clone\n\nwhen I receive [setup v]\nset size to (100) %\npoint in direction (90)\nswitch costume to (costume1 v)\nif <(LEVEL) = [1]> then\n    set [x v] to [1680]\n    set [y v] to [50]\nelse\n    if <(LEVEL) = [2]> then\n        set [x v] to [1600]\n        set [y v] to [0]\n    else\n        if <(LEVEL) = [3]> then\n            set [x v] to [1219]\n            set [y v] to [0]\n        else\n            if <(LEVEL) = [4]> then\n                set [x v] to [1250]\n                set [y v] to [600]\n            else\n                if <(LEVEL) = [5]> then\n                    set [x v] to [1800]\n                    set [y v] to [75]\n                end\n            end\n        end\n    end\nend\nswitch costume to (costume3 v)\ncreate clone of (_myself_ v)\nswitch costume to (costume2 v)\ncreate clone of (_myself_ v)\nswitch costume to (costume1 v)\n\nwhen I receive [tick v]\nposition ((x) - (SCROLLX)) ((y) - (SCROLLY))\n\nwhen flag clicked\nset [x v] to [-10000000]\nset [y v] to [0]\nhide\n\ngo to [front v] layer\n\nwhen I start as a clone\ngo to [front v] layer\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (0) y: (0)\nbroadcast (green flag v) and wait\nbroadcast (play game v) and wait\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [play game v]\nset [level v] to [1]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    game on\n    broadcast (tick v) and wait\n    repeat until <(EXIT) > []>\n        Tick\n        position\n        if <not <(EXIT) = [die]>> then\n            broadcast (tick v) and wait\n        end\n    end\n    if <(EXIT) = [die]> then\n        😢\n    else\n        win\n    end\n    set [exit v] to []\nend\n\ndefine game on\ngo to [front v] layer\npoint in direction (90)\nclear graphic effects\nset size to (50) %\nset [x v] to [0]\nset [y v] to [0]\nset [sy v] to [0]\nset [in air v] to [100000000000000000000000000000000000000000000000000]\nset [exit v] to []\nset [sx v] to [0]\nset [scrollx v] to [0]\nset [scrolly v] to [0]\nposition\nshow\n\ndefine Tick\ngo to [front v] layer\nsay []\nif <key (left arrow v) pressed?> then\n    change [sx v] by (-2)\nend\nif <key (right arrow v) pressed?> 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 x by (round (SX))\nend\nif <<key (up arrow v) pressed?> and <(in air) < [2]>> then\n    set [sy v] to [16]\nend\nchange [sy v] by (-2)\nif <(SY) < [-15]> then\n    set [sy v] to [-16]\nend\nChange y by (SY)\nif <(x) > [0]> then\n    set [scrollx v] to (x)\nend\nif <(x position) > [225]> then\n    set [x v] to ((SCROLLX) + (225))\nend\nif <(y) > [0]> then\n    set [scrolly v] to (y)\nelse\n    set [scrolly v] to [0]\nend\nif <[-175] > (y)> then\n    set [exit v] to [die]\nend\nif <touching color (#ff7400)?> then\n    set [exit v] to [die]\nend\nif <<touching (portal v)?> and <(x) > [100]>> then\n    set [exit v] to [win]\nend\nif <touching color (#ffee00)?> then\n    set [sy v] to [30]\n    set [in air v] to [10]\nend\nif <<touching color (#000000)?> and <not <key (up arrow v) pressed?>>> then\n    set [in air v] to [0]\nend\nif <(LEVEL) = [6]> then\n    set [scrollx v] to [0]\n    set [scrolly v] to [0]\nend\nposition\n\ndefine Change y by (gravity)\nchange [in air v] by (1)\nchange [y v] by (gravity)\nposition\nrepeat until <not <touching color (#ff0000)?>>\n    if <(gravity) > [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    set [sy v] to [0]\n    position\nend\ndie??\n\ndefine position\ngo to x: ((x) - (SCROLLX)) y: ((y) - (SCROLLY))\n\ndefine change x by (sx)\nchange [x v] by (sx)\nposition\nif <touching color (#ff0000)?> then\n    if <key (up arrow v) pressed?> then\n        if <(sx) > [0]> then\n            set [sx v] to [-8]\n        else\n            set [sx v] to [8]\n        end\n        set [in air v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <touching color (#ff0000)?>>\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 😢\nbroadcast (die v)\nset [exit v] to []\nhide\nclear graphic effects\nwait (0.5) seconds\nwait until <(die) = [0]>\nwait (0.5) seconds\n\ndefine win\nset rotation style [don't rotate v]\nrepeat (50)\n    go to [front v] layer\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)\n\nwait (0.5) seconds\n\nchange [ghost v] effect by (-100)\n\nwhen I receive [tick v]\n\nwhen I receive [bounce player v]\nset [sy v] to [10]\n\nif <key (up arrow v) pressed?> then\n\nwhen I receive [speedup v]\nset [sx v] to [70]\n\n\n\ndefine die??\nif <<touching (jump monsters v)?> or <touching (lava v)?>> then\n    set [exit v] to [die]\nend\n\n@die\n\nwhen flag clicked\nhide\n\nwhen I receive [die v]\nclone\nhide\n\ndefine clone\nhide\nset [die v] to [250]\nrepeat (250)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nset size to (100) %\nclear graphic effects\nset [speed v] to (pick random (18) to (45))\ngo to (sprite1 v)\npoint in direction (pick random (1) to (360))\nshow\nrepeat (20)\n    change y by ((speed) / (5))\n    move ((speed) / (1.5)) steps\n    change [ghost v] effect by (2)\n    change [speed v] by (-1)\n    if <<(x position) > [220]> or <(x position) < [-220]>> then\n        set [speed v] to (((x position) * (-1)) / (180))\n    end\nend\nset [y v] to [0]\nrepeat until <(y position) < [-175]>\n    change [y v] by (-1)\n    change y by (y)\nend\nchange [die v] by (-1)\ndelete this clone\n\n@orbs\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\nif <<<touching (sprite1 v)?> and <key (up arrow v) pressed?>> and <([in air v] of [sprite1 v]) < [2]>> then\n    set size to (400) %\nelse\n    change size by (((130) - (size)) / (6))\nend\n\nwhen I receive [tick v]\nposition ((x) - (SCROLLX)) ((y) - (SCROLLY))\n\ndefine clone at (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nset [x v] to [-1000]\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [-10000000]\nif <(LEVEL) = [4]> then\n    clone at [250] [-50]\n    clone at [500] [-10]\n    clone at [600] [50]\n    clone at [990] [100]\n    clone at [990] [175]\n    clone at [990] [250]\n    clone at [990] [325]\nelse\n    if <(LEVEL) = [5]> then\n        clone at [350] [0]\n        clone at [1030] [50]\n        clone at [1150] [50]\n    end\nend\n\n@bg\n\ndefine position (x) (y)\ngo to [back v] layer\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) - ((SCROLLX) / (2))) [0]\n\nwhen flag clicked\nset [x v] to [0]\nswitch costume to (costume1 v)\nrepeat (3)\n    create clone of (_myself_ v)\n    change [x v] by (480)\nend\n\n@thumbnail\n\nwhen flag clicked\nhide\n\nshow\ngo to [front v] layer\n\n
https://scratch.mit.edu/projects/468647664/ Sequel :)\n\n➡Use arrow keys to move \n➡5 levels of fun\n➡2 different types of enemies\n➡Rising and falling lava\n\nStay alert for more scrolling platfomers. When they are out, they will appear here https://scratch.mit.edu/studios/26709304/projects/\n\n\n                      ---------{Credits}-----------\nScrolling scripts: @griffpatch\nNintendo for music\nAll other by me