Scroling Platformer

Instructions: Use arrow keys to move jump over spikes and gaps.\n10❤completed\n20❤completed\n30❤completed\n40❤completed\n50❤completed\n100❤completed\n10 remixes completed

@Stage\n\n@Thumb nail!\n\nwhen flag clicked\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\n\ngo to [front v] layer\nset [ghost v] effect to (0)\nshow\n\nwhen flag clicked\nforever\n    play sound [F-777 - The Seven Seas v] until done\nend\n\n@exit portal\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <<(costume [name v]) = [open]> and <touching (player v)?>> then\n    set [exit v] to [win]\nend\n\nwhen I receive [set up v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(Level:) = [1]> then\n    switch costume to (open v)\n    Clone at x: [3335] y: [-35]\nelse\n    if <(Level:) = [2]> then\n        Clone at x: [3335] y: [-35]\n    else\n        if <(Level:) = [3]> then\n            Clone at x: [4045] y: [2010]\n        else\n            if <(Level:) = [4]> then\n                Clone at x: [4730] y: [-35]\n            else\n                if <(Level:) = [5]> then\n                    Clone at x: [6170] y: [-20]\n                else\n                    if <(Level:) = [6]> then\n                        Clone at x: [4739] y: [-20]\n                    else\n                        if <(Level:) = [bonus]> then\n                            Clone at x: [4739] y: [-20]\n                        end\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\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\n\n@RESET\n\nwhen this sprite clicked\nhide\nset [start level v] to (Level:)\nbroadcast (Play Game v)\n\nwhen I receive [level select in game v]\nhide\n\nwhen I receive [pause game v]\ngo to [front v] layer\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (costume2 v)\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        switch costume to (costume1 v)\n    end\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [back v]\nhide\n\n@grey tint\n\ngo to [front v] layer\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [level select v]\nshow\nset [ghost v] effect to (25)\n\nchange [ghost v] effect by (25)\n\nwhen I receive [play game v]\nhide\n\nwhen I receive [back v]\nhide\n\nwhen I receive [level select in game v]\nshow\nset [ghost v] effect to (25)\n\nwhen I receive [pause game v]\nshow\nset [ghost v] effect to (25)\n\n@play game\n\nwhen I receive [start screen v]\nshow\nset [start level v] to [1]\ngo to x: (8) y: (75)\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (costume2 v)\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        switch costume to (costume1 v)\n    end\nend\n\nwait (0.1) seconds\nswitch costume to (costume3 v)\nwait (0.1) seconds\nswitch costume to (costume2 v)\nwait (0.1) seconds\nswitch costume to (costume4 v)\nwait (0.1) seconds\n\nwhen I receive [intro v]\nhide\n\nwhen this sprite clicked\nhide\nbroadcast (Play Game v) and wait\n\nwhen I receive [level select v]\nhide\n\nwhen I receive [play game v]\nshow variable [deaths: v]\nshow variable [level: v]\n\n@Start screen\n\ngo to x: (0) y: (0)\n\nwhen I receive [intro v]\nhide\n\nwhen I receive [start screen v]\nshow\n\nwhen I receive [play game v]\nhide\n\n@Text & fake objects\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [set up v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(Level:) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\nelse\n    if <(Level:) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [250]\n        Clone at x: [450] y: [-250]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n    else\n        if <(Level:) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [450] y: [0]\n            Clone at x: [0] y: [350]\n            Clone at x: [550] y: [350]\n            Clone at x: [0] y: [-700]\n            Clone at x: [450] y: [0]\n            Clone at x: [450] y: [0]\n            Clone at x: [450] y: [0]\n            Clone at x: [0] y: [250]\n            Clone at x: [0] y: [250]\n            Clone at x: [0] y: [250]\n            Clone at x: [0] y: [250]\n            Clone at x: [0] y: [250]\n            Clone at x: [0] y: [250]\n            Clone at x: [400] y: [0]\n            Clone at x: [0] y: [250]\n            Clone at x: [250] y: [250]\n            Clone at x: [450] y: [0]\n            Clone at x: [450] y: [0]\n        else\n            if <(Level:) = [4]> then\n                switch costume to (level 4 1 v)\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n            else\n                if <(Level:) = [5]> then\n                    switch costume to (level 5 1 v)\n                    Clone at x: [450] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [0] y: [600]\n                    Clone at x: [650] y: [-600]\n                    Clone at x: [550] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [550] y: [0]\n                else\n                    if <(Level:) = [6]> then\n                        switch costume to (level 6 1 v)\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                    else\n                        if <(Level:) = [bonus]> then\n                            switch costume to (level bonus 1 v)\n                        end\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\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\n@Intro p:1\n\nwhen I receive [intro v]\nbroadcast (Start screen v)\n\nshow\nset size to (100) %\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nwait (0.1) seconds\nswitch costume to (costume2 v)\nwait (0.1) seconds\nswitch costume to (costume5 v)\nwait (0.1) seconds\nswitch costume to (costume6 v)\nwait (0.1) seconds\nswitch costume to (costume7 v)\nwait (0.1) seconds\nswitch costume to (costume8 v)\nwait (0.1) seconds\nswitch costume to (costume3 v)\nwait (3) seconds\nrepeat (2)\n    switch costume to (costume9 v)\n    wait (0.1) seconds\n    change size by (-5)\n    switch costume to (costume4 v)\n    wait (0.1) seconds\n    change size by (-5)\n    switch costume to (costume10 v)\n    wait (0.1) seconds\n    change size by (-5)\n    switch costume to (costume11 v)\n    wait (0.1) seconds\n    change size by (-5)\n    switch costume to (costume12 v)\n    wait (0.1) seconds\n    change size by (-5)\n    switch costume to (costume13 v)\n    wait (0.1) seconds\n    change size by (-5)\n    switch costume to (costume14 v)\n    wait (0.1) seconds\n    change size by (-5)\n    switch costume to (costume15 v)\n    wait (0.1) seconds\n    change size by (-5)\n    switch costume to (costume16 v)\n    wait (0.1) seconds\n    change size by (-5)\n    switch costume to (costume17 v)\n    wait (0.1) seconds\n    change size by (-5)\nend\nhide\n\nwhen I receive [intro v]\n\nforever\n    play sound [Outro music v] until done\nend\n\n@danger( lava spikes etc)\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [set up v]\nhide\ngo to [back v] layer\nset [x v] to [0]\nset [y v] to [0]\nif <(Level:) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\nelse\n    if <(Level:) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n    else\n        if <(Level:) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [450] y: [0]\n            Clone at x: [0] y: [250]\n            Clone at x: [550] y: [0]\n            Clone at x: [0] y: [-250]\n            Clone at x: [450] y: [0]\n            Clone at x: [450] y: [0]\n            Clone at x: [450] y: [0]\n            Clone at x: [0] y: [250]\n            Clone at x: [0] y: [250]\n            Clone at x: [0] y: [250]\n        else\n            if <(Level:) = [4]> then\n                switch costume to (level 4 1 v)\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n            else\n                if <(Level:) = [5]> then\n                    go to [front v] layer\n                    switch costume to (level 5 1 v)\n                    Clone at x: [450] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [550] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [100] y: [100]\n                    Clone at x: [500] y: [0]\n                    Clone at x: [500] y: [0]\n                    Clone at x: [700] y: [-100]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [450] y: [0]\n                else\n                    if <(Level:) = [6]> then\n                        go to [back v] layer\n                        switch costume to (level 6 1 v)\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                    else\n                        if <(Level:) = [bonus]> then\n                            switch costume to (level bonus 1 v)\n                        end\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\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\n@Player\n\nwhen flag clicked\nbroadcast (Green Flag v) and wait\nbroadcast (Intro v)\n\nbroadcast (Play Game v) and wait\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\nset [deaths: v] to [0]\n\nwhen I receive [play game v]\nset [easter egg costume switch v] to [1]\nset [level: v] to (Start level)\nforever\n    broadcast (RESET v)\n    broadcast (Set up v)\n    Game On\n    repeat until <(EXIT) > [50]>\n        Tick\n        broadcast (Tick v) and wait\n    end\n    if <(EXIT) = [win]> then\n        Game - win\n    else\n        Game - Die\n    end\nend\n\ndefine Game On\nset [x v] to [0]\nset [y v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [speed y 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\nif <<<mouse down?> and <(mouse x) < [0]>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n    change [sx v] by (-3)\nend\nif <<<mouse down?> and <(mouse x) > [0]>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n    change [sx v] by (3)\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 <<<mouse down?> and <(mouse y) > [0]>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n    if <(In air) < [4]> then\n        set [speed y v] to [16]\n    end\nend\nif <(Speed y) > [-15]> then\n    change [speed y v] by (-2)\nend\nChange Player y by (Speed y)\nTest - die\nset [scroll x v] to (x)\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (10)))\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\nif <(y) < [-180]> then\n    set [exit v] to [die]\nend\n\npoint in direction (-90)\n\npoint in direction (90)\n\ndefine Change Player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (platform 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 [speed y v] to [0]\nend\n\ndefine Change Player X by (sx)\nchange [x v] by (sx)\nPosition\nif <touching (platform v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (platform v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    if <<<mouse down?> and <(mouse y) > [0]>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        if <(sx) > [0]> then\n            set [sx v] to [-16]\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 (platform 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 [exit v] to []\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nhide\nwait (0.5) seconds\nchange [deaths: v] by (1)\n\ndefine Test - die\nif <touching (danger\( lava spikes etc\) v)?> then\n    set [exit v] to [die]\nend\n\ndefine Game - win\nset rotation style [all around v]\nrepeat (50)\n    point towards (exit portal v)\n    turn right (65) degrees\n    move ((distance to [exit portal v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (2)\nend\nset rotation style [left-right v]\nhide\nif <(Level:) < [6]> then\n    change [level: v] by (1)\n    wait (1) seconds\nelse\n    set [level: v] to [bonus]\nend\n\nwhen flag clicked\nforever\n    if <<<mouse down?> and <(mouse y) < [-100]>> or <<key (down arrow v) pressed?> or <key (s v) pressed?>>> then\n        switch costume to (2 duck v)\n    end\n    if <not <<<mouse down?> and <(mouse y) < [-100]>> or <<key (down arrow v) pressed?> or <key (s v) pressed?>>>> then\n        switch costume to (easter egg costume switch)\n        if <touching (pirates flag \(easter egg\) v)?> then\n            set [easter egg costume switch v] to [2]\n        end\n    end\nend\n\nwhen I receive [play game v]\nforever\n    if <touching (statue v)?> then\n        think [What an odd looking man] for (4) seconds\n    end\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\n@Platform\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [set up v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(Level:) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\nelse\n    if <(Level:) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n    else\n        if <(Level:) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [450] y: [0]\n            Clone at x: [0] y: [250]\n            Clone at x: [550] y: [0]\n            Clone at x: [0] y: [-250]\n            Clone at x: [450] y: [0]\n            Clone at x: [450] y: [0]\n            Clone at x: [450] y: [0]\n            Clone at x: [0] y: [250]\n            Clone at x: [0] y: [250]\n            Clone at x: [0] y: [250]\n            Clone at x: [0] y: [250]\n            Clone at x: [0] y: [250]\n            Clone at x: [400] y: [250]\n            Clone at x: [0] y: [250]\n            Clone at x: [250] y: [250]\n            Clone at x: [450] y: [0]\n            Clone at x: [450] y: [0]\n        else\n            if <(Level:) = [4]> then\n                switch costume to (level 4 1 v)\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n            else\n                if <(Level:) = [5]> then\n                    switch costume to (level 5 1 v)\n                    Clone at x: [450] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [0] y: [450]\n                    Clone at x: [650] y: [-450]\n                    Clone at x: [550] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [550] y: [0]\n                    Clone at x: [750] y: [0]\n                    Clone at x: [550] y: [0]\n                    Clone at x: [-1300] y: [400]\n                    Clone at x: [300] y: [100]\n                    Clone at x: [300] y: [-100]\n                    Clone at x: [1350] y: [-400]\n                    Clone at x: [450] y: [0]\n                else\n                    if <(Level:) = [6]> then\n                        switch costume to (level 6 1 v)\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                    else\n                        if <(Level:) = [bonus]> then\n                            switch costume to (level bonus 1 v)\n                            Clone at x: [450] y: [0]\n                            Clone at x: [450] y: [0]\n                            Clone at x: [450] y: [0]\n                            Clone at x: [450] y: [0]\n                            Clone at x: [450] y: [0]\n                            Clone at x: [450] y: [0]\n                            Clone at x: [450] y: [0]\n                            Clone at x: [450] y: [0]\n                        end\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\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\n