Uncolored (A Platformer)
@Stage\n\nwhen flag clicked\nforever\n    play sound [LMan - “Vortex” \(C64\) v] until done\nend\n\n@game loop\n\ndefine Get Mouse State\nif <mouse down?> then\n    change [mousepress v] by (1)\nelse\n    set [mousepress v] to [0]\nend\nif <not <mouse down?>> then\n    change [mouseup v] by (1)\nelse\n    set [mouseup v] to [0]\nend\n\ndefine Init\nset [oldtime v] to (timer)\nset [actionvalue v] to [0]\nset [joystickactive v] to [0]\nset [joysticksize v] to [50]\nset [joystickox v] to [-170]\nset [joystickoy v] to [-110]\nset [mobilecontrols v] to [0]\nset [wasd_arrow v] to [0]\n\ndefine Mobile controls\nset [joystickvx v] to [0]\nset [joystickvy v] to [0]\nif <(ActionValue) = [1]> then\n    set [actionvalue v] to [0]\nend\nif <<(JoyStickActive) = [0]> and <<(MousePress) = [1]> and <<<(mouse x) < [-100]> and <(mouse x) > [-220]>> and <<(mouse y) < [-50]> and <(mouse y) > [-160]>>>>> then\n    set [joystickactive v] to [1]\n    set [joystickox v] to (mouse x)\n    set [joystickoy v] to (mouse y)\n    set [actionvalue v] to [-1]\nelse\n    if <<(MousePress) = [1]> and <(JoyStickActive) = [1]>> then\n        set [actionvalue v] to [1]\n    end\nend\nif <(JoyStickActive) = [1]> then\n    if <<(MouseUp) = [1]> and <(ActionValue) = [-1]>> then\n        set [actionvalue v] to [1]\n    end\n    set [~vx v] to ((mouse x) - (JoystickOx))\n    set [~vy v] to ((mouse y) - (JoystickOy))\n    set [~mag v] to ([sqrt v] of (((~vx) * (~vx)) + ((~vy) * (~vy))) )\n    if <(~mag) > ((JoyStickSize) * (2.5))> then\n        set [joystickactive v] to [0]\n        set [joystickox v] to [-170]\n        set [joystickoy v] to [-110]\n    else\n        if <(~mag) < ((JoyStickSize) * (0.1))> then\n            set [joystickvx v] to [0]\n            set [joystickvy v] to [0]\n        else\n            if <(~mag) > (JoyStickSize)> then\n                set [joystickvx v] to ((~vx) / (~mag))\n                set [joystickvy v] to ((~vy) / (~mag))\n            else\n                set [joystickvx v] to ((~vx) / (JoyStickSize))\n                set [joystickvy v] to ((~vy) / (JoyStickSize))\n            end\n        end\n    end\nend\n\nwhen flag clicked\nbroadcast (init v) and wait\nInit\nforever\n    Game loop\nend\n\ndefine Game loop\nset [deltatime v] to ((timer) - (oldTime))\nset [oldtime v] to (timer)\nif <(DeltaTime) > [0.1]> then\n    set [deltatime v] to [0.1]\nend\nGet Mouse State\nif <(MobileControls) = [1]> then\n    Mobile controls\nend\nbroadcast (update v)\nerase all\nbroadcast (draw v)\nbroadcast (ui v)\n\n@Draw\n\ndefine Draw 3D line - p1 (x1) (y1) (z1) p2 (x2) (y2) (z2) size (size)\nSet Point 1 ((x1) - (CameraX)) ((y1) - (CameraY)) ((z1) - (CameraZ))\nSet Point 2 ((x2) - (CameraX)) ((y2) - (CameraY)) ((z2) - (CameraZ))\nSet Point 1 (((z1) * (sinY)) + ((x1) * (cosY))) (y1) (((z1) * (cosY)) - ((x1) * (sinY)))\nSet Point 2 (((z2) * (sinY)) + ((x2) * (cosY))) (y2) (((z2) * (cosY)) - ((x2) * (sinY)))\nSet Point 1 (x1) (((y1) * (cosX)) - ((z1) * (sinX))) (((y1) * (sinX)) + ((z1) * (cosX)))\nSet Point 2 (x2) (((y2) * (cosX)) - ((z2) * (sinX))) (((y2) * (sinX)) + ((z2) * (cosX)))\nif <<(z1) > (NearZ)> or <(z2) > (NearZ)>> then\n    Z clipping\n    set pen size to (((size) / (((z1) + (z2)) / (2))) * (FL))\n    go to x: (((x1) / (z1)) * (FL)) y: (((y1) / (z1)) * (FL))\n    pen down\n    go to x: (((x2) / (z2)) * (FL)) y: (((y2) / (z2)) * (FL))\n    pen up\nend\n\ndefine Set Point 1 (x) (y) (z)\nset [x1 v] to (x)\nset [y1 v] to (y)\nset [z1 v] to (z)\n\ndefine Draw\nInit trigonometry\nswitch costume to (small v)\nset size to ((1) / (0)) %\nswitch costume to (big v)\nBlock Order\nDraw All Blocks\n\ndefine Init trigonometry\nset [sinx v] to ([sin v] of (CameraRotX) )\nset [cosx v] to ([cos v] of (CameraRotX) )\nset [siny v] to ([sin v] of (CameraRotY) )\nset [cosy v] to ([cos v] of (CameraRotY) )\n\ndefine Set Point 2 (x) (y) (z)\nset [x2 v] to (x)\nset [y2 v] to (y)\nset [z2 v] to (z)\n\ndefine Z clipping\nif <<(z1) < (NearZ)> or <(z2) < (NearZ)>> then\n    set [p v] to (((NearZ) - (z1)) / ((z2) - (z1)))\n    if <(z1) < (NearZ)> then\n        Set Point 1 ((x1) + (((x2) - (x1)) * (p))) ((y1) + (((y2) - (y1)) * (p))) (NearZ)\n    else\n        Set Point 2 ((x1) + (((x2) - (x1)) * (p))) ((y1) + (((y2) - (y1)) * (p))) (NearZ)\n    end\nend\n\ndefine Init\nset [nearz v] to [0.3]\nset [fl v] to [300]\n\nwhen I receive [draw v]\nDraw\n\nwhen I receive [init v]\nInit\n\ndefine Draw Block at (x) (y) (z) size (sizex) (sizey) (sizez)\nDraw 3D line - p1 ((x) + ()) ((y) + ()) ((z) + ()) p2 ((x) + (sizex)) ((y) + ()) ((z) + ()) size [0.05]\nDraw 3D line - p1 ((x) + (sizex)) ((y) + ()) ((z) + ()) p2 ((x) + (sizex)) ((y) + (sizey)) ((z) + ()) size [0.05]\nDraw 3D line - p1 ((x) + (sizex)) ((y) + (sizey)) ((z) + ()) p2 ((x) + ()) ((y) + (sizey)) ((z) + ()) size [0.05]\nDraw 3D line - p1 ((x) + ()) ((y) + (sizey)) ((z) + ()) p2 ((x) + ()) ((y) + ()) ((z) + ()) size [0.05]\nDraw 3D line - p1 ((x) + ()) ((y) + ()) ((z) + (sizez)) p2 ((x) + (sizex)) ((y) + ()) ((z) + (sizez)) size [0.05]\nDraw 3D line - p1 ((x) + (sizex)) ((y) + ()) ((z) + (sizez)) p2 ((x) + (sizex)) ((y) + (sizey)) ((z) + (sizez)) size [0.05]\nDraw 3D line - p1 ((x) + (sizex)) ((y) + (sizey)) ((z) + (sizez)) p2 ((x) + ()) ((y) + (sizey)) ((z) + (sizez)) size [0.05]\nDraw 3D line - p1 ((x) + ()) ((y) + (sizey)) ((z) + (sizez)) p2 ((x) + ()) ((y) + ()) ((z) + (sizez)) size [0.05]\nDraw 3D line - p1 ((x) + ()) ((y) + ()) ((z) + ()) p2 ((x) + ()) ((y) + ()) ((z) + (sizez)) size [0.05]\nDraw 3D line - p1 ((x) + (sizex)) ((y) + ()) ((z) + ()) p2 ((x) + (sizex)) ((y) + ()) ((z) + (sizez)) size [0.05]\nDraw 3D line - p1 ((x) + ()) ((y) + (sizey)) ((z) + ()) p2 ((x) + ()) ((y) + (sizey)) ((z) + (sizez)) size [0.05]\nDraw 3D line - p1 ((x) + (sizex)) ((y) + (sizey)) ((z) + ()) p2 ((x) + (sizex)) ((y) + (sizey)) ((z) + (sizez)) size [0.05]\n\ndefine Draw All Blocks\nset [i v] to [0]\nrepeat (length of [layerids v])\n    change [i v] by (1)\n    set [getid v] to (item (i) of [layerids v])\n    set pen color to (item (getID) of [blockcolor v])\n    set pen (transparency v) to (40)\n    Draw Block at (item (getID) of [blockx v]) (item (getID) of [blocky v]) (item (getID) of [blockz v]) size (item (getID) of [blocksizex v]) (item (getID) of [blocksizey v]) (item (getID) of [blocksizez v])\nend\nset pen color to (#004c4c)\nset pen (transparency v) to (0)\n\ndefine Block Order\ndelete all of [layerids v]\ndelete all of [layervalues v]\nset [i v] to [0]\nrepeat (length of [blockx v])\n    change [i v] by (1)\n    set [vx v] to (((item (i) of [blockx v]) + ((item (i) of [blocksizex v]) / (2))) - (CameraX))\n    set [vy v] to (((item (i) of [blocky v]) + ((item (i) of [blocksizey v]) / (2))) - (CameraY))\n    set [vz v] to (((item (i) of [blockz v]) + ((item (i) of [blocksizez v]) / (2))) - (CameraZ))\n    set [z v] to (((vx) * (vx)) + (((vy) * (vy)) + ((vz) * (vz))))\n    add (z) to [layervalues v]\n    set [sort_low v] to [1]\n    set [sort_high v] to (length of [layervalues v])\n    repeat until <not <(sort_Low) < (sort_High)>>\n        set [sort_mid v] to ([floor v] of (((sort_Low) + (sort_High)) / (2)) )\n        if <(z) < (item (item (sort_Mid) of [layerids v]) of [layervalues v])> then\n            set [sort_low v] to ((sort_Mid) + (1))\n        else\n            set [sort_high v] to (sort_Mid)\n        end\n    end\n    insert (i) at (sort_Low) of [layerids v] \nend\n\n@Update\n\nwhen I receive [update v]\nUpdate\n\ndefine Update Camera Rotation\nif <(JoyStickActive) = [0]> then\n    if <(MousePress) = [1]> then\n        set [mousecamerax v] to (mouse x)\n        set [mousecameray v] to (mouse y)\n        set [mousecamera v] to [1]\n    else\n        if <<mouse down?> and <(MouseCamera) = [1]>> then\n            change [camerarotx v] by (((mouse y) - (MouseCameraY)) * (0.5))\n            change [cameraroty v] by (((mouse x) - (MouseCameraX)) * (-0.5))\n            set [mousecamerax v] to (mouse x)\n            set [mousecameray v] to (mouse y)\n        end\n    end\nelse\n    if <(MobileControls) = [1]> then\n        set [mousecamera v] to [0]\n    end\nend\nif <(WASD_Arrow) = [0]> then\n    change [camerarotx v] by ((<key (up arrow v) pressed?> - <key (down arrow v) pressed?>) * ((180) * (DeltaTime)))\n    change [cameraroty v] by ((<key (right arrow v) pressed?> - <key (left arrow v) pressed?>) * ((-180) * (DeltaTime)))\nelse\n    change [camerarotx v] by ((<<key (w v) pressed?> or <key (z v) pressed?>> - <key (s v) pressed?>) * ((180) * (DeltaTime)))\n    change [cameraroty v] by ((<key (d v) pressed?> - <<key (a v) pressed?> or <key (q v) pressed?>>) * ((-180) * (DeltaTime)))\nend\nif <(CameraRotX) < [-90]> then\n    set [camerarotx v] to [-90]\nend\nif <(CameraRotX) > [0]> then\n    set [camerarotx v] to [0]\nend\n\ndefine Update\nUpdate Camera Rotation\nUpdate Player\nPlayer Shadow\nUpdate Camera Position\nreplace item (1) of [blockx v] with (PlayerX)\nreplace item (1) of [blocky v] with (PlayerY)\nreplace item (1) of [blockz v] with (PlayerZ)\nreplace item (2) of [blockx v] with (PlayerX)\nreplace item (2) of [blocky v] with (ShadowY)\nreplace item (2) of [blockz v] with (PlayerZ)\n\ndefine Update Player\nPlayer Y movement <(PlayerVelY) > [0]>\nif <(MobileControls) = [1]> then\n    set [movex v] to (JoystickVx)\n    set [movez v] to (JoystickVy)\n    set [mag v] to [1]\nelse\n    if <(WASD_Arrow) = [0]> then\n        set [movex v] to (<key (d v) pressed?> - <<key (a v) pressed?> or <key (q v) pressed?>>)\n        set [movez v] to (<<key (w v) pressed?> or <key (z v) pressed?>> - <key (s v) pressed?>)\n    else\n        set [movex v] to (<key (right arrow v) pressed?> - <key (left arrow v) pressed?>)\n        set [movez v] to (<key (up arrow v) pressed?> - <key (down arrow v) pressed?>)\n    end\n    set [mag v] to ([sqrt v] of (((moveX) * (moveX)) + ((moveZ) * (moveZ))) )\nend\nif <(mag) > [0]> then\n    set [movex v] to (((moveX) / (mag)) * ((DeltaTime) * (4)))\n    set [movez v] to (((moveZ) / (mag)) * ((DeltaTime) * (4)))\n    Player XZ movement (((moveX) * ([cos v] of (CameraRotY) )) - ((moveZ) * ([sin v] of (CameraRotY) ))) (((moveX) * ([sin v] of (CameraRotY) )) + ((moveZ) * ([cos v] of (CameraRotY) )))\nend\n\ndefine Update Camera Position\nset [camerax v] to (((PlayerX) + ((PlayerSize) / (2))) + ((8) * (([sin v] of (CameraRotY) ) * ([cos v] of (CameraRotX) ))))\nset [cameray v] to (((PlayerY) + ((PlayerSize) / (2))) + ((-8) * ([sin v] of (CameraRotX) )))\nset [cameraz v] to (((PlayerZ) + ((PlayerSize) / (2))) + ((-8) * (([cos v] of (CameraRotY) ) * ([cos v] of (CameraRotX) ))))\n\ndefine Check Player Collision\nif <(collision) = [end]> then\n    stop [this script v]\nend\ndelete all of [collisionid v]\ndelete all of [collisiontype v]\nset [c v] to [2]\nset [collision v] to [0]\nrepeat ((length of [blockx v]) - (2))\n    change [c v] by (1)\n    if <<(PlayerX) < ((item (c) of [blockx v]) + (item (c) of [blocksizex v]))> and <((PlayerX) + (PlayerSize)) > (item (c) of [blockx v])>> then\n        if <<(PlayerY) < ((item (c) of [blocky v]) + (item (c) of [blocksizey v]))> and <((PlayerY) + (PlayerSize)) > (item (c) of [blocky v])>> then\n            if <<(PlayerZ) < ((item (c) of [blockz v]) + (item (c) of [blocksizez v]))> and <((PlayerZ) + (PlayerSize)) > (item (c) of [blockz v])>> then\n                set [collision v] to [1]\n                add (c) to [collisionid v]\n                add (item (c) of [blocktype v]) to [collisiontype v]\n            end\n        end\n    end\nend\nif <[collisiontype v] contains [end]?> then\n    set [collision v] to [end]\n    change [level v] by (1)\n    broadcast (InitLevel v)\n    start sound [end v]\n    set [joystickactive v] to [0]\n    set [joystickox v] to [-170]\n    set [joystickoy v] to [-110]\nend\nif <<[collisiontype v] contains [lava]?> or <(PlayerY) < [-3]>> then\n    set [playerx v] to (PlayerStartX)\n    set [playery v] to (PlayerStartY)\n    set [playerz v] to (PlayerStartZ)\n    set [playervely v] to [0]\n    set [cameraroty v] to [0]\n    set [collision v] to [0]\n    start sound [die v]\n    set [joystickactive v] to [0]\n    set [joystickox v] to [-170]\n    set [joystickoy v] to [-110]\nend\n\nwhen I receive [initlevel v]\nset [playervely v] to [0]\n\ndefine Player Y movement <ydir>\nchange [playery v] by ((PlayerVelY) * (DeltaTime))\nchange [playervely v] by ((-15) * (DeltaTime))\nif <(PlayerVelY) < [-8]> then\n    set [playervely v] to [-8]\nend\nchange [playery v] by (((<ydir> * (2)) - (1)) * (0.001))\nCheck Player Collision\nif <(collision) = [1]> then\n    if <<(PlayerVelY) < ((-100) * (DeltaTime))> and <not <[collisiontype v] contains [bouncy]?>>> then\n        start sound [ground v]\n    end\n    set [playervely v] to [0]\n    if <ydir> then\n        set [c v] to [0]\n        repeat (length of [collisionid v])\n            change [c v] by (1)\n            set [gety v] to ((item (item (c) of [collisionid v]) of [blocky v]) - (PlayerSize))\n            if <(getY) < (PlayerY)> then\n                set [playery v] to (getY)\n            end\n        end\n    else\n        set [c v] to [0]\n        repeat (length of [collisionid v])\n            change [c v] by (1)\n            set [gety v] to ((item (item (c) of [collisionid v]) of [blocky v]) + (item (item (c) of [collisionid v]) of [blocksizey v]))\n            if <(getY) > (PlayerY)> then\n                set [playery v] to (getY)\n            end\n        end\n        if <[collisiontype v] contains [bouncy]?> then\n            set [playervely v] to [9]\n            start sound [bouncy v]\n        else\n            if <<key (space v) pressed?> or <(ActionValue) = [1]>> then\n                set [playervely v] to [6]\n                start sound [jump v]\n            end\n        end\n    end\nelse\n    change [playery v] by (((<ydir> * (2)) - (1)) * (-0.001))\nend\n\ndefine Player XZ movement (x) (z)\nchange [playerx v] by (x)\nCheck Player Collision\nif <(collision) = [1]> then\n    change [playerx v] by (() - (x))\nend\nchange [playerz v] by (z)\nCheck Player Collision\nif <(collision) = [1]> then\n    change [playerz v] by (() - (z))\nend\n\ndefine Player Shadow\nset [c v] to [2]\nset [shadowy v] to [-999999]\nrepeat ((length of [blockx v]) - (2))\n    change [c v] by (1)\n    if <<(PlayerX) < ((item (c) of [blockx v]) + (item (c) of [blocksizex v]))> and <((PlayerX) + (PlayerSize)) > (item (c) of [blockx v])>> then\n        if <<(PlayerZ) < ((item (c) of [blockz v]) + (item (c) of [blocksizez v]))> and <((PlayerZ) + (PlayerSize)) > (item (c) of [blockz v])>> then\n            set [gety v] to ((item (c) of [blocky v]) + (item (c) of [blocksizey v]))\n            if <<(ShadowY) < (getY)> and <not <(PlayerY) < (getY)>>> then\n                set [shadowy v] to (getY)\n            end\n        end\n    end\nend\n\nwhen I receive [initlevel v]\nset [collision v] to [0]\n\n@Levels\n\nwhen I receive [initlevel v]\nInit level\n\ndefine Init level\ndelete all of [blockx v]\ndelete all of [blocky v]\ndelete all of [blockz v]\ndelete all of [blocksizex v]\ndelete all of [blocksizey v]\ndelete all of [blocksizez v]\ndelete all of [blockcolor v]\ndelete all of [blocktype v]\nset [cameraroty v] to [0]\nif <(Level) = [1]> then\n    Level 1\n    stop [this script v]\nend\nif <(Level) = [2]> then\n    Level 2\n    stop [this script v]\nend\nif <(Level) = [3]> then\n    Level 3\n    stop [this script v]\nend\nif <(Level) = [4]> then\n    Level 4\n    stop [this script v]\nend\nif <(Level) = [5]> then\n    Level 5\n    stop [this script v]\nend\nif <(Level) = [6]> then\n    Level 6\n    stop [this script v]\nend\nif <(Level) = [7]> then\n    Level 7\n    stop [this script v]\nend\nif <(Level) = [8]> then\n    Level 8\n    stop [this script v]\nend\nif <(Level) = [9]> then\n    Level 9\n    stop [this script v]\nend\nif <(Level) = [10]> then\n    Level 10\n    stop [this script v]\nend\nif <(Level) = [11]> then\n    show variable [☁ best time v]\n    broadcast (tut v)\n    if <(DEBUG) = [0]> then\n        set [your time v] to (timer)\n        show variable [your time v]\n        if <(timer) < (☁ Best Time)> then\n            set [☁ best time v] to (timer)\n        end\n    end\n    Level 11\n    stop [this script v]\nend\nif <(Level) = [12]> then\n    Level 12\n    stop [this script v]\nend\n\ndefine Level 1\nAdd Player [4.5] [0] [0.5]\nAdd Block at [4] [0] [0] size [2] [1] [2] type [ground]\nAdd Block at [3] [0] [0.5] size [1] [1] [1] type [ground]\nAdd Block at [0] [0] [0] size [3] [1] [4] type [ground]\nAdd Block at [1] [0] [4] size [1] [1] [3] type [ground]\nAdd Block at [0] [0] [7] size [3] [1] [4] type [ground]\nAdd Block at [4] [0] [7] size [2] [2] [2] type [ground]\nAdd Block at [7] [2] [5] size [1] [1] [1] type [ground]\nAdd Block at [8] [0] [7] size [2] [4] [2] type [ground]\nAdd Block at [8] [3] [7] size [4] [1] [2] type [ground]\nAdd Block at [13] [0] [6] size [4] [1] [4] type [end]\n\nwhen I receive [init v]\nInit\n\ndefine Add Block at (x) (y) (z) size (sizex) (sizey) (sizez) type (type)\nadd (x) to [blockx v]\nadd (y) to [blocky v]\nadd (z) to [blockz v]\nadd (sizex) to [blocksizex v]\nadd (sizey) to [blocksizey v]\nadd (sizez) to [blocksizez v]\nadd (item (item # of (type) in [blocktypename v]) of [blocktypecolor v]) to [blockcolor v]\nadd (type) to [blocktype v]\n\ndefine Add Player (x) (y) (z)\nset [playerx v] to (x)\nset [playery v] to (y)\nset [playerz v] to (z)\nset [playerstartx v] to (x)\nset [playerstarty v] to (y)\nset [playerstartz v] to (z)\nAdd Block at (PlayerX) (PlayerY) (PlayerZ) size (PlayerSize) (PlayerSize) (PlayerSize) type [player]\nAdd Block at [0] [0] [0] size (PlayerSize) [0] (PlayerSize) type [shadow]\n\ndefine Add Block Type (name) color (r) (g) (b)\nadd (name) to [blocktypename v]\nadd ((((r) * (65536)) + ((g) * (256))) + (b)) to [blocktypecolor v]\n\ndefine Init\nset [debug v] to <key (q v) pressed?>\nhide variable [☁ best time v]\nhide variable [your time v]\nset [level v] to [1]\nset [playersize v] to [0.8]\nset [camerarotx v] to [-20]\ndelete all of [blocktypename v]\ndelete all of [blocktypecolor v]\nInit Block Types\nbroadcast (InitLevel v)\n\ndefine Init Block Types\nAdd Block Type [player] color [100] [255] [255]\nAdd Block Type [shadow] color [100] [100] [255]\nAdd Block Type [ground] color [255] [255] [255]\nAdd Block Type [end] color [0] [255] [0]\nAdd Block Type [lava] color [255] [0] [0]\nAdd Block Type [bouncy] color [255] [255] [0]\n\ndefine Level 2\nAdd Player [0] [1] [0]\nAdd Block at [0] [0] [0] size [1] [1] [1] type [ground]\nAdd Block at [0] [0] [3] size [3] [3] [3] type [ground]\nAdd Block at [0] [0] [8] size [5] [5] [5] type [ground]\nAdd Block at [0] [0] [16] size [11] [11] [11] type [ground]\nAdd Block at [2] [1] [0] size [1] [1] [1] type [bouncy]\nAdd Block at [4] [3] [5] size [1] [1] [1] type [bouncy]\nAdd Block at [-1] [0] [16] size [1] [1] [1] type [bouncy]\nAdd Block at [-1] [2] [19] size [1] [1] [1] type [bouncy]\nAdd Block at [-1] [4] [22] size [1] [1] [1] type [bouncy]\nAdd Block at [-1] [6] [25] size [1] [1] [1] type [bouncy]\nAdd Block at [-1] [8] [27] size [1] [1] [1] type [bouncy]\nAdd Block at [3] [11] [19] size [5] [5] [5] type [ground]\nAdd Block at [3] [11] [18] size [1] [1] [1] type [bouncy]\nAdd Block at [7] [13] [18] size [1] [1] [1] type [bouncy]\nAdd Block at [4] [16] [20] size [3] [3] [3] type [ground]\nAdd Block at [4] [16] [23] size [3] [1] [1] type [ground]\nAdd Block at [5] [17] [23] size [1] [1] [1] type [ground]\nAdd Block at [5] [19] [21] size [1] [1] [1] type [end]\n\nwhen [n v] key pressed\nif <(DEBUG) = [1]> then\n    change [level v] by (1)\n    broadcast (InitLevel v)\nend\n\ndefine Level 3\nAdd Player [2] [1] [2]\nAdd Block at [1] [0] [1] size [3] [1] [3] type [ground]\nAdd Block at [2] [1] [5] size [1] [1] [1] type [bouncy]\nAdd Block at [2] [3] [7] size [1] [1] [1] type [bouncy]\nAdd Block at [2] [5] [9] size [1] [1] [1] type [bouncy]\nAdd Block at [2] [7] [11] size [1] [1] [1] type [ground]\nAdd Block at [5] [8] [10] size [11] [0.5] [3] type [ground]\nAdd Block at [7] [8.5] [12] size [1] [0.5] [1] type [lava]\nAdd Block at [8] [8.5] [10] size [1] [0.5] [1] type [lava]\nAdd Block at [10] [8.5] [11] size [2] [0.5] [1] type [lava]\nAdd Block at [13] [8.5] [10] size [1] [0.5] [1] type [lava]\nAdd Block at [14] [8.5] [9] size [2] [0.5] [1] type [bouncy]\nAdd Block at [14] [0] [1] size [3] [0.5] [3] type [ground]\nAdd Block at [15] [0.5] [2] size [1] [0.1] [1] type [end]\n\ndefine Level 4\nAdd Player [1] [1] [1]\nAdd Block at [0] [0] [0] size [3] [1] [40] type [ground]\nAdd Block at [0] [1] [3] size [3] [0.1] [1] type [lava]\nAdd Block at [0] [1] [6] size [3] [0.1] [1] type [lava]\nAdd Block at [1] [1] [9] size [1] [1] [1] type [lava]\nAdd Block at [0] [1] [11.5] size [0.8] [1] [1] type [lava]\nAdd Block at [2.2] [1] [11.5] size [0.8] [1] [1] type [lava]\nAdd Block at [0] [1] [14] size [3] [1] [1] type [bouncy]\nAdd Block at [0] [1] [15] size [3] [3] [1] type [lava]\nAdd Block at [0.5] [1] [18] size [2.5] [0.1] [5] type [lava]\nAdd Block at [0] [1] [24.5] size [2.5] [0.1] [5] type [lava]\nAdd Block at [0.3] [1] [32] size [0.1] [2] [0.1] type [lava]\nAdd Block at [2.4] [1] [32] size [0.1] [2] [0.1] type [lava]\nAdd Block at [1.1] [1] [33] size [0.1] [2] [0.1] type [lava]\nAdd Block at [2.9] [1] [34] size [0.1] [2] [0.1] type [lava]\nAdd Block at [1.3] [1] [34] size [0.1] [2] [0.1] type [lava]\nAdd Block at [1] [1] [35] size [0.1] [2] [0.1] type [lava]\nAdd Block at [1] [1] [36.5] size [0.1] [2] [0.1] type [lava]\nAdd Block at [2] [1] [36.5] size [0.1] [2] [0.1] type [lava]\nAdd Block at [2.9] [1] [36.5] size [0.1] [2] [0.1] type [lava]\nAdd Block at [0] [1] [39] size [3] [4] [1] type [end]\n\ndefine Level 5\nAdd Player [5] [1] [5]\nAdd Block at [0] [0] [5] size [11] [1] [1] type [ground]\nAdd Block at [5] [0] [0] size [1] [1] [11] type [ground]\nAdd Block at [5] [9] [5] size [1] [1] [1] type [end]\nAdd Block at [5] [6] [5] size [1] [3] [1] type [ground]\nAdd Block at [0] [5] [5] size [11] [1] [1] type [ground]\nAdd Block at [5] [5] [0] size [1] [1] [11] type [ground]\nAdd Block at [7] [1] [7] size [1] [1] [1] type [bouncy]\nAdd Block at [9] [2.5] [9] size [1] [1] [1] type [bouncy]\nAdd Block at [11] [5] [7] size [1] [1] [5] type [bouncy]\nAdd Block at [7] [5] [11] size [5] [1] [1] type [bouncy]\nAdd Block at [3] [6] [3] size [1] [1] [1] type [bouncy]\n\ndefine Level 6\nAdd Player [0] [1] [0]\nAdd Block at [0] [0] [0] size [1] [1] [1] type [bouncy]\nAdd Block at [-1] [12] [3] size [1] [1] [1] type [bouncy]\nAdd Block at [0] [10] [4] size [1] [1] [1] type [bouncy]\nAdd Block at [3] [10] [1] size [1] [1] [1] type [bouncy]\nAdd Block at [-1] [8] [1] size [1] [1] [1] type [bouncy]\nAdd Block at [0] [7] [-3] size [1] [1] [1] type [bouncy]\nAdd Block at [2] [5] [3] size [1] [1] [1] type [bouncy]\nAdd Block at [4] [4] [-2] size [1] [1] [1] type [bouncy]\nAdd Block at [2] [3] [-2] size [1] [1] [1] type [bouncy]\nAdd Block at [3] [2] [-1] size [1] [1] [1] type [bouncy]\nAdd Block at [-3] [1] [4] size [1] [1] [1] type [bouncy]\nAdd Block at [0] [2] [3] size [1] [1] [1] type [bouncy]\nAdd Block at [4] [4] [-3] size [1] [1] [1] type [bouncy]\nAdd Block at [-1] [5] [-4] size [1] [1] [1] type [bouncy]\nAdd Block at [3] [6] [-2] size [1] [1] [1] type [bouncy]\nAdd Block at [1] [7] [2] size [1] [1] [1] type [bouncy]\nAdd Block at [3] [8] [-3] size [1] [1] [1] type [bouncy]\nAdd Block at [2] [9] [-2] size [1] [1] [1] type [bouncy]\nAdd Block at [-1] [11] [4] size [1] [1] [1] type [bouncy]\nAdd Block at [-4] [12] [3] size [1] [1] [1] type [bouncy]\nAdd Block at [-1] [15] [0] size [1] [1] [1] type [end]\n\ndefine Level 7\nAdd Player [0] [10] [0]\nAdd Block at [0] [10] [0] size [1] [0.1] [1] type [ground]\nAdd Block at [6] [10] [0] size [1] [0.1] [1] type [ground]\nAdd Block at [6] [10] [0] size [1] [1] [1] type [end]\nAdd Block at [-7] [0] [0] size [0.5] [0.1] [0.5] type [end]\n\ndefine Level 8\nAdd Player [0] [1] [0]\nAdd Block at [0] [0] [0] size [12] [0.1] [9] type [lava]\nAdd Block at [0.35] [0] [0.35] size [0.1] [1] [0.1] type [ground]\nAdd Block at [1] [0] [3] size [0.1] [2] [0.1] type [ground]\nAdd Block at [3] [0] [3] size [0.1] [3] [0.1] type [ground]\nAdd Block at [4] [0] [1] size [0.1] [3.5] [0.1] type [ground]\nAdd Block at [7] [0] [1] size [0.1] [1] [0.1] type [ground]\nAdd Block at [9] [0] [1] size [0.1] [2] [0.1] type [bouncy]\nAdd Block at [7] [0] [3] size [0.1] [4.5] [0.1] type [bouncy]\nAdd Block at [3] [0] [5] size [0.1] [4.5] [0.1] type [bouncy]\nAdd Block at [1] [0] [7.5] size [0.1] [7] [0.1] type [bouncy]\nAdd Block at [6] [0] [7.5] size [0.1] [7] [0.1] type [ground]\nAdd Block at [11] [0] [8] size [0.1] [6.5] [0.1] type [ground]\nAdd Block at [10.5] [6.3] [7.5] size [1] [1] [1] type [end]\n\ndefine Level 9\nAdd Player [2] [1] [2]\nAdd Block at [2.5] [20] [2.5] size [0.1] [10] [0.1] type [end]\nAdd Block at [0] [0] [0] size [5] [0.1] [5] type [ground]\nAdd Block at [0] [5] [0] size [5] [0.1] [5] type [ground]\nAdd Block at [0] [10] [0] size [5] [0.1] [5] type [ground]\nAdd Block at [0] [15] [0] size [5] [0.1] [5] type [ground]\nAdd Block at [0] [20] [0] size [5] [0.1] [5] type [ground]\nAdd Block at [0] [0] [0] size [0.1] [20] [0.1] type [lava]\nAdd Block at [0] [0] [5] size [0.1] [20] [0.1] type [lava]\nAdd Block at [5] [0] [0] size [0.1] [20] [0.1] type [lava]\nAdd Block at [5] [0] [5] size [0.1] [20] [0.1] type [lava]\nAdd Block at [6] [1] [2] size [1] [0.1] [1] type [bouncy]\nAdd Block at [6] [3.5] [2] size [1] [0.1] [1] type [bouncy]\nAdd Block at [2] [5.5] [8] size [1] [0.1] [1] type [bouncy]\nAdd Block at [2] [7.5] [9] size [1] [0.1] [1] type [bouncy]\nAdd Block at [3] [9.5] [9] size [1] [0.1] [1] type [bouncy]\nAdd Block at [-1] [11] [-1] size [1] [0.1] [1] type [bouncy]\nAdd Block at [4] [11.5] [-1] size [1] [0.1] [1] type [bouncy]\nAdd Block at [7] [13] [2] size [1] [0.1] [1] type [bouncy]\nAdd Block at [3] [16] [3] size [1] [0.1] [1] type [bouncy]\nAdd Block at [7] [17] [3] size [1] [0.1] [1] type [bouncy]\nAdd Block at [7] [18.5] [7] size [1] [0.1] [1] type [bouncy]\n\ndefine Level 10\nAdd Player [0] [1] [0]\nAdd Block at [0] [0] [0] size [1] [1] [1] type [ground]\nAdd Block at [3] [0] [3] size [1] [1] [1] type [ground]\nAdd Block at [3.45] [1] [3.45] size [0.1] [1] [0.1] type [lava]\nAdd Block at [6] [0] [0] size [1] [1] [1] type [ground]\nAdd Block at [6.45] [1] [0.45] size [0.1] [1] [0.1] type [lava]\nAdd Block at [9] [0] [3] size [1] [1] [1] type [bouncy]\nAdd Block at [9.45] [1] [3.45] size [0.1] [1] [0.1] type [lava]\nAdd Block at [9] [4] [3] size [1] [1] [1] type [bouncy]\nAdd Block at [9] [3.8] [3] size [1] [0.2] [1] type [lava]\nAdd Block at [6] [2] [6] size [1] [1] [1] type [bouncy]\nAdd Block at [3] [4] [3] size [1] [1] [1] type [bouncy]\nAdd Block at [6] [4] [0] size [1] [1] [1] type [bouncy]\nAdd Block at [3] [8] [3] size [1] [0.2] [1] type [lava]\nAdd Block at [6] [8] [0] size [1] [0.2] [1] type [lava]\nAdd Block at [0] [6] [0] size [1] [1] [1] type [end]\n\ndefine Level 11\nAdd Player [6] [1] [0]\nAdd Block at [0] [0] [0] size [13] [0.1] [5] type [ground]\nAdd Block at [1] [3] [3] size [5] [1] [1] type [lava]\nAdd Block at [2] [2] [3] size [1] [3] [1] type [lava]\nAdd Block at [3] [1] [3] size [1] [3] [1] type [lava]\nAdd Block at [4] [2] [3] size [1] [3] [1] type [lava]\nAdd Block at [7] [3] [3] size [5] [1] [1] type [bouncy]\nAdd Block at [8] [1] [3] size [1] [3] [1] type [bouncy]\nAdd Block at [9] [2] [3] size [1] [3] [1] type [bouncy]\nAdd Block at [10] [1] [3] size [1] [3] [1] type [bouncy]\nAdd Block at [6] [7] [3] size [1] [1] [1] type [end]\nAdd Block at [6] [0] [6] size [1] [1] [1] type []\nAdd Block at [6] [1] [8] size [1] [1] [1] type []\nAdd Block at [7] [2] [5] size [1] [1] [1] type []\n\nwhen [g v] key pressed\nif <(DEBUG) = [1]> then\n    set [debugx v] to (PlayerX)\n    set [debugy v] to (PlayerY)\n    set [debugz v] to (PlayerZ)\nend\n\nwhen [t v] key pressed\nif <(DEBUG) = [1]> then\n    set [playerx v] to (DebugX)\n    set [playery v] to (DebugY)\n    set [playerz v] to (DebugZ)\nend\n\ndefine Level 12\nAdd Player [0] [20] [0]\nrepeat (20)\n    Add Block at (pick random (-10) to (10)) (pick random (0) to (20)) (pick random (-10) to (10)) size (pick random (0) to (3.0)) (pick random (0) to (3.0)) (pick random (0) to (3.0)) type [bouncy]\n    Add Block at (pick random (-10) to (10)) (pick random (0) to (20)) (pick random (-10) to (10)) size (pick random (0) to (3.0)) (pick random (0) to (3.0)) (pick random (0) to (3.0)) type [lava]\nend\n\n@UI\n\ndefine Draw Joystick\nset pen size to ((JoyStickSize) * (2))\nset pen color to (#ffffff)\nset pen (transparency v) to (80)\ngo to x: (JoystickOx) y: (JoystickOy)\npen down\npen up\ngo to x: ((JoystickOx) + ((JoystickVx) * (JoyStickSize))) y: ((JoystickOy) + ((JoystickVy) * (JoyStickSize)))\nset pen size to (JoyStickSize)\nset pen (transparency v) to (75)\npen down\npen up\nset pen size to ((JoyStickSize) * (0.85))\nset pen (transparency v) to (75)\npen down\npen up\nif <(JoyStickActive) = [1]> then\n    if <(ActionValue) = [1]> then\n        set pen color to (#00f2ff)\n    end\n    go to x: (170) y: (-110)\n    set pen size to ((JoyStickSize) * (2))\n    set pen (transparency v) to (80)\n    pen down\n    pen up\n    set pen size to ((JoyStickSize) * (1.8))\n    set pen (transparency v) to (80)\n    pen down\n    pen up\nend\n\nwhen I receive [ui v]\nMobile Controls\nDraw Buttons\n\ndefine Mobile Controls\nif <(MobileControls) = [1]> then\n    Draw Joystick\nend\nif <<<(mouse x) > [190]> and <(mouse y) > [150]>> and <(MousePress) = [1]>> then\n    set [mobilecontrols v] to ((1) - (MobileControls))\nend\nif <(MobileControls) = [0]> then\n    if <<<(mouse x) < [-190]> and <(mouse y) > [150]>> and <(MousePress) = [1]>> then\n        set [wasd_arrow v] to ((1) - (WASD_Arrow))\n    end\nend\n\ndefine Draw Buttons\nset pen size to (60)\nset pen color to (#ffffff)\nset pen (transparency v) to (80)\nDraw Line [300] [180] [220] [180]\nset pen size to (1)\nset pen (transparency v) to (0)\nif <(MobileControls) = [1]> then\n    Draw Line [208] [162] [228] [162]\n    Draw Line [228] [175] [228] [162]\n    Draw Line [208] [175] [228] [175]\n    Draw Line [208] [162] [208] [175]\n    Draw Line [212] [155] [224] [155]\n    set pen size to (3)\n    Draw Line [218] [160] [218] [158]\nelse\n    Draw Line [215] [155] [228] [155]\n    Draw Line [228] [175] [228] [155]\n    Draw Line [215] [175] [228] [175]\n    Draw Line [215] [155] [215] [175]\n    set pen size to (3)\n    Draw Line [221.5] [158] [221.5] [158]\nend\nif <(MobileControls) = [0]> then\n    set pen size to (60)\n    set pen color to (#ffffff)\n    set pen (transparency v) to (80)\n    Draw Line [-300] [180] [-220] [180]\n    set pen size to (1)\n    if <(WASD_Arrow) = [1]> then\n        set pen color to (#d47474)\n    else\n        set pen color to (#44d4d4)\n    end\n    Draw Line [-235] [157] [-211] [157]\n    Draw Line [-235] [165] [-211] [165]\n    Draw Line [-235] [157] [-211] [157]\n    Draw Line [-227] [157] [-227] [173]\n    Draw Line [-219] [157] [-219] [173]\n    Draw Line [-235] [157] [-235] [165]\n    Draw Line [-211] [157] [-211] [165]\n    Draw Line [-227] [173] [-219] [173]\nend\n\ndefine Draw Line (x1) (y1) (x2) (y2)\ngo to x: (x1) y: (y1)\npen down\ngo to x: (x2) y: (y2)\npen up\n\nwhen I receive [init v]\nhide\n\n@thumb\n\nwhen flag clicked\nhide\n\ngo to [front v] layer\ngo to x: (0) y: (0)\nshow\n\n@Tutorial?\n\nwhen flag clicked\nhide\nwait (60) seconds\nif <(Level) < [11]> then\n    Do \nend\n\nwhen I receive [tut v]\nDo \n\ndefine Do <boolean>\ngo to x: (0) y: (-180)\nset [ghost v] effect to (100)\nshow\nrepeat (50)\n    change y by (0.4)\n    change [ghost v] effect by (-2)\nend\nif <boolean> then\n    wait (8) seconds\n    repeat (50)\n        change y by (-0.4)\n        change [ghost v] effect by (2)\n    end\n    hide\nend\n\n
WASD or Arrow keys to move.\nJump over obstacles and gaps, Break blocks and earn coins. Get to the green flag at the end to pass the level.\npro tip: die to get more coins\n\nCurrently there are 4 levels\n\nWarning: This game might lag but probably wont.