Cuby // A Scrolling Interactive Platformer #games #platformer
@Stage\n\nwhen flag clicked\nbroadcast (Start v)\nset volume to (100) %\nforever\n    play sound [Popsicle v] until done\nend\n\n@player\n\ndefine Touch Ground <up?>\nchange [falling? v] by (1)\nif <touching (moving platform v)?> then\n    set [touch_m+p v] to [yes]\nelse\n    set [touch_m+p v] to [no]\nend\nif <touching (moving platform2 v)?> then\n    set [touch_m+p_2 v] to [yes]\nelse\n    set [touch_m+p_2 v] to [no]\nend\nif <touching (faulty bricks v)?> then\n    set [faulty_plat v] to [yes]\nelse\n    set [faulty_plat v] to [no]\nend\nrepeat until <not <<touching (ground v)?> or <<touching (moving platform v)?> or <<touching (moving platform2 v)?> or <<touching (faulty bricks v)?> or <touching (bricks v)?>>>>>>\n    if <up?> then\n        change y by (-1)\n    else\n        change y by (1)\n        set [falling? v] to [0]\n    end\n    set [speed y v] to [0]\nend\n\nwhen flag clicked\nset [☁ viewed v] to (pick random (1) to (10000))\nset [d_jump v] to [2]\nswitch costume to (1 v)\nset size to (130) %\nset rotation style [left-right v]\nset [scroll x v] to [-960]\nset [checkpoint v] to [-960]\nbroadcast (setup v) and wait\ngo to x: (0) y: (100)\nset [speed y v] to [0]\nset [falling? v] to [10]\ncreate clone of (_myself_ v)\nforever\n    change [speed y v] by (-1)\n    change y by (speed y)\n    Touch Ground <(speed y) > [0]>\n    if <(PWR_shield) = [off]> then\n        if <(wall jump) > [0]> then\n            change [wall jump v] by (-1)\n        else\n            set [speed x v] to ((speed x) * (0.7))\n            if <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <key (j v) pressed?>>> then\n                change [speed x v] by (1.5)\n            end\n            if <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <key (g v) pressed?>>> then\n                change [speed x v] by (-1.5)\n            end\n        end\n    else\n        set [speed x v] to [0]\n    end\n    if <(speed x) > [0.5]> then\n        Walk (90) (speed x)\n    else\n        if <(speed x) < [-0.5]> then\n            Walk (-90) (speed x)\n        else\n            set [frame v] to [0]\n        end\n    end\n    if <(PWR_shield) = [off]> then\n        change y by (-5)\n        if <<touching (ground v)?> or <<touching (moving platform v)?> or <<touching (moving platform2 v)?> or <<touching (faulty bricks v)?> or <touching (bricks v)?>>>>> then\n            if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <key (y v) pressed?>>> then\n                if <[powerups v] contains [double1]?> then\n                    if <(costume [number v]) = [4]> then\n                        set [speed y v] to [18]\n                    else\n                        set [speed y v] to [15]\n                    end\n                else\n                    set [speed y v] to [15]\n                end\n            end\n        end\n        change y by (5)\n    end\n    if <touching (spring v)?> then\n        set [speed y v] to [22]\n    end\n    if <(y position) < [-180]> then\n        broadcast (reset v)\n    end\n    change [scroll x v] by (x position)\n    set x to (0)\n    set [sheild y v] to (y position)\n    change y by (-3)\n    broadcast (tick v)\n    if <<touching color (#ff0000)?> or <touching (chomper v)?>> then\n        broadcast (reset v)\n    end\n    erase all\n    change y by (3)\nend\n\ngo to x: (0) y: (100)\nset [speed y v] to [0]\nset [scroll x v] to (Checkpoint)\n\ndefine Walk (direction) (speed)\npoint in direction (direction)\nchange x by (speed)\nchange [frame v] by (0.5)\nset [slope v] to [0]\nwall (speed)\n\ndefine wall (speed x)\nrepeat until <<(slope) = [8]> or <not <<touching (ground v)?> or <<touching (moving platform v)?> or <<touching (moving platform2 v)?> or <<touching (faulty bricks v)?> or <touching (bricks v)?>>>>>>>\n    change y by (1)\n    change [slope v] by (1)\n    if <<<key (up arrow v) pressed?> or <<key (w v) pressed?> or <key (y v) pressed?>>> and <([abs v] of (speed x) ) > [3]>> then\n        if <(wall jump) = [0]> then\n            set [speed x v] to ((-1.2) * (speed x))\n            set [speed y v] to [11]\n            set [falling? v] to [6]\n            set [wall jump v] to [15]\n        end\n    else\n        set [speed x v] to [0]\n    end\nend\nif <(slope) = [8]> then\n    change x by ((0) - (speed x))\n    change y by ((0) - (slope))\nend\n\nwhen I receive [start v]\nshow\n\nwhen flag clicked\nforever\n    set [y velocity v] to (speed y)\n    set [x velocity v] to (speed x)\n    if <touching (boss v)?> then\n        if <(PWR_shield) = [off]> then\n            if <(lives) < [2]> then\n                set [lives v] to [0]\n                set [scroll x v] to [3000]\n                broadcast (reset v)\n                set y to (-100)\n                set [lives v] to [3]\n            else\n                change [lives v] by (-1)\n            end\n        end\n    end\nend\n\nwhen I receive [bounce v]\nset [speed y v] to [10]\n\nwhen I start as a clone\nswitch costume to (2 v)\nforever\n    set y to (sheild y)\n    go to [back v] layer\n    if <key (1 v) pressed?> then\n        if <[powerups v] contains [shield1]?> then\n            set [pwr_shield v] to [on]\n            show\n        end\n    else\n        set [pwr_shield v] to [off]\n        hide\n    end\nend\n\ndefine check for squeezing\nswitch costume to (1 v)\nchange y by (1)\nif <touching (bricks v)?> then\n    switch costume to (crouch v)\nelse\n    if <key (2 v) pressed?> then\n        if <[powerups v] contains [double1]?> then\n            switch costume to (dd v)\n        else\n            switch costume to (1 v)\n        end\n    else\n        switch costume to (1 v)\n    end\nend\nchange y by (-1)\n\nwhen I receive [-1 \(y\) v]\nchange y by (-1)\n\nwhen I receive [reset v]\nset [scroll x v] to (Checkpoint)\ngo to x: (0) y: (100)\nset [speed y v] to [0]\nset [falling? v] to [10]\n\ndefine back out of <sprite>\nrepeat until <not <touching (spring v)?>>\n    change y by (1)\nend\n\nback out of <>\n\ndefine pysics\npysics\n\nwhen I receive [boss v]\nset [checkpoint v] to [3000]\n\nwhen flag clicked\nforever\n    if <(cages/coins) = [5]> then\n        broadcast (end v)\n    end\nend\n\nchange y by (-5)\n\n\n\nwhen flag clicked\nwait until <(cages/coins) = [5]>\nbroadcast (cloud end v)\n\nwhen flag clicked\nforever\n    if <key (down arrow v) pressed?> then\n        switch costume to (crouch v)\n    else\n        check for squeezing\n    end\nend\n\n@bricks\n\nwhen I receive [tick v]\nset x to ((pos x) - (scroll x))\nif <<(x position) < [-270]> and <(pos x) < (Checkpoint)>> then\n    delete this clone\nend\nif <<(costume [number v]) = [4]> or <(costume [number v]) = [3]>> then\n    if <(costume [number v]) = [4]> then\n        quick canon switch\n        set x to ((pos x) - (scroll x))\n        turn right (1) degrees\n    else\n        point towards (player v)\n    end\nelse\n    point in direction (90)\nend\n\nwhen flag clicked\nset pen size to (3)\nset pen color to (#ff0000)\npoint in direction (90)\nhide\ngo to x: (0) y: (0)\nswitch costume to (block v)\nset [pos x v] to [0]\n\nwhen I receive [setup v]\nmake [8] ground at [-240]\nmake [4] ground at [528]\nCreate [block x4] At [0] [192]\nCreate [block x4] At [48] [192]\nCreate [block] At [0] [0]\nCreate [block] At [48] [0]\nCreate [canon] At [-48] [0]\nCreate [block] At [-192] [-144]\nCreate [eye] At [-192] [-96]\nCreate [lower block] At [528] [-144]\nCreate [block x4] At [720] [24]\nCreate [block] At [720] [-168]\nCreate [block x2] At [768] [-192]\nCreate [eye] At [816] [-144]\nCreate [eye] At [1008] [-144]\nCreate [block x2] At [1008] [-192]\nCreate [block x4] At [1104] [-48]\nmake [4] ground at [-960]\nCreate [block] At [-720] [-192]\nmake [6] ground at [-624]\nCreate [block x4] At [-720] [0]\nCreate [block x4] At [-624] [-96]\nCreate [upper block] At [-528] [-144]\nCreate [upper block] At [-480] [-144]\nCreate [upper block] At [-432] [-144]\nCreate [block x4] At [1343] [-48]\nmake [3] ground at [1152]\nmake [5] ground at [1392]\nCreate [block x4] At [1440] [96]\nCreate [block x4] At [1584] [96]\nCreate [block x4] At [1440] [288]\nCreate [upper block] At [1632] [0]\nCreate [upper block] At [1728] [0]\nCreate [upper block] At [1824] [0]\nCreate [block x4] At [1872] [288]\nCreate [canon] At [1872] [96]\nmake [4] ground at [1920]\nCreate [block x4] At [2064] [0]\nCreate [upper block] At [2160] [0]\nmake [10] ground at [3000]\nCreate [block x4] At [2952] [-48]\nCreate [block x4] At [2952] [144]\nCreate [block x4] At [3480] [48]\nCreate [block x4] At [3480] [144]\nCreate [block] At [3480] [-192]\nCreate [upper block] At [3048] [-48]\nCreate [upper block] At [3144] [0]\nCreate [upper block] At [3288] [0]\n\ndefine Create (costume) At (x) (y)\nset [pos x v] to (x)\nset y to (y)\nif <(costume) = [eye]> then\n    switch costume to (eye block v)\n    create clone of (_myself_ v)\n    switch costume to (eye v)\n    create clone of (_myself_ v)\nelse\n    if <(costume) = [canon]> then\n        switch costume to (eye block v)\n        create clone of (_myself_ v)\n        switch costume to (turret v)\n        create clone of (_myself_ v)\n    else\n        switch costume to (costume)\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I start as a clone\nshow\n\ndefine make (#) ground at (x)\nset [ground v] to (x)\nrepeat (#)\n    Create [block] At (ground) [-192]\n    change [ground v] by (48)\nend\n\nwhen flag clicked\nreset canon timer\nforever\n    wait (0.3) seconds\n    change [canon timer v] by (0.1)\nend\n\ndefine reset canon timer\nset [canon timer v] to [0]\n\ndefine quick canon switch\nturn right (1) degrees\nswitch costume to (laser_check v)\nset [counting laser v] to [0]\nif <<(username) = [Troider]> and <(cheat laser) = [1]>> then\n    pen up\nelse\n    pen down\nend\nrepeat until <<touching (_edge_ v)?> or <touching (player v)?>>\n    move (1) steps\n    change [counting laser v] by (-1)\nend\npen up\nmove (counting laser) steps\nturn left (1) degrees\nswitch costume to (turret v)\n\nstamp\n\npen down\n\ndefine check canon timer\nif <(costume [number v]) = [4]> then\n    if <not < (canon timer) contains [.]?>> then\n        quick canon switch\n    end\nend\n\nwhen I receive [reset v]\nif <(costume [number v]) = [4]> then\n    point in direction (90)\nend\n\nwhen flag clicked\nset [cheat laser v] to [0]\nforever\n    if <key (q v) pressed?> then\n        wait until <not <key (q v) pressed?>>\n        if <(cheat laser) = [1]> then\n            set [cheat laser v] to [0]\n        else\n            set [cheat laser v] to [1]\n        end\n    end\nend\n\nif <not <touching (_edge_ v)?>> then\n\nerase all\n\nwhen flag clicked\nforever\n\nchange [counting laser v] by (-2)\nmove (2) steps\n\nCreate [block x4] At [1344] [-48]\n\n@chomper\n\ndefine Create (costume) At (x) (y)\nset [pos x v] to (x)\nset y to (y)\nswitch costume to (costume)\ncreate clone of (_myself_ v)\n\nwhen I receive [tick v]\nset x to ((pos x) - (scroll x))\npoint in direction (90)\n\nwhen I receive [setup v]\nCreate [spikes] At [576] [-144]\nCreate [spikes] At [624] [-144]\nCreate [spikes] At [-816] [-144]\nCreate [spikes] At [-864] [-144]\nCreate [3] At [48] [-48]\nCreate [4] At [0] [-48]\nCreate [2] At [-672] [-192]\nCreate [spikes] At [-528] [-96]\nCreate [spikes] At [-480] [-96]\nCreate [spikes] At [-432] [-96]\nCreate [spikes] At [1152] [-144]\nCreate [spikes] At [1200] [-144]\nCreate [spikes] At [1248] [-144]\nCreate [2] At [-288] [-192]\nCreate [2] At [-336] [-192]\nCreate [5] At [1440] [-96]\nCreate [6] At [1584] [-96]\nCreate [spikes] At [1920] [-144]\nCreate [spikes] At [1968] [-144]\nCreate [spikes] At [2016] [-144]\n\nCreate [spikes] At [1296] [-144]\n\nwhen flag clicked\npoint in direction (90)\nhide\ngo to x: (0) y: (0)\nset [pos x v] to [0]\n\nwhen I start as a clone\ngo to [back v] layer\nshow\nforever\n    if <<(costume [number v]) > [2]> and <(costume [number v]) < [5]>> then\n        forever\n            wait (1) seconds\n            repeat (9)\n                change y by (-15)\n            end\n            wait (0.5) seconds\n            repeat (27)\n                change y by (5)\n            end\n        end\n    end\n    if <<(costume [number v]) > [4]> and <(costume [number v]) < [7]>> then\n        forever\n            repeat (10)\n                change y by (-8.6)\n            end\n            wait (0.5) seconds\n            repeat (20)\n                change y by (4.3)\n            end\n            wait (1) seconds\n        end\n    end\nend\n\n@enemies\n\ndefine Create (costume) At (x) (y)\nset [pos x v] to (x)\nset y to (y)\nswitch costume to (costume)\ncreate clone of (_myself_ v)\n\nwhen I receive [setup v]\n\nCreate [1] At [60] [-160]\nCreate [1] At [48] [-160]\nCreate [1] At [80] [-160]\nCreate [1] At [120] [-160]\n\nwhen I start as a clone\ngo to [front v] layer\nshow\n\nwhen I receive [tick v]\nif <(costume [number v]) = [1]> then\n    set x to ((pos x) - (scroll x))\n    point in direction (90)\n    if <(distance to [player v]) < [170]> then\n        set rotation style [left-right v]\n        point towards (player v)\n        if <(direction) < [0]> then\n            change [pos x v] by (-3)\n        else\n            change [pos x v] by (3)\n        end\n        if <touching (player v)?> then\n            if <(Y VELOCITY) < [0]> then\n                switch costume to (costume2 v)\n                broadcast (bounce v)\n                delete this clone\n            else\n                broadcast (reset v)\n            end\n        end\n    end\nend\n\nwhen flag clicked\npoint in direction (90)\nhide\ngo to x: (0) y: (0)\nset [pos x v] to [0]\n\nif <(costume [number v]) = [2]> then\n    point in direction (pick random (0) to (360))\n    repeat (25)\n        move (3) steps\n        change [ghost v] effect by (3)\n    end\n    delete this clone\nend\n\n@moving platform\n\nwhen flag clicked\nhide\n\nshow\nswitch costume to (1s v)\ngo to [back v] layer\nforever\n    go to x: (0) y: (-192)\nend\n\nwhen I receive [setup v]\nCreate [1] At [442] [-192]\n\nwhen I receive [tick v]\n\nif <(costume [number v]) = [1]> then\n    set x to ((pos x) - (scroll x))\n    if <(O I) = [Right]> then\n        if <not <(pos x) < [146]>> then\n            change [pos x v] by (-2)\n        end\n    else\n        if <not <(pos x) > [478]>> then\n            change [pos x v] by (2)\n        end\n    end\n    if <(Touch_M+P) = [yes]> then\n        if <key (down arrow v) pressed?> then\n            wait until <key (down arrow v) pressed?>\n            if <(O I) = [Right]> then\n                set [o i v] to [Left]\n            else\n                set [o i v] to [Right]\n            end\n        end\n    end\nend\n\nwhen flag clicked\npoint in direction (90)\nhide\ngo to x: (0) y: (0)\nswitch costume to (block v)\nset [pos x v] to [0]\n\ndefine Create (costume) At (x) (y)\nset [m_p 1 v] to (x)\nset y to (y)\nswitch costume to (costume)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\ngo to [back v] layer\nshow\nforever\n    set x to ((M_P 1) - (scroll x))\n    if <key (down arrow v) pressed?> then\n        if <(Touch_M+P) = [yes]> then\n            if <not <(M_P 1) > [478]>> then\n                change [m_p 1 v] by (2)\n                change [scroll x v] by (2)\n            end\n        end\n    else\n        if <not <(M_P 1) < [146]>> then\n            change [m_p 1 v] by (-2)\n            if <(Touch_M+P) = [yes]> then\n                change [scroll x v] by (-2)\n            end\n        end\n    end\nend\n\nwhen flag clicked\nset [o i v] to [Right]\ndelete all of [previous y velocity v]\nadd (Y VELOCITY) to [previous y velocity v]\nadd (Y VELOCITY) to [previous y velocity v]\nadd (Y VELOCITY) to [previous y velocity v]\nforever\n    wait (0.05) seconds\n    add (Y VELOCITY) to [previous y velocity v]\n    delete (1) of [previous y velocity v]\nend\n\nif <(costume [number v]) = [1]> then\nend\n\nif <(O I) = [Right]> then\nelse\nend\nif  then\n    if  then\n        wait until <key (down arrow v) pressed?>\n        if <(O I) = [Right]> then\n            set [o i v] to [Left]\n        else\n            set [o i v] to [Right]\n        end\n    end\nend\n\nset [scroll x v] to [2]\n\n@power-ups\n\nwhen flag clicked\ndelete all of [powerups v]\nhide\nreset powerup timer\nforever\n    change [powerup timer v] by (0.05)\n    wait (0.05) seconds\nend\n\ndefine reset powerup timer\nset [powerup timer v] to [0]\n\nwhen I receive [tick v]\ngo to x: ((pos x) - (scroll x)) y: (((((([sin v] of ((powerup timer) * (400)) ) * (10)) - (480)) mod (960)) - (480)) + (Enemy position))\nif <not <<(costume [number v]) = [2]> or <(costume [number v]) = [4]>>> then\n    point in direction (90)\n    if <touching (player v)?> then\n        if <not <[powerups v] contains (costume [name v])?>> then\n            add (costume [name v]) to [powerups v]\n        end\n        delete this clone\n    end\nelse\n    set [ghost v] effect to (50)\n    go to [back v] layer\n    turn right (3) degrees\n    if <[powerups v] contains (join (costume [name v]) [1])?> then\n        delete this clone\n    end\nend\n\ndefine Create (costume) At (x) (y)\nset size to (70) %\nset [pos x v] to (x)\nset [enemy position v] to (y)\nswitch costume to (join (costume) [1])\ncreate clone of (_myself_ v)\nswitch costume to (costume)\ncreate clone of (_myself_ v)\n\nwhen I receive [setup v]\nCreate [shield] At [-192] [0]\nCreate [double] At [1104] [50]\n\nwhen I start as a clone\nshow\n\n@moving platform2\n\nwhen flag clicked\nhide\n\nshow\nswitch costume to (1s v)\ngo to [back v] layer\nforever\n    go to x: (0) y: (-192)\nend\n\nwhen I receive [setup v]\nCreate [1] At [672] [-144]\n\nwhen I receive [tick v]\nif <(costume [number v]) = [1]> then\n    set x to ((pos x) - (scroll x))\n    if <(O I) = [Right]> then\n        if <not <(y position) < [-142]>> then\n            change y by (-2)\n        end\n    else\n        if <not <(y position) > [46]>> then\n            change y by (2)\n        end\n    end\n    if <(Touch_M+P_2) = [yes]> then\n        if <key (down arrow v) pressed?> then\n            wait until <key (down arrow v) pressed?>\n            if <(O I) = [Right]> then\n                set [o i v] to [Left]\n            else\n                set [o i v] to [Right]\n            end\n        end\n    end\nend\n\nwhen flag clicked\npoint in direction (90)\nhide\ngo to x: (0) y: (0)\nswitch costume to (block v)\nset [pos x v] to [0]\n\ndefine Create (costume) At (x) (y)\nset [pos x v] to (x)\nset y to (y)\nswitch costume to (costume)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\ngo to [back v] layer\nshow\nforever\nend\n\nwhen flag clicked\nset [o i v] to [Right]\ndelete all of [previous y velocity v]\nadd (Y VELOCITY) to [previous y velocity v]\nadd (Y VELOCITY) to [previous y velocity v]\nadd (Y VELOCITY) to [previous y velocity v]\nforever\n    wait (0.05) seconds\n    add (Y VELOCITY) to [previous y velocity v]\n    delete (1) of [previous y velocity v]\nend\n\nchange [pos x v] by (-2)\n\n@checkpoints\n\ndefine Create checkpoint At (x) (y)\nset [pos x v] to (x)\nset y to (y)\nswitch costume to (red v)\ncreate clone of (_myself_ v)\nadd (pos x) to [checkpoints v]\n\nwhen I receive [tick v]\npoint in direction (90)\nset x to ((pos x) - (scroll x))\nCheck all checkpoints\nif <(Checkpoint) = (pos x)> then\n    switch costume to (green v)\nelse\n    switch costume to (red v)\nend\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\n\nwhen I receive [setup v]\ndelete all of [checkpoints v]\nCreate checkpoint At [-960] [-144]\nCreate checkpoint At [-240] [-144]\nCreate checkpoint At [720] [72]\nCreate checkpoint At [1632] [48]\n\ndefine Check all checkpoints\nset [c_checkp v] to [0]\nrepeat (length of [checkpoints v])\n    change [c_checkp v] by (1)\n    if <<(scroll x) > ((item (C_CHECKP) of [checkpoints v]) - (20))> and <(scroll x) < ((item (C_CHECKP) of [checkpoints v]) + (20))>> then\n        if <<([y position v] of [player v]) < ((y position) + (48))> and <([y position v] of [player v]) > ((y position) - (48))>> then\n            set [checkpoint v] to (item (C_CHECKP) of [checkpoints v])\n        end\n    end\nend\n\n@faulty bricks\n\ndefine Create (costume) At (x) (y)\nset [pos x v] to (x)\nset y to (y)\nswitch costume to (costume)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\n\nwhen flag clicked\npoint in direction (90)\nhide\ngo to x: (0) y: (0)\nswitch costume to (!!! upper block v)\nset [pos x v] to [0]\n\nwhen I receive [tick v]\nset x to ((pos x) - (scroll x))\npoint in direction (90)\nif <<(pre_Yvel) < [0]> and <<(Faulty_plat) = [yes]> and <<(scroll x) > ((pos x) - (36))> and <(scroll x) < ((pos x) + (36))>>>> then\n    delete this clone\nend\n\nif <not <(letter (length of (costume [name v])) of (costume [name v])) = [2]>> then\n\nwait until <not <(pre_Yvel) < [0]>>\n\nwhen I receive [setup v]\nCreate [1] At [864] [-144]\nCreate [1] At [912] [-144]\nCreate [1] At [960] [-144]\nCreate [1] At [3432] [0]\n\nchange [ghost v] effect by (5)\nchange y by (-5)\n\nwhen flag clicked\nset [pre_yvel v] to [0]\nforever\n    set [pre_yvel v] to (Y VELOCITY)\n    wait (0) seconds\nend\n\nwhen I receive [reset v]\nbroadcast (again reset v)\ndelete this clone\n\nwhen I receive [again reset v]\nCreate [1] At [864] [-144]\nCreate [1] At [912] [-144]\nCreate [1] At [960] [-144]\nCreate [1] At [3432] [0]\n\nwait (0.05) seconds\n\nset [pre_yvel v] to [0]\n\nwait (0.1) seconds\n\nrepeat (10)\n    change [ghost v] effect by (2)\nend\n\n@Spring\n\nwhen I receive [tick v]\npoint in direction (90)\nset x to ((pos x) - (scroll x))\nif <touching (player v)?> then\n    switch costume to (sprung v)\nelse\n    switch costume to (spring v)\nend\n\nwhen I start as a clone\nshow\n\nwhen flag clicked\nhide\n\nwhen I receive [setup v]\ncreate spring at [768] [-144]\ncreate spring at [1056] [-144]\ncreate spring at [-768] [-192]\ncreate spring at [1872] [-192]\ncreate spring at [1296] [-192]\n\ndefine create spring at (x) (y)\nset [pos x v] to (x)\nset y to (y)\nswitch costume to (spring v)\ncreate clone of (_myself_ v)\n\n@cage\n\ndefine Create (costume) At (x) (y)\nset size to (70) %\nset [pos x v] to (x)\nset [enemy position v] to (y)\nswitch costume to (join (costume) [1])\ncreate clone of (_myself_ v)\nswitch costume to (costume)\ncreate clone of (_myself_ v)\n\nwhen I receive [setup v]\nCreate [1] At [-48] [48]\nCreate [1] At [672] [-120]\nCreate [1] At [-720] [50]\nCreate [1] At [2064] [50]\nCreate [1] At [3480] [-144]\n\nwhen I start as a clone\nshow\n\nwhen I receive [tick v]\ngo to x: ((pos x) - (scroll x)) y: (((((([sin v] of ((powerup timer) * (400)) ) * (5)) - (480)) mod (960)) - (480)) + (Enemy position))\nif <touching (player v)?> then\n    change [cages/coins v] by (0.5)\n    delete this clone\nend\n\nwhen flag clicked\nhide\nset [cages/coins v] to [0]\n\nCreate [1] At [-144] [0]\n\n@boss\n\ndefine Create (costume) At (x) (y)\nset [pos x v] to (x)\nset y to (y)\nif <(costume) = [man]> then\n    switch costume to (right v)\n    create clone of (_myself_ v)\n    switch costume to (up_g v)\n    create clone of (_myself_ v)\nelse\n    if <(costume) = [canon]> then\n        switch costume to (eye block v)\n        create clone of (_myself_ v)\n        switch costume to (turret v)\n        create clone of (_myself_ v)\n    else\n        switch costume to (costume)\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I receive [boss v]\nCreate [man] At [3432] [-154]\n\nwhen flag clicked\npoint in direction (90)\nhide\ngo to x: (0) y: (0)\nswitch costume to (right v)\n\nwhen I start as a clone\nshow\nif <<(costume [number v]) = [3]> or <(costume [number v]) = [2]>> then\n    forever\n        wait (0.5) seconds\n        quick switch\n    end\nend\n\nwhen I receive [tick v]\nif <<(costume [number v]) = [1]> or <(costume [number v]) = [5]>> then\n    if <(pos x) > (scroll x)> then\n        switch costume to (left v)\n    else\n        switch costume to (right v)\n    end\nend\nif <not <(costume [number v]) = [4]>> then\n    set x to ((pos x) - (scroll x))\nend\nif <<(costume [number v]) = [3]> or <(costume [number v]) = [2]>> then\n    point towards (player v)\n    if <(direction) < [0]> then\n        switch costume to (down_g v)\n    else\n        switch costume to (up_g v)\n    end\nelse\n    if <not <(costume [number v]) = [4]>> then\n        point in direction (90)\n    end\nend\nif <(costume [number v]) = [4]> then\n    if <not <<touching (_edge_ v)?> or <<touching (bricks v)?> or <<touching (faulty bricks v)?> or <touching (player v)?>>>>> then\n        move ((10) + (X VELOCITY)) steps\n    else\n        delete this clone\n    end\nend\nif <<(Y VELOCITY) < [0]> and <<touching (player v)?> and <<(costume [number v]) = [5]> or <(costume [number v]) = [1]>>>> then\n    broadcast (defeated v)\nend\n\nset rotation style [left-right v]\npoint towards (player v)\n\nset rotation style [all around v]\n\ndefine quick switch\nset [p_cos v] to (costume [number v])\nswitch costume to (bullet v)\ncreate clone of (_myself_ v)\nswitch costume to (P_COS)\n\nhide\n\nbroadcast (boss v)\n\nwhen I receive [defeated v]\ndelete this clone\n\n@lives\n\ndefine create lives\nbroadcast (lives v)\nhide\ngo to x: (-213) y: (150)\nrepeat (lives)\n    create clone of (_myself_ v)\n    change x by (35)\nend\n\nwhen I receive [lives v]\ndelete this clone\n\nwhen I start as a clone\nshow\n\nwhen flag clicked\nhide\n\nchange [lives v] by (1)\n\nwhen I receive [boss v]\nset [lives v] to [3]\nforever\n    create lives\nend\n\n@portal\n\nwhen flag clicked\nset size to (135) %\nhide\nset [portal speed v] to [0]\nrepeat (3)\n    change [portal speed v] by (2)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [tick v]\ngo to x: ((2160) - (scroll x)) y: (60)\nturn right (portal speed) degrees\nif <touching (player v)?> then\n    broadcast (boss v)\n    set [scroll x v] to [3000]\nend\n\nwhen I start as a clone\nshow\n\nif  then\nend\n\n@Thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\nforever\n    go to [front v] layer\nend\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nset [ghost v] effect to (100)\n\nhide\n\nwhen I receive [end v]\nchange [ghost v] effect by (-10)\n\nwhen I receive [cloud end v]\n\nset [☁ finished v] to (pick random (1) to (10000))\n\n
This project came 1st in @hamster46's contest!\n\n----------------------------Story-------------------------------\nA mean robber has kidnapped your little brothers, you have to try and find all five and defeat the robber, but a lot of tough obstacles have been put in your path.\n-----------------------------------------------------------------\nInstructions:\n• Up arrow = Jump\n• Down Arrow = Crouch and activate hidden moving platforms (there's two)\n• Right and left arrows = move\n• Hold 1 = Use laser and bullet shield (if you have it)\n• Hold 2 = Use Jump boost (if you have it)\n• Collect all five little brothers that are in cages\n• Avoid spikes, lava, lasers, bullets and chompers \n• Use trampoline to bounce high\n• Touch checkpoints so when you die you don't have to restart \n• Collect power-ups to use them\n• Try to avoid the blue platforms (they break unless you jump quickly or don't fall on top of them)\n• To wall jump you have to hold up arrow and the arrow in the direction of the wall you want to jump on\n• Go into the portal to go to the boss level  \n• Can be laggy for some people that do not have a strong device to plat it on\n• In the boss level you have to try and avoid the bullets and jump on top of his head while holding the shield\nHint: Jump on the blue platform above him and hold the shield\n• Don't forget to have fun!\n-----------------------------------------------------------------\n\nPlease ❤️ + ⭐️