Floating Islands (A mobile friendly scrolling platformer) #games
@Stage\n\nwhen I receive [tick v]\nswitch backdrop to (blue sky 2  v)\n\n@Blank\n\n@Player\n\ndefine Game - Die\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nhide\nwait (0.5) seconds\nset [exit v] to []\n\nwhen flag clicked\nbroadcast (Start Screen v)\n\nwhen I receive [green flag v]\nset size to (100) %\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    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\ndefine game on\nset [x v] to [0]\nset [y v] to [100]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [sy v] to [0]\nset [sx v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset [jetpack2 v] to [0]\nshow variable [timer v]\npoint in direction (90)\nset size to (135) %\nshow\nset [ghost v] effect to (0)\nif <(Sad) = [1]> then\n    switch costume to (center_sad v)\nelse\n    switch costume to (center_happy v)\nend\n\ndefine Tick\ngo to x: (0) y: (0)\nset size to (135) %\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<(mouse x) < (x position)> and <mouse down?>>> then\n    set [left or right v] to [left]\n    if <(Sad) = [1]> then\n        if <(jetpack2) = [1]> then\n            switch costume to (jetpack_left_sad v)\n            Cange player x by [-12]\n        else\n            switch costume to (left2 v)\n            change [sx v] by (join [-] (Hardness))\n        end\n    else\n        if <(jetpack2) = [1]> then\n            switch costume to (jetpack_left_happy v)\n            Cange player x by [-12]\n        else\n            switch costume to (left v)\n            change [sx v] by (join [-] (Hardness))\n        end\n    end\nend\nset [sx v] to ((sx) * (0.8))\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<(mouse x) > (x position)> and <mouse down?>>> then\n    set [left or right v] to [right]\n    if <(Sad) = [1]> then\n        if <(jetpack2) = [1]> then\n            switch costume to (jetpack_right_sad v)\n            Cange player x by [12]\n        else\n            switch costume to (right2 v)\n            change [sx v] by (Hardness)\n        end\n    else\n        if <(jetpack2) = [1]> then\n            switch costume to (jetpack_right_happy v)\n            change [sx v] by (Hardness)\n        else\n            switch costume to (right v)\n            change [sx v] by (Hardness)\n        end\n    end\nend\nif <([abs v] of (sx) ) > [0.9]> then\n    Cange player x by (round (sx))\nend\nif <<<key (up arrow v) pressed?> or <<key (space v) pressed?> or <key (w v) pressed?>>> or <<(mouse y) > (y position)> and <mouse down?>>> then\n    if <(in air) < [4]> then\n        set [sy v] to [18]\n    end\nend\nif <(sy) > [-15]> then\n    change [sy v] by (-2)\nend\nchange player y by (sy)\nTest - Die\nif <(x) > [-125]> then\n    change [scroll x v] by (round (((x) - (SCROLL X)) / (10)))\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\nFace look\nif <(y) < [-180]> then\n    set [exit v] to [die]\nend\n\ndefine change player y by (sy)\nchange [y v] by (sy)\nif <not <<(letter (1) of (costume [name v])) = [J]> and <<(letter (2) of (costume [name v])) = [e]> and <(letter (3) of (costume [name v])) = [t]>>>> then\n    change [in air v] by (1)\nend\nPosition\nrepeat until <not <<touching (platform v)?> or <touching (bridge 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 Cange player x by (sx)\nchange [x v] by (sx)\nPosition\nif <<touching (platform v)?> or <touching (bridge v)?>> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <<touching (platform v)?> or <touching (bridge v)?>>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<(mouse y) > (y position)> and <mouse down?>>> 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        broadcast (Walljump v)\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <<touching (platform v)?> or <touching (bridge 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 Test - Die\nif <touching (lava v)?> then\n    broadcast (Die Animation v)\n    if <(Sad) = [0]> then\n        switch costume to (center_happy v)\n    end\n    if <(Sad) = [1]> then\n        switch costume to (center_sad v)\n    end\n    set [exit v] to [die]\nend\n\ndefine Face look\nif <key (g v) pressed?> then\n    set [sad v] to [1]\n    switch costume to (center_sad v)\nend\nif <key (h v) pressed?> then\n    set [sad v] to [0]\n    switch costume to (center_happy v)\nend\nif <(jetpack2) = [1]> then\n    if <(Sad) = [1]> then\n        if <(Left or Right) = [left]> then\n            switch costume to (jetpack_left_sad v)\n        end\n        if <(Left or Right) = [right]> then\n            switch costume to (jetpack_right_sad v)\n        end\n    end\n    if <(Sad) = [0]> then\n        if <(Left or Right) = [left]> then\n            switch costume to (jetpack_left_happy v)\n        end\n        if <(Left or Right) = [right]> then\n            switch costume to (jetpack_right_happy v)\n        end\n    end\nend\n\ndefine Game - Win\nbroadcast (Next level v)\nbroadcast (Reset darkness v)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nchange [level v] by (1)\nif <(Sad) = [1]> then\n    switch costume to (center_sad v)\nelse\n    switch costume to (center_happy v)\nend\nwait (1) seconds\n\nwhen I receive [tick v]\nset [player x v] to (x)\nset [player y v] to (y)\n\nwhen flag clicked\nforever\n    if <<touching (bounce v)?> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        set [sy v] to [33]\n    else\n        if <touching (bounce v)?> then\n            set [sy v] to [32]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <<touching (bouncehigh v)?> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        set [sy v] to [48]\n    else\n        if <touching (bouncehigh v)?> then\n            set [sy v] to [47]\n        end\n    end\nend\n\nwhen I receive [tick v]\ncreate clone of (tail v)\n\nset [hardness v] to [1.9]\n\nwhen flag clicked\nset [timer2 v] to [0.1]\nforever\n    set [timer2 v] to (timer)\nend\n\nwhen I receive [play game v]\nset [pitch v] effect to (0)\nrepeat until <(Level) = [3]>\n    play sound [Emotional Piano v] until done\nend\n\nwhen flag clicked\nhide variable [timer v]\nforever\n    if <(start timer) = [1]> then\n        set [timer v] to [0]\n        forever\n            wait (0.1) seconds\n            change [timer v] by (0.1)\n        end\n    end\nend\n\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 <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<(mouse y) > (y position)> and <mouse down?>>> 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\nend\n\n@Platform\n\nwhen I receive [start screen v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset size to (100) %\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: [360] y: [0]\n    Clone at x: [300] y: [100]\n    Clone at x: [400] y: [0]\n    Clone at x: [500] y: [200]\n    Clone at x: [-100] y: [700]\n    Clone at x: [500] y: [700]\n    Clone at x: [-1100] y: [800]\n    Clone at x: [-450] y: [1000]\n    Portal clone at x: [424] y: [1540]\n    go [forward v] (5) layers\nelse\n    if <(Level) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [400] y: [-100]\n        Clone at x: [400] y: [100]\n        Clone at x: [-300] y: [300]\n        Clone at x: [400] y: [800]\n        set size to (200) %\n        Clone at x: [650] y: [510]\n        set size to (100) %\n        Clone at x: [600] y: [400]\n        Clone at x: [360] y: [200]\n        Portal clone at x: [2620] y: [275]\n    else\n    end\nend\n\nClone at x: [400] y: [100]\nset size to (100) %\n\ndefine position (x) (y)\nset size to (100) %\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)\nset [y v] to (y)\nnext costume\n\ndefine Portal clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nswitch costume to (portal clone v)\ngo to [back v] layer\nshow\nhide\nset [x v] to (x)\nset [y v] to (y)\n\nPortal clone at x: [150] y: [75]\n\n@Collectables\n\nwhen I receive [start screen v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    change [points v] by (1)\n    broadcast (Show coin v)\n    if <(POINTS) = (Collected Max)> then\n        broadcast (Open Portal v)\n    end\n    delete this clone\nend\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nset [collected max v] to [0]\nswitch costume to (collectable v)\nset [points v] to [0]\nif <(Level) = [1]> then\n    Clone at x: [180] y: [100]\n    Clone at x: [380] y: [30]\n    Clone at x: [660] y: [190]\n    Clone at x: [1250] y: [275]\n    Clone at x: [1729] y: [400]\n    Clone at x: [1936] y: [826]\n    Clone at x: [913] y: [838]\n    Clone at x: [840] y: [1010]\nelse\n    if <(Level) = [2]> then\n        Clone at x: [290] y: [-5]\n        Clone at x: [620] y: [160]\n        Clone at x: [647] y: [275]\n        Clone at x: [510] y: [410]\n        Clone at x: [1285] y: [921]\n        Clone at x: [1383] y: [765]\n        Clone at x: [1480] y: [608]\n        Clone at x: [1055] y: [915]\n        Clone at x: [2083] y: [495]\n    end\nend\nset [x v] to [-99999999]\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)\nchange [collected max v] by (1)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nforever\n    broadcast (Flip v)\n    wait (0.1) seconds\nend\n\nwhen I receive [flip v]\nnext costume\n\nClone at x: [715] y: [170]\n\n@Lava\n\nwhen I receive [start screen v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((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 (level 1 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [300] y: [100]\n    Clone at x: [400] y: [0]\n    Clone at x: [500] y: [200]\n    Clone at x: [-100] y: [700]\n    Clone at x: [500] y: [700]\n    Clone at x: [-1100] y: [800]\nelse\n    if <(Level) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [400] y: [-100]\n        Clone at x: [400] y: [100]\n        Clone at x: [-300] y: [300]\n        Clone at x: [250] y: [790]\n        Clone at x: [775] y: [590]\n        Clone at x: [625] y: [400]\n    else\n        if <(Level) = [3]> then\n            switch costume to (level 3 1 v)\n        end\n    end\nend\n\ndefine position (x) (y)\ngo to [back v] layer\ngo [forward v] (1) layers\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)\nset [y v] to (y)\nnext costume\n\n@Portal\n\nwhen I receive [start screen v]\nhide\n\nwhen I receive [tick v]\ngo to [back v] layer\ngo [forward v] (1) layers\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nset [portal x v] to (x)\nset [portal y v] to (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 (closed v)\n    Clone at x: [424] y: [1540]\nelse\n    if <(Level) = [2]> then\n        switch costume to (closed v)\n        Clone at x: [2620] y: [275]\n    else\n        if <(Level) = [3]> then\n            switch costume to (closed v)\n            Clone at x: [150] y: [75]\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\nwhen I receive [open portal v]\nswitch costume to (open v)\n\n\n\nwhen I receive [die animation v]\nforever\n    go to [back v] layer\n    go [forward v] (2) layers\nend\n\n@Portal2\n\nwhen I receive [start screen v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <<not <(costume [name v]) = [open]>> and <touching (player v)?>> then\n    broadcast (Portal Error v)\nend\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 (closed v)\n    Clone at x: [424] y: [1540]\nelse\n    if <(Level) = [2]> then\n        switch costume to (closed v)\n        Clone at x: [2620] y: [275]\n    else\n        if <(Level) = [3]> then\n            switch costume to (closed v)\n            Clone at x: [150] y: [75]\n        end\n    end\nend\n\ndefine position (x) (y)\ngo to [front v] layer\ngo [backward v] (4) layers\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\nwhen I receive [open portal v]\nswitch costume to (open v)\n\nwait until <(in air for all sprites) = [0]>\nask [Pasword?] and wait\n\n@Portal3\n\nwhen I receive [start screen 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 [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(Level) = [1]> then\n    switch costume to (closed v)\n    Clone at x: [424] y: [1540]\nelse\n    if <(Level) = [2]> then\n        switch costume to (closed v)\n        Clone at x: [2620] y: [275]\n    else\n        if <(Level) = [3]> then\n            switch costume to (closed v)\n            Clone at x: [150] y: [75]\n        end\n    end\nend\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 [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\n\nwait until <(in air for all sprites) = [0]>\nask [Pasword?] and wait\n\nwhen I receive [open portal v]\nswitch costume to (open v)\n\n\n\n@Things\n\nwhen I receive [start screen v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\ngo to [back v] layer\nset size to (100) %\nset [ghost v] effect to (15)\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: [360] y: [0]\n    Clone at x: [300] y: [150]\n    Clone at x: [400] y: [150]\n    Clone at x: [500] y: [200]\n    Clone at x: [-100] y: [700]\n    Clone at x: [500] y: [700]\n    Clone at x: [-1100] y: [800]\n    Clone at x: [-450] y: [1000]\nelse\n    if <(Level) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [400] y: [-100]\n        Clone at x: [400] y: [100]\n        Clone at x: [400] y: [100]\n        Clone at x: [100] y: [925]\n        set size to (450) %\n        Clone at x: [650] y: [510]\n        set size to (100) %\n        Clone at x: [-300] y: [500]\n    else\n        if <(Level) = [3]> then\n            switch costume to (level 3 1 v)\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)\nset [y v] to (y)\nnext costume\n\n@Backround\n\nwhen I receive [setup v]\nshow\n\nwhen I receive [tick v]\ngo to x: (0) y: (0)\ngo to [back v] layer\n\n@Falling down thing\n\nwhen I receive [die animation v]\ngo to x: (0) y: (400)\ngo to [front v] layer\nswitch costume to (costume2 v)\nshow\nrepeat until <(y position) < [10]>\n    go to [front v] layer\n    Animate\nend\ngo to x: (0) y: (0)\nwait (1) seconds\nhide\n\ndefine Animate\nchange y by (-10)\n\nwhen I receive [tick v]\ngo to [front v] layer\n\nwhen I receive [setup v]\nhide\n\nwhen I receive [next level v]\nif <(Level) < [2]> then\n    go to x: (0) y: (400)\n    go to [front v] layer\n    switch costume to (costume3 v)\n    show\n    repeat until <(y position) < [10]>\n        go to [front v] layer\n        Animate\n    end\n    go to x: (0) y: (0)\n    wait (1) seconds\n    hide\nelse\n    if <(Level) > [1]> then\n        go to x: (0) y: (400)\n        go to [front v] layer\n        switch costume to (costume4 v)\n        show\n        repeat until <(y position) < [10]>\n            go to [front v] layer\n            Animate\n        end\n        go to x: (0) y: (0)\n        wait (1) seconds\n        hide\n    end\nend\n\n@Coins\n\nwhen I receive [setup v]\ngo to x: (155) y: (159)\nshow\n\nwhen I receive [tick v]\ngo to [front v] layer\ngo [backward v] (4) layers\nset [collected v] to (join (POINTS) (join [/] (Collected Max)))\n\n@messages\n\nwhen I receive [tick v]\ngo to [front v] layer\ngo to x: (0) y: (150)\n\nwhen I receive [portal error v]\nswitch costume to (portal error v)\nrepeat (25)\n    change [ghost v] effect by (-4)\nend\nrepeat (25)\n    change [ghost v] effect by (4)\nend\n\nwhen I receive [setup v]\nhide\nset [ghost v] effect to (100)\nshow\n\nwhen I receive [walljump v]\nif <not <(walljump) = [1]>> then\n    switch costume to (walljump v)\n    repeat (25)\n        change [ghost v] effect by (-4)\n    end\n    repeat (25)\n        change [ghost v] effect by (4)\n    end\n    set [walljump v] to [1]\nend\n\nwhen I receive [start screen v]\nset [walljump v] to [0]\n\nwhen I receive [next level v]\nwait (1.5) seconds\nbroadcast (New level message v)\n\nwhen I receive [new level message v]\nif <(Level) = [2]> then\n    switch costume to (new level message v)\n    repeat (25)\n        change [ghost v] effect by (-4)\n    end\n    wait (1) seconds\n    repeat (25)\n        change [ghost v] effect by (4)\n    end\nend\n\nwhen [timer v] > (Timer2)\nhide\nhide variable [timer v]\n\n@Bounce\n\nwhen I receive [start screen v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\ngo to [front v] layer\ngo [backward v] (10) layers\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (normal v)\nif <(Level) = [1]> then\n    Clone at x: [1080] y: [7]\n    Clone at x: [770] y: [807]\nelse\n    Clone at x: [480] y: [-90]\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)\ncreate clone of (_myself_ v)\n\nwhen I receive [tick v]\nif <touching (player v)?> then\n    switch costume to (bounce v)\nelse\n    switch costume to (normal v)\nend\n\n@BounceHigh\n\nwhen I receive [start screen v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\ngo to [back v] layer\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (normal v)\nif <(Level) = [1]> then\n    Clone at x: [1725] y: [217]\n    Clone at x: [370] y: [1007]\nelse\n    Clone at x: [425] y: [310]\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)\ncreate clone of (_myself_ v)\n\nwhen I receive [tick v]\nif <touching (player v)?> then\n    switch costume to (bounce v)\nelse\n    switch costume to (normal v)\nend\n\n@tail\n\nwhen I start as a clone\nset size to (30) %\nset [ghost v] effect to (20)\nshow\ngo to (player v)\nset [tail x v] to ([x v] of [player v])\nset [y v] to ([y v] of [player v])\ngo to [front v] layer\ngo [backward v] (9) layers\nrepeat (10)\n    position ((tail x) - (SCROLL X)) ((y) - (SCROLL Y))\n    change size by (-2)\n    change [ghost v] effect by (7)\nend\nwait (0.0001) seconds\ndelete this clone\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\n\nwhen I receive [start screen v]\nhide\n\n@make bridge\n\nwhen I receive [start screen v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\ngo to [back v] layer\ngo [forward v] (5) layers\nset [ghost v] effect to (0)\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: [360] y: [0]\n    Clone at x: [300] y: [150]\n    Clone at x: [400] y: [150]\n    Clone at x: [500] y: [200]\n    Clone at x: [-100] y: [700]\n    Clone at x: [500] y: [700]\nelse\n    if <(Level) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [240] y: [-250]\n        Clone at x: [-200] y: [-900]\n        Clone at x: [-200] y: [-305]\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)\nset [y v] to (y)\nnext costume\n\nwhen I receive [tick v]\nif <touching (player v)?> then\n    broadcast (Show bridge v) and wait\nend\n\n@bridge\n\nwhen I receive [start screen v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [show v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nset size to (100) %\ngo to [back v] layer\ngo [forward v] (10) layers\nif <(Level) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [300] y: [100]\n    Clone at x: [400] y: [0]\n    Clone at x: [500] y: [200]\n    Clone at x: [-100] y: [700]\n    Clone at x: [500] y: [700]\n    Portal clone at x: [1380] y: [100]\n    go [forward v] (5) layers\nelse\n    if <(Level) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [240] y: [-250]\n        Clone at x: [200] y: [-700]\n        Clone at x: [-600] y: [-305]\n    end\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    if <(show) = [1]> then\n        show\n    else\n        if <(show) = [0]> then\n            hide\n        end\n    end\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)\nset [y v] to (y)\nnext costume\n\nwhen I receive [setup v]\n\ndefine Portal clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\ngo to [back v] layer\nset [x v] to (x)\nset [y v] to (y)\nnext costume\n\nwhen I receive [show bridge v]\nset [show v] to [1]\n\n@bridge2\n\nwhen I receive [start screen v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [show v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nset size to (100) %\ngo to [back v] layer\ngo [forward v] (10) layers\nif <(Level) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [300] y: [100]\n    Clone at x: [400] y: [0]\n    Clone at x: [500] y: [200]\n    Clone at x: [-100] y: [700]\n    Clone at x: [500] y: [700]\n    Portal clone at x: [1380] y: [100]\n    go [forward v] (5) layers\nelse\n    if <(Level) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [240] y: [-250]\n        Clone at x: [200] y: [-700]\n        Clone at x: [-600] y: [-305]\n    end\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    if <(show) = [1]> then\n        show\n    else\n        if <(show) = [0]> then\n            hide\n        end\n    end\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)\nset [y v] to (y)\nnext costume\n\ndefine Portal clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\ngo to [back v] layer\nset [x v] to (x)\nset [y v] to (y)\nnext costume\n\nwhen I receive [show bridge v]\nset [show v] to [1]\n\n@Color things\n\nwhen I receive [start screen v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\ngo to [back v] layer\nset size to (100) %\nset [ghost v] effect to (0)\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: [360] y: [0]\n    Clone at x: [300] y: [150]\n    Clone at x: [400] y: [150]\n    Clone at x: [500] y: [200]\n    Clone at x: [-100] y: [700]\n    Clone at x: [500] y: [700]\n    Clone at x: [-1100] y: [800]\n    Clone at x: [-450] y: [1000]\nelse\n    if <(Level) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [400] y: [-100]\n        Clone at x: [400] y: [100]\n        Clone at x: [400] y: [100]\n        Clone at x: [50] y: [925]\n        set size to (450) %\n        Clone at x: [650] y: [510]\n        set size to (100) %\n        Clone at x: [-300] y: [500]\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)\nset [y v] to (y)\nnext costume\n\n@Summary\n\nwhen I receive [tick v]\ngo to x: (0) y: (0)\nif <(Level) > [2]> then\n    broadcast (Win v)\n    set [win v] to [1]\n    set [start timer v] to [0]\n    stop [all v]\nend\n\nwhen I receive [win v]\nset [your time v] to (Timer)\nhide variable [timer v]\nif <(Timer) < (☁ High score)> then\n    set [☁ high score v] to (Timer)\n    set [high score? v] to [1]\nend\nif <(High score?) = [1]> then\n    show variable [your time v]\n    switch costume to (costume2 v)\n    go to [front v] layer\n    go [backward v] (1) layers\n    show\nelse\n    if <(High score?) = [0]> then\n        set [updated 3rd september 2021 v] to ((round ((☁ High score) * (10))) / (10))\n        show variable [your time v]\n        show variable [updated 3rd september 2021 v]\n        switch costume to (costume1 v)\n        go to [front v] layer\n        go [backward v] (1) layers\n        show\n    end\nend\n\nwhen I receive [start screen v]\nhide\nset [win v] to [0]\nset [your time v] to [0]\nhide variable [your time v]\nhide variable [☁ high score v]\nhide variable [updated 3rd september 2021 v]\n\nwhen flag clicked\nset [high score? v] to [0]\nswitch costume to (costume1 v)\n\n@Thumbnail\n\nwhen [timer v] > (Timer2)\nif <(win) = [0]> then\n    show\n    go to [front v] layer\nend\n\nwhen I receive [play game v]\nhide\n\nwhen I receive [start screen v]\nshow\ngo to [front v] layer\ngo [backward v] (2) layers\n\n@Button\n\nwhen flag clicked\ngo to [front v] layer\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to ((size) + (((125) - (size)) / (6))) %\n        set [ghost v] effect to (3)\n    else\n        set size to ((size) + (((99) - (size)) / (3))) %\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen flag clicked\nforever\n    go to x: ((mouse x) / (50)) y: ((mouse y) / (50))\nend\n\nwhen I receive [start screen v]\nset [start timer v] to [0]\nforever\n    if <(start timer) = [0]> then\n        if <(show instructions) = [0]> then\n            if <<<touching (mouse-pointer v)?> and <mouse down?>> or <key (space v) pressed?>> then\n                set [start timer v] to [1]\n                set [timer v] to [0]\n                broadcast (Green Flag v)\n                broadcast (Play Game v)\n                hide\n                go to x: (-1000000) y: (-1000000)\n            end\n        end\n    end\nend\n\n@Instruction button\n\nwhen I receive [start screen v]\ngo to [front v] layer\nset size to (80) %\nshow\ngo to x: (0) y: (-100)\nforever\n    if <(start timer) = [0]> then\n        if <touching (mouse-pointer v)?> then\n            set size to ((size) + (((105) - (size)) / (6))) %\n            set [ghost v] effect to (3)\n        else\n            set size to ((size) + (((79) - (size)) / (3))) %\n            set [ghost v] effect to (0)\n        end\n    end\nend\n\nwhen I receive [start screen v]\nforever\n    if <(start timer) = [0]> then\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            hide\n            broadcast (Instructions v)\n        end\n    end\nend\n\nwhen I receive [instructions v]\nforever\n    if <(start timer) = [0]> then\n        if <(show instructions) = [1]> then\n            hide\n        else\n            show\n        end\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(start timer) = [1]> then\n        hide\n    end\nend\n\n@Instructions\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen flag clicked\nforever\n    if <(start timer) = [0]> then\n        if <(show instructions) = [0]> then\n            hide\n        else\n            go to [front v] layer\n            go [backward v] (1) layers\n            show\n        end\n    else\n        hide\n    end\nend\n\n@Close instructions\n\nwhen I receive [instructions v]\nset [show instructions v] to [1]\n\nwhen I receive [instructions v]\nforever\n    if <(start timer) = [0]> then\n        if <(show instructions) = [1]> then\n            if <touching (mouse-pointer v)?> then\n                set size to ((size) + (((145) - (size)) / (4))) %\n                set [ghost v] effect to (3)\n            else\n                set size to ((size) + (((124) - (size)) / (3))) %\n                set [ghost v] effect to (0)\n            end\n        end\n    end\nend\n\nwhen I receive [instructions v]\nforever\n    if <(start timer) = [0]> then\n        if <(show instructions) = [1]> then\n            if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                set [show instructions v] to [0]\n            end\n        end\n    else\n        hide\n    end\nend\n\nwhen I receive [start screen v]\nset [show instructions v] to [0]\n\nwhen flag clicked\nhide\nforever\n    if <(start timer) = [0]> then\n        if <(show instructions) = [0]> then\n            hide\n        else\n            go to [front v] layer\n            show\n        end\n    else\n        hide\n    end\nend\n\n@collected\n\nwhen I receive [setup v]\ngo to x: (190) y: (159)\nshow\n\nwhen I receive [tick v]\ngo to [front v] layer\ngo [backward v] (1) layers\nif <(POINTS) > [10]> then\n    switch costume to (((POINTS) mod (10)) + (1))\nelse\n    switch costume to ((POINTS) + (1))\nend\n\nwhen I receive [start screen v]\ngo [backward v] (10) layers\n\n@Collected max\n\nwhen I receive [setup v]\ngo to x: (213) y: (159)\nshow\n\nwhen I receive [tick v]\ngo to [front v] layer\ngo [backward v] (2) layers\nif <(Collected Max) > [10]> then\n    switch costume to (((Collected Max) mod (10)) + (1))\nelse\n    switch costume to ((Collected Max) + (1))\nend\n\nwhen I receive [start screen v]\ngo [backward v] (10) layers\n\n
Floating Islands (A mobile friendly scrolling platformer)\n\nPlease run in fullscreen for better quality and less lag!\n\nThe game has only 2 levels, but if many people like this, I will definitely make another longer scrolling platformer.\n\nHow to play:\nUse WASD or Arrows to move.\nYou win when you go through the last portal. To win, you need to collect all coins, otherwise the portal will not open. But be careful there is spikes and lava that  you need to avoid.\nChallenge your friends with the timer and see who's the fastest!