BlueOS Platformer [Beta]

Instructions: Work In Progress of a 1-sprite pen platformer for BlueOS\n\nArrow Keys to move (or WASD).\nOn mobile, tap left/right/top of the screen to move.\n\nBlue means ground\nRising pink means lava\nVibrating purple means bounce pad\nWhite changes blue to bouncy, pink to ground, and purple to lava.\n\nGet to the right to win\n\nWhat do you guys think?

@Stage\n\nwhen flag clicked\nbroadcast (Blue Platformer v)\n\n@platformer\n\nwhen flag clicked\nerase all\nhide\n\ndefine Render\nset pen size to (5)\npen up\nerase all\nDraw Grid\nset [i v] to [1]\nrepeat until <(i) > (length of [level v])>\n    change [i v] by (1)\n    set [# v] to (item ((i) - (1)) of [level v])\n    if <(#) < [4]> then\n        if <(Color) = [2]> then\n            change [# v] by (1)\n            if <(#) = [4]> then\n                set [# v] to [1]\n            end\n        end\n        if <(Color) = [3]> then\n            change [# v] by (-1)\n            if <(#) = [0]> then\n                set [# v] to [3]\n            end\n        end\n    end\n    if <(#) = [1]> then\n        set pen color to (#0099f9)\n        if <(Color) = [2]> then\n            set pen color to (#948fd6)\n        end\n        if <(Color) = [3]> then\n            set pen color to (#dcb9e9)\n        end\n        Draw Rect from (item (i) of [level v]) (item ((i) + (1)) of [level v]) to (item ((i) + (2)) of [level v]) (item ((i) + (3)) of [level v])\n    end\n    if <(#) = [2]> then\n        set pen color to (#ddb9e9)\n        if <(Color) = [2]> then\n            set pen color to (#0099f9)\n        end\n        if <(Color) = [3]> then\n            set pen color to (#948fd6)\n        end\n        if <[25] > ((ticks) mod (50))> then\n            Draw Rect from (item (i) of [level v]) (item ((i) + (1)) of [level v]) to (item ((i) + (2)) of [level v]) (((item ((i) + (3)) of [level v]) + (((ticks) mod (50)) / (2))) - (12))\n        else\n            Draw Rect from (item (i) of [level v]) (item ((i) + (1)) of [level v]) to (item ((i) + (2)) of [level v]) (((item ((i) + (3)) of [level v]) + (((50) - ((ticks) mod (50))) / (2))) - (12))\n        end\n    end\n    if <(#) = [3]> then\n        set pen color to (#948fd6)\n        if <(Color) = [2]> then\n            set pen color to (#ddb9e9)\n        end\n        if <(Color) = [3]> then\n            set pen color to (#0099f9)\n        end\n        Draw Rect from (item (i) of [level v]) (item ((i) + (1)) of [level v]) to (item ((i) + (2)) of [level v]) (item ((i) + (3)) of [level v])\n        Draw Rect from ((item (i) of [level v]) + (pick random (8) to (12))) ((item ((i) + (1)) of [level v]) + (pick random (8) to (12))) to ((item ((i) + (2)) of [level v]) - (pick random (8) to (12))) ((item ((i) + (3)) of [level v]) - (pick random (8) to (12)))\n    end\n    if <(#) = [4]> then\n        set pen color to (#000000)\n        Draw Rect from ((item (i) of [level v]) + (10)) (item ((i) + (1)) of [level v]) to ((item ((i) + (2)) of [level v]) - (10)) (item ((i) + (3)) of [level v])\n        Draw Rect from (item (i) of [level v]) ((item ((i) + (1)) of [level v]) + (10)) to (item ((i) + (2)) of [level v]) ((item ((i) + (3)) of [level v]) - (10))\n    end\n    if <(#) = [5]> then\n        set pen color to (#ffffff)\n        Draw Rect from ((item (i) of [level v]) + (10)) (item ((i) + (1)) of [level v]) to ((item ((i) + (2)) of [level v]) - (10)) (item ((i) + (3)) of [level v])\n        Draw Rect from (item (i) of [level v]) ((item ((i) + (1)) of [level v]) + (10)) to (item ((i) + (2)) of [level v]) ((item ((i) + (3)) of [level v]) - (10))\n    end\n    change [i v] by (4)\nend\nset [i v] to [1]\nset pen color to (#4abdf6)\nDraw Rect from ((Player X) + (5)) ((Player Y) + (5)) to (((Player X) + (Player Width)) - (5)) (((Player Y) + (Player Height)) - (5))\n\ndefine Add Block (type) from (x1) (y1) to (x2) (y2)\nadd (type) to [level v]\nadd (x1) to [level v]\nadd (y1) to [level v]\nadd (x2) to [level v]\nadd (y2) to [level v]\n\ndefine Load Level (level)\ndelete all of [level v]\nif <(level) = [1]> then\n    Level 1\nend\nif <(level) = [2]> then\n    Level 2\nend\nif <(level) = [3]> then\n    Level 3\nend\nif <(level) = [4]> then\n    Level 4\nend\nif <(level) = [5]> then\n    Level 5\nend\nif <(length of [level v]) = [0]> then\n    Level 4\nend\n\ndefine Go To (x) (y)\ngo to x: ((x) - (Camera X)) y: ((y) - (Camera Y))\n\ndefine Physics 1\nif <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<[0] > (mouse x)> and <mouse down?>>>> then\n    change [player xv v] by (-4)\nend\nif <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<(mouse x) > [0]> and <mouse down?>>>> then\n    change [player xv v] by (4)\nend\nset [player xv v] to ((Player Xv) * (0.7))\nChange Player X by (round (Player Xv))\nchange [player yv v] by (-1)\nif <<<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(mouse y) > [0]> and <mouse down?>>>> and <(in air?) = [0]>> then\n    set [player yv v] to [15]\nend\nif <[collisions v] contains [3]?> then\n    set [player yv v] to [20]\nend\nif <(Player Yv) < [-25]> then\n    set [player yv v] to [-25]\nend\nChange Player Y by (round (Player Yv))\nif <[collisions v] contains [4]?> then\n    set [color v] to [2]\nend\nif <[collisions v] contains [5]?> then\n    set [color v] to [3]\nend\nif <<(Player Y) < ((-180) - (Player Height))> or <[collisions v] contains [2]?>> then\n    Reset\nend\nif <(Goal) < (Player X)> then\n    change [level v] by (1)\n    Reset\nend\nAdjust Camera\n\ndefine Change Player X by (xv)\nchange [player x v] by (xv)\nUpdate Collisions\nrepeat until <not <[collisions v] contains [1]?>>\n    set [player xv v] to [0]\n    change [player x v] by (() - (([abs v] of (xv) ) / (xv)))\n    Update Collisions\nend\n\ndefine Update Collisions\ndelete all of [collisions v]\nset [i v] to [1]\nrepeat until <(i) > (length of [level v])>\n    if <<(item ((i) + (3)) of [level v]) > (Player X)> and <(item ((i) + (1)) of [level v]) < ((Player X) + (Player Width))>> then\n        if <<(item ((i) + (4)) of [level v]) > (Player Y)> and <(item ((i) + (2)) of [level v]) < ((Player Y) + (Player Height))>> then\n            if <<(Color) = [1]> or <[3] < (item (i) of [level v])>> then\n                add (item (i) of [level v]) to [collisions v]\n            end\n            if <not <[3] < (item (i) of [level v])>> then\n                if <(Color) = [2]> then\n                    if <((item (i) of [level v]) + (1)) = [4]> then\n                        add [1] to [collisions v]\n                    else\n                        add ((item (i) of [level v]) + (1)) to [collisions v]\n                    end\n                end\n                if <(Color) = [3]> then\n                    if <((item (i) of [level v]) + (-1)) = [0]> then\n                        add [3] to [collisions v]\n                    else\n                        add ((item (i) of [level v]) + (-1)) to [collisions v]\n                    end\n                end\n            end\n        end\n    end\n    change [i v] by (5)\nend\n\ndefine Change Player Y by (yv)\nset [in air? v] to [1]\nchange [player y v] by (yv)\nUpdate Collisions\nrepeat until <not <[collisions v] contains [1]?>>\n    if <(yv) < [0]> then\n        set [in air? v] to [0]\n    end\n    set [player yv v] to [0]\n    change [player y v] by (() - (([abs v] of (yv) ) / (yv)))\n    Update Collisions\nend\n\ndefine Reset\nLoad Level (Level)\nset [color v] to [1]\nset [ticks v] to [0]\nset [player x v] to [0]\nset [player y v] to [-10]\nset [player width v] to [40]\nset [player height v] to [40]\nset [player xv v] to [0]\nset [player yv v] to [0]\nset [camera x v] to [0]\nset [camera y v] to [0]\nset [in air? v] to [1]\n\ndefine Adjust Camera\nset [camera x v] to (Player X)\nchange [camera y v] by (round (((Player Y) - (Camera Y)) / (4)))\nif <(Camera X) < [0]> then\n    set [camera x v] to [0]\nend\nif <(Camera Y) < [0]> then\n    set [camera y v] to [0]\nend\nif <(Goal) < ((Camera X) + (240))> then\n    set [camera x v] to ((Goal) - (240))\nend\n\ndefine Draw Rect from (x1) (y1) to (x2) (y2)\nGo To (x1) (y1)\npen down\nGo To (x2) (y1)\nGo To (x2) (y2)\nGo To (x1) (y2)\nGo To (x1) (y1)\npen up\n\ndefine Draw Grid\nset pen color to (#313133)\ngo to x: (((-240) - (((Camera X) * (0.5)) mod (40))) + (() mod (40))) y: (-180)\nrepeat (13)\n    pen down\n    set y to (180)\n    pen up\n    change x by (40)\n    set y to (-180)\nend\ngo to x: (-240) y: (((-180) - (((Camera Y) * (0.5)) mod (40))) + (() mod (40)))\nrepeat (10)\n    pen down\n    set x to (240)\n    pen up\n    change y by (40)\n    set x to (-240)\nend\n\nwhen I receive [blue platformer v]\nset [level v] to [1]\nReset\nforever\n    Render\n    Physics 1\n    change [ticks v] by (1)\nend\n\ndefine Level 1\nset [goal v] to [1200]\nAdd Block [1] from [-50] [-75] to [50] [-25]\nAdd Block [2] from [55] [-75] to [195] [-50]\nAdd Block [1] from [200] [-75] to [350] [-25]\nAdd Block [1] from [250] [100] to [350] [130]\nAdd Block [3] from [355] [-75] to [450] [-50]\nAdd Block [1] from [450] [100] to [500] [180]\nAdd Block [1] from [510] [150] to [600] [250]\nAdd Block [2] from [605] [150] to [695] [225]\nAdd Block [1] from [700] [150] to [790] [250]\nAdd Block [1] from [800] [-180] to [850] [180]\nAdd Block [1] from [510] [100] to [790] [140]\nAdd Block [3] from [855] [-180] to [950] [-140]\nAdd Block [2] from [955] [-180] to [995] [-50]\nAdd Block [1] from [1000] [-180] to [1200] [-140]\n\ndefine Level 2\nset [goal v] to [900]\nAdd Block [1] from [-50] [-50] to [50] [-25]\nAdd Block [1] from [60] [-50] to [90] [50]\nAdd Block [2] from [100] [-50] to [250] [40]\nAdd Block [1] from [260] [-50] to [300] [60]\nAdd Block [3] from [310] [-50] to [360] [70]\nAdd Block [1] from [370] [-50] to [390] [60]\nAdd Block [2] from [400] [-50] to [650] [40]\nAdd Block [1] from [660] [-50] to [900] [-25]\n\ndefine Level 3\nset [goal v] to [800]\nAdd Block [1] from [-50] [-50] to [50] [-25]\nAdd Block [1] from [175] [0] to [250] [25]\nAdd Block [1] from [450] [-180] to [475] [25]\nAdd Block [2] from [480] [-180] to [680] [0]\nAdd Block [1] from [685] [-180] to [800] [25]\n\ndefine Level 4\nset [goal v] to [900]\nAdd Block [1] from [-50] [-75] to [175] [-25]\nAdd Block [2] from [200] [-180] to [900] [-150]\nAdd Block [1] from [275] [-75] to [400] [-25]\nAdd Block [3] from [405] [-75] to [500] [-40]\nAdd Block [1] from [505] [-75] to [700] [-40]\nAdd Block [2] from [710] [-75] to [735] [300]\nAdd Block [5] from [600] [50] to [650] [100]\n\ndefine Level 5\nset [goal v] to [1000]\nAdd Block [2] from [-250] [-50] to [-150] [-25]\nAdd Block [2] from [-250] [150] to [-150] [175]\nAdd Block [2] from [-250] [350] to [-150] [375]\nAdd Block [3] from [-145] [350] to [2000] [375]\nAdd Block [5] from [-125] [50] to [-75] [100]\nAdd Block [1] from [-50] [-50] to [45] [-25]\nAdd Block [2] from [50] [-50] to [75] [100]\nAdd Block [2] from [80] [-50] to [170] [-25]\nAdd Block [3] from [175] [-50] to [200] [100]\nAdd Block [2] from [205] [-50] to [295] [-25]\nAdd Block [3] from [300] [-50] to [500] [-30]\nAdd Block [2] from [505] [-50] to [555] [-25]\nAdd Block [4] from [505] [75] to [555] [125]\n\n