8-bit Adventure (a game)
@Stage\n\nwhen flag clicked\nforever\n    play sound [Digital Lemonade.mp3 v] until done\nend\n\n@Ground\n\ndefine None\nset [x v] to ([abs v] of ((x3) - (x)) )\nset [x2 v] to ([abs v] of ((x4) - (x2)) )\nset [y v] to ([abs v] of ((y3) - (y)) )\nset [y2 v] to ([abs v] of ((y4) - (y2)) )\nset [length 2 v] to (X)\nif <(X2) > (Length 2)> then\n    set [length 2 v] to (X2)\nend\nif <(Y) > (Length 2)> then\n    set [length 2 v] to (Y)\nend\nif <(Y2) > (Length 2)> then\n    set [length 2 v] to (Y2)\nend\nset [x v] to (x)\nset [y v] to (y)\nset [x2 v] to (x2)\nset [y2 v] to (y2)\nrepeat (Length 2)\n    clear graphic effects\n    if <((X2) - (X)) > ((Y2) - (Y))> then\n        set [length v] to ((X2) - (X))\n    else\n        set [length v] to ((Y2) - (Y))\n    end\n    switch costume to (type)\n    if <(costume [number v]) = [6]> then\n        set [brightness v] effect to (35)\n    end\n    go to x: (((X) - (14.5)) * (16)) y: (((Y) - (11.25)) * (16))\n    repeat (Length)\n        if <<(costume [number v]) = [4]> and <(pick random (1) to (2)) = [1]>> then\n            switch costume to (dirt2 v)\n            stamp\n            switch costume to (dirt v)\n        else\n            stamp\n        end\n        if <(((y position) / (16)) + (11.25)) > (Y2)> then\n            change y by (-16)\n        else\n            if <(((y position) / (16)) + (11.25)) < (Y2)> then\n                change y by (16)\n            end\n        end\n        if <(((x position) / (16)) + (14.5)) > (X2)> then\n            change x by (-16)\n        else\n            if <(((x position) / (16)) + (14.5)) < (X2)> then\n                change x by (16)\n            end\n        end\n    end\n    if <(X) < (x3)> then\n        change [x v] by (1)\n    end\n    if <(X2) < (x4)> then\n        change [x2 v] by (1)\n    end\n    if <(Y) < (y3)> then\n        change [y v] by (1)\n    end\n    if <(Y2) < (y4)> then\n        change [y2 v] by (1)\n    end\nend\n\ndefine None\nclear graphic effects\nif <([abs v] of ((x2) - (x)) ) > ([abs v] of ((y2) - (y)) )> then\n    set [length v] to ([abs v] of ((x2) - (x)) )\nelse\n    set [length v] to ([abs v] of ((y2) - (y)) )\nend\nswitch costume to (type)\ngo to x: (((x) - (14.5)) * (16)) y: (((y) - (11.25)) * (16))\nrepeat (Length)\n    if <(costume [number v]) = [2]> then\n        stamp\n    else\n        create clone of (_myself_ v)\n    end\n    if <(((y position) / (16)) + (11.25)) > (y2)> then\n        change y by (-16)\n    else\n        if <(((y position) / (16)) + (11.25)) < (y2)> then\n            change y by (16)\n        end\n    end\n    if <(((x position) / (16)) + (14.5)) > (x2)> then\n        change x by (-16)\n    else\n        if <(((x position) / (16)) + (14.5)) < (x2)> then\n            change x by (16)\n        end\n    end\nend\n\ndefine Sky\nerase all\nswitch costume to (sky v)\nset [brightness v] effect to (35)\ngo to x: (-232) y: (172)\nrepeat (23)\n    repeat (30)\n        switch costume to (join [Sky] (pick random (1) to (2)))\n        stamp\n        change x by (16)\n    end\n    change y by (-16)\n    set x to (-232)\nend\n\ndefine None\nclear graphic effects\ngo to x: (((x) - (14.5)) * (16)) y: (((y) - (11.25)) * (16))\nswitch costume to (string)\nif <<(costume [number v]) = [8]> or <(costume [number v]) = [3]>> then\n    stamp\nelse\n    create clone of (_myself_ v)\nend\n\nwhen I receive [next level v]\nerase all\nif <[1] = [1]> then\n    delete this clone\nend\nwait (0.1) seconds\nchange [level v] by (1)\nRender Level\n\nwhen I start as a clone\nshow\n\ndefine Render Level\nif <(Level) = [1]> then\n    Sky\n    Fill space from X Y X Y (0) (0) (0) (4) Till X Y X Y (30) (0) (30) (4) Type [Dirt]\n    Block line X: (0) Y: (4) To X: (5) Y: (4) Type [Grass]\n    Block line X: (10) Y: (4) To X: (15) Y: (4) Type [Grass]\n    Block line X: (20) Y: (4) To X: (30) Y: (4) Type [Grass]\n    Block line X: (5) Y: (4) To X: (10) Y: (4) Type [Lava]\n    Block line X: (15) Y: (4) To X: (20) Y: (4) Type [Lava]\n    Block line X: (23) Y: (14) To X: (30) Y: (14) Type [Grass]\n    Block at X: (15) Y: (8) Type [Grass]\n    Block at X: (16) Y: (11) Type [Grass]\n    Block at X: (17) Y: (14) Type [Grass]\n    Block at X: (27) Y: (17) Type [Gem]\nelse\n    if <(Level) = [2]> then\n        Sky\n        Block line X: (0) Y: (1) To X: (20) Y: (10) Type [Grass]\n        Block line X: (20) Y: (10) To X: (30) Y: (0) Type [Grass]\n        Fill space from X Y X Y (0) (0) (9) (10) Till X Y X Y (30) (0) (20) (10) Type [Dirt]\n        Block line X: (0) Y: (14) To X: (8) Y: (14) Type [Dirt]\n        Block line X: (22) Y: (14) To X: (30) Y: (14) Type [Dirt]\n        Block line X: (8) Y: (14) To X: (22) Y: (14) Type [Lava]\n        Fill space from X Y X Y (0) (15) (0) (23) Till X Y X Y (30) (15) (30) (23) Type [Dirt]\n        Block at X: (28) Y: (5) Type [Gem]\n    else\n        if <(Level) = [3]> then\n            Sky\n            Fill space from X Y X Y (0) (18) (0) (23) Till X Y X Y (25) (18) (25) (23) Type [Dirt]\n            Fill space from X Y X Y (0) (0) (0) (4) Till X Y X Y (4) (0) (4) (4) Type [Dirt]\n            Fill space from X Y X Y (0) (19) (0) (23) Till X Y X Y (24) (19) (24) (23) Type [Lava]\n            Fill space from X Y X Y (4) (0) (4) (5) Till X Y X Y (30) (0) (30) (5) Type [Lava]\n            Fill space from X Y X Y (22) (8) (26) (12) Till X Y X Y (30) (8) (30) (12) Type [Dirt]\n            Block line X: (0) Y: (4) To X: (4) Y: (4) Type [Grass]\n            Block line X: (19) Y: (0) To X: (19) Y: (9) Type [Lava]\n            Block line X: (19) Y: (12) To X: (19) Y: (22) Type [Lava]\n            Block line X: (22) Y: (8) To X: (30) Y: (12) Type [Grass]\n            Block line X: (24) Y: (18) To X: (24) Y: (23) Type [Dirt]\n            Block at X: (4) Y: (7) Type [Grass]\n            Block at X: (7) Y: (9) Type [Grass]\n            Block at X: (11) Y: (9) Type [Grass]\n            Block at X: (16) Y: (5) Type [Grass]\n            Block at X: (29) Y: (15) Type [Grass]\n            Block at X: (25) Y: (18) Type [Grass]\n            Block at X: (25) Y: (21) Type [Gem]\n        else\n            if <(Level) = [4]> then\n                Sky\n                Fill space from X Y X Y (16) (23) (20) (0) Till X Y X Y (30) (23) (30) (0) Type [Sea]\n                Fill space from X Y X Y (18) (0) (20) (23) Till X Y X Y (30) (0) (30) (23) Type [Sea]\n                Fill space from X Y X Y (0) (0) (0) (4) Till X Y X Y (20) (0) (24) (4) Type [Dirt]\n                Fill space from X Y X Y (0) (15) (0) (18) Till X Y X Y (3) (15) (0) (17) Type [Dirt]\n                Block line X: (0) Y: (4) To X: (25) Y: (4) Type [Grass]\n                Block line X: (5) Y: (5) To X: (5) Y: (15) Type [Dirt]\n                Block at X: (4) Y: (8) Type [Grass]\n                Block at X: (4) Y: (12) Type [Grass]\n                Block at X: (5) Y: (15) Type [Grass]\n                Block line X: (6) Y: (15) To X: (9) Y: (18) Type [Grass]\n                Block line X: (0) Y: (17) To X: (3) Y: (15) Type [Grass]\n                Block at X: (15) Y: (15) Type [Sea]\n                Block at X: (16) Y: (17) Type [Sea]\n                Block at X: (16) Y: (20) Type [Sea]\n                Block at X: (26) Y: (5) Type [Gem]\n                Block line X: (13) Y: (12) To X: (13) Y: (23) Type [Dirt]\n                Block line X: (8) Y: (12) To X: (13) Y: (12) Type [Grass]\n                Block line X: (8) Y: (17) To X: (11) Y: (17) Type [Grass]\n                Block line X: (6) Y: (7) To X: (20) Y: (7) Type [Grass]\n                Block line X: (9) Y: (8) To X: (9) Y: (10) Type [Lava]\n                Block line X: (12) Y: (11) To X: (12) Y: (9) Type [Lava]\n            else\n                if <(Level) = [5]> then\n                    Fill space from X Y X Y (0) (0) (0) (23) Till X Y X Y (30) (0) (30) (23) Type [Sea]\n                    Block line X: (0) Y: (1) To X: (20) Y: (10) Type [Lava]\n                    Block line X: (20) Y: (10) To X: (30) Y: (0) Type [Lava]\n                    Fill space from X Y X Y (0) (0) (9) (10) Till X Y X Y (30) (0) (20) (10) Type [Lava]\n                    Fill space from X Y X Y (0) (13) (0) (23) Till X Y X Y (30) (13) (30) (23) Type [Lava]\n                    Fill space from X Y X Y (13) (13) (13) (18) Till X Y X Y (15) (13) (15) (18) Type [Sea]\n                    Fill space from X Y X Y (3) (16) (3) (22) Till X Y X Y (5) (16) (5) (22) Type [Sea]\n                    Fill space from X Y X Y (3) (16) (3) (18) Till X Y X Y (14) (16) (14) (18) Type [Sea]\n                    Fill space from X Y X Y (3) (20) (3) (22) Till X Y X Y (16) (20) (16) (22) Type [Sea]\n                    Fill space from X Y X Y (16) (14) (16) (22) Till X Y X Y (28) (14) (28) (22) Type [Sky1]\n                    Block line X: (16) Y: (14) To X: (28) Y: (14) Type [Grass]\n                    Block at X: (25) Y: (18) Type [Gem]\n                else\n                    if <(Level) = [6]> then\n                        Sky\n                        Block line X: (0) Y: (4) To X: (2) Y: (4) Type [Grass]\n                        Fill space from X Y X Y (0) (0) (0) (4) Till X Y X Y (2) (0) (2) (4) Type [Dirt]\n                        Block at X: (6) Y: (8) Type [Grass]\n                        Block line X: (2) Y: (0) To X: (30) Y: (0) Type [Lava]\n                        Block at X: (2) Y: (12) Type [Grass]\n                        Block line X: (7) Y: (16) To X: (30) Y: (16) Type [Grass]\n                        Block line X: (13) Y: (17) To X: (19) Y: (17) Type [Lava]\n                        Block at X: (28) Y: (20) Type [Gem]\n                    else\n                        if <(Level) = [7]> then\n                            Sky\n                            Block line X: (0) Y: (4) To X: (2) Y: (4) Type [Grass]\n                            Fill space from X Y X Y (0) (0) (0) (4) Till X Y X Y (2) (0) (2) (4) Type [Dirt]\n                            Block line X: (2) Y: (0) To X: (30) Y: (0) Type [Lava]\n                            Block line X: (11) Y: (4) To X: (15) Y: (4) Type [Grass]\n                            Block line X: (15) Y: (4) To X: (15) Y: (8) Type [Dirt]\n                            Block at X: (15) Y: (8) Type [Grass]\n                            Block line X: (17) Y: (4) To X: (17) Y: (8) Type [Dirt]\n                            Block line X: (17) Y: (8) To X: (19) Y: (8) Type [Grass]\n                            Block line X: (16) Y: (0) To X: (16) Y: (12) Type [Lava]\n                            Block at X: (25) Y: (8) Type [Grass]\n                            Block at X: (28) Y: (12) Type [Grass]\n                            Block at X: (25) Y: (16) Type [Grass]\n                            Block at X: (25) Y: (20) Type [Gem]\n                        else\n                            if <(Level) = [8]> then\n                                Sky\n                                Block line X: (0) Y: (4) To X: (2) Y: (4) Type [Grass]\n                                Fill space from X Y X Y (0) (0) (0) (4) Till X Y X Y (2) (0) (2) (4) Type [Dirt]\n                                Block line X: (2) Y: (0) To X: (30) Y: (0) Type [Lava]\n                                set [r3 v] to [4]\n                                repeat (5)\n                                    Block line X: ((R3) - (2)) Y: (4) To X: (R3) Y: (4) Type [Jump]\n                                    Block line X: (R3) Y: (4) To X: (R3) Y: (10) Type [Lava]\n                                    change [r3 v] by (3)\n                                end\n                                Block line X: ((R3) - (2)) Y: (4) To X: (R3) Y: (4) Type [Jump]\n                                Block line X: (19) Y: (4) To X: (30) Y: (4) Type [Grass]\n                                Block at X: (27) Y: (7) Type [Gem]\n                            else\n                                if <(Level) = [9]> then\n                                    Sky\n                                    Fill space from X Y X Y (0) (0) (0) (5) Till X Y X Y (30) (0) (30) (5) Type [Dirt]\n                                    Block line X: (0) Y: (0) To X: (30) Y: (0) Type [Lava]\n                                    Block line X: (0) Y: (4) To X: (2) Y: (4) Type [Dirt]\n                                    Block line X: (8) Y: (4) To X: (10) Y: (4) Type [Dirt]\n                                    Block at X: (12) Y: (4) Type [Dirt]\n                                    Block at X: (15) Y: (4) Type [Dirt]\n                                    Block line X: (22) Y: (4) To X: (30) Y: (4) Type [Dirt]\n                                    Block at X: (28) Y: (6) Type [Gem]\n                                else\n                                    if <(Level) = [10]> then\n                                        Sky\n                                        Fill space from X Y X Y (0) (0) (0) (5) Till X Y X Y (5) (0) (5) (5) Type [Dirt]\n                                        Block line X: (0) Y: (4) To X: (5) Y: (4) Type [Grass]\n                                        Block line X: (5) Y: (0) To X: (5) Y: (18) Type [Dirt]\n                                        Block at X: (5) Y: (18) Type [Grass]\n                                        Block at X: (4) Y: (7) Type [Grass]\n                                        Block line X: (9) Y: (23) To X: (9) Y: (9) Type [Lava]\n                                        Block at X: (4) Y: (11) Type [Grass]\n                                        Block at X: (4) Y: (15) Type [Grass]\n                                        Block at X: (6) Y: (3) Type [Grass]\n                                        Block at X: (6) Y: (7) Type [Grass]\n                                        Block at X: (6) Y: (11) Type [Grass]\n                                        Block at X: (6) Y: (15) Type [Grass]\n                                        Block line X: (6) Y: (0) To X: (30) Y: (0) Type [Lava]\n                                        Block line X: (14) Y: (3) To X: (30) Y: (12) Type [Grass]\n                                        Block line X: (16) Y: (6) To X: (18) Y: (8) Type [Lava]\n                                        Block line X: (19) Y: (9) To X: (21) Y: (11) Type [Lava]\n                                        Block at X: (28) Y: (17) Type [Gem]\n                                    else\n                                        Sky\n                                        Block line X: (0) Y: (0) To X: (30) Y: (0) Type [Jump]\n                                        Block line X: (15) Y: (4) To X: (19) Y: (8) Type [Jump]\n                                        Block line X: (10) Y: (7) To X: (15) Y: (3) Type [Jump]\n                                        Block line X: (10) Y: (8) To X: (13) Y: (11) Type [Jump]\n                                        Block line X: (16) Y: (10) To X: (18) Y: (7) Type [Jump]\n                                        Block at X: (13) Y: (9) Type [Jump]\n                                        Block at X: (14) Y: (8) Type [Jump]\n                                        Block at X: (15) Y: (9) Type [Jump]\n                                        Fill space from X Y X Y (0) (13) (0) (23) Till X Y X Y (30) (13) (30) (23) Type [Sea]\n                                        change [winners v] by (1)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nset size to (200) %\nset [level v] to [1]\nRender Level\n\nerase all\nSky\n\n@Guy\n\nwhen I receive [start v]\nshow\nset volume to (50) %\nset size to (200) %\ngo to x: (-224) y: (-98)\nwait (0.1) seconds\nset [y-vel v] to [0]\nset [x-vel v] to [0]\nset [gun? v] to [1]\ngo to [front v] layer\nforever\n    if <key (left arrow v) pressed?> then\n        change [x-vel v] by (-1)\n        point in direction (-90)\n    end\n    if <key (right arrow v) pressed?> then\n        change [x-vel v] by (1)\n        point in direction (90)\n    end\n    change x by (X-vel)\n    set rotation style [don't rotate v]\n    switch costume to (right v)\n    if <touching (ground v)?> then\n        change x by (() - (X-vel))\n    end\n    switch costume to (left v)\n    if <touching (ground v)?> then\n        change x by (() - (X-vel))\n    end\n    switch costume to (down v)\n    if <touching (ground v)?> then\n        set [y-vel v] to [0]\n        To the top\n        if <key (up arrow v) pressed?> then\n            start sound [Jumpidee v]\n            if <<touching color (#434343)?> or <<touching color (#343434)?> or <touching color (#252525)?>>> then\n                set [y-vel v] to [16]\n                change y by (Y-vel)\n            else\n                set [y-vel v] to [11]\n                change y by (Y-vel)\n            end\n        end\n    else\n        if <<not <touching color (#4bb0ff)?>> and <<not <touching color (#46aae7)?>> and <not <touching color (#419de6)?>>>> then\n            Turbo\n        end\n    end\n    switch costume to (up v)\n    if <touching (ground v)?> then\n        change y by (-1)\n        set [y-vel v] to [0]\n    end\n    set rotation style [left-right v]\n    switch costume to (guy v)\n    if <<touching color (#f06020)?> or <<touching color (#f37035)?> or <touching color (#db7958)?>>> then\n        go to x: (-224) y: (-98)\n        set [y-vel v] to [0]\n        set [x-vel v] to [0]\n        set [gun? v] to [1]\n    end\n    if <<touching color (#7db14b)?> or <<touching color (#7db14b)?> or <touching color (#7db14b)?>>> then\n        broadcast (Next level v)\n        wait (0.1) seconds\n        go to x: (-224) y: (-98)\n        set [y-vel v] to [0]\n        set [x-vel v] to [0]\n        set [gun? v] to [1]\n    end\n    if <<touching color (#4bb0ff)?> or <<touching color (#46aae7)?> or <touching color (#419de6)?>>> then\n        if <key (up arrow v) pressed?> then\n            change [y-vel v] by (1)\n        end\n        if <key (down arrow v) pressed?> then\n            change [y-vel v] by (-1)\n        end\n        set [y-vel v] to ((Y-vel) * (0.86))\n        change y by (Y-vel)\n    end\n    set [x-vel v] to ((X-vel) * (0.85))\n    if on edge, bounce\nend\n\ndefine Turbo\nchange [y-vel v] by (-1)\nrepeat (2)\n    change y by ((Y-vel) / (2))\n    if <touching (ground v)?> then\n        To the top\n    end\n    switch costume to (up v)\n    if <touching (ground v)?> then\n        change y by (-1)\n        set [y-vel v] to [0]\n    end\n    switch costume to (down v)\nend\n\ndefine To the top\nrepeat until <not <touching (ground v)?>>\n    change y by (1)\nend\nchange y by (-1)\n\nwhen flag clicked\nhide\nbroadcast (Start v)\n\nwhen [space v] key pressed\nbroadcast (Next level v)\nwait (0.1) seconds\ngo to x: (-224) y: (-98)\nset [y-vel v] to [0]\nset [x-vel v] to [0]\nset [gun? v] to [1]\n\n@Sprite1\n\nwhen [a v] key pressed\ngo to x: (0) y: (0)\nshow\nrepeat until <not <key (a v) pressed?>>\n    say (join (join [X: ] (round (((mouse x) / (16)) + (14.5)))) (join [  Y: ] (round (((mouse y) / (16)) + (11.25)))))\nend\nsay []\nhide\n\nwhen flag clicked\nhide\n\n@Sprite3\n\nwhen flag clicked\ngo to [front v] layer\nhide\ngo to x: (-70) y: (-18)\n\n