Parallel Platformer |A Monochromatic Platformer|
@Stage\n\nwhen flag clicked\nset volume to (100) %\nforever\n    play sound [timelapseL v] until done\nend\n\nwhen flag clicked\nforever\n    if <([costume # v] of [ground v]) = [15]> then\n        switch backdrop to (backdrop3 v)\n    else\n        switch backdrop to (backdrop2 v)\n    end\nend\n\n@Cuby\n\nwhen flag clicked\nset [ready v] to [0]\nforever\n    wait until <touching color (#808080)?>\n    change [ready v] by (1)\n    wait until <not <touching color (#808080)?>>\n    change [ready v] by (-1)\nend\n\nwhen flag clicked\nforever\n    if <(Ready) = [4]> then\n        if <(Ready) = [4]> then\n            broadcast (Fish v)\n            wait (1) seconds\n            broadcast (I just died v)\n            change [lvl v] by (1)\n        end\n    end\nend\n\nwhen I receive [i just died v]\ngo to x: (-200) y: (-150)\nset [y vel v] to [0]\nset [x vel v] to [0]\n\nwhen I receive [stay der v]\nwait (STAY de) seconds\ngo to x: (-200) y: (-150)\nset [y vel v] to [0]\nset [x vel v] to [0]\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nchange [color v] effect by (1)\nrepeat (10)\n    change size by (-2)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <(ehfehkt) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\ndefine platform physics (jump height) (gravity) (friction) (movement speed) (wall jump vm) (wall jump hm)\nset rotation style [left-right v]\nchange y by (y vel)\nif <touching color (#000000)?> then\n    repeat ([abs v] of (y vel) )\n        if <touching color (#000000)?> then\n            change y by ((-1) * (([abs v] of (y vel) ) / (y vel)))\n        end\n    end\n    if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> and <not <(y vel) > [0]>>> then\n        set [y vel v] to (jump height)\n    else\n        set [y vel v] to [0]\n    end\nelse\n    change [y vel v] by (gravity)\nend\nif <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n    change [x vel v] by (movement speed)\n    point in direction (90)\nend\nif <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n    change [x vel v] by ((-1) * (movement speed))\n    point in direction (-90)\nend\nchange x by (x vel)\nif <touching color (#000000)?> then\n    set [old y v] to (y position)\n    repeat (([abs v] of (x vel) ) + (1))\n        if <touching color (#000000)?> then\n            change y by (1)\n        end\n    end\n    if <touching color (#000000)?> then\n        set y to (old y)\n        repeat ([ceiling v] of ([abs v] of (x vel) ) )\n            if <touching color (#000000)?> then\n                change x by ((-1) * (([abs v] of (x vel) ) / (x vel)))\n            end\n        end\n        if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n            if <(x vel) < [0]> then\n                set [x vel v] to [0]\n                if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n                    point in direction (90)\n                    set [x vel v] to (wall jump hm)\n                    set [y vel v] to (wall jump vm)\n                end\n            else\n                set [x vel v] to [0]\n                if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n                    point in direction (-90)\n                    set [x vel v] to ((-1) * (wall jump hm))\n                    set [y vel v] to (wall jump vm)\n                end\n            end\n        end\n    end\nend\nset [x vel v] to ((x vel) * (friction))\n\nwhen flag clicked\ngo to x: (-200) y: (-150)\nshow\nset [y vel v] to [0]\nset [x vel v] to [0]\nforever\n    if <touching color (#b2b2b2)?> then\n        broadcast (Fish v)\n        wait until <not <touching color (#b2b2b2)?>>\n    end\n    platform physics (12) (-1) (0.9) (1) (8) (8)\nend\n\n@Cuby2\n\nwhen I start as a clone\nforever\n    if <(ehfehkt) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nswitch costume to (clone v)\nrepeat (10)\n    change size by (-2)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I receive [stay der v]\nwait (STAY de) seconds\ngo to x: (-200) y: (50)\nset [y vel v] to [0]\nset [x vel v] to [0]\n\nwhen I receive [i just died v]\ngo to x: (-200) y: (50)\nset [y vel v] to [0]\nset [x vel v] to [0]\n\nwhen flag clicked\nset [ready v] to [0]\nforever\n    wait until <touching color (#808080)?>\n    change [ready v] by (1)\n    wait until <not <touching color (#808080)?>>\n    change [ready v] by (-1)\nend\n\ndefine platform physics (jump height) (gravity) (friction) (movement speed) (wall jump vm) (wall jump hm)\nset rotation style [left-right v]\nchange y by (y vel)\nif <touching color (#000000)?> then\n    repeat ([abs v] of (y vel) )\n        if <touching color (#000000)?> then\n            change y by ((-1) * (([abs v] of (y vel) ) / (y vel)))\n        end\n    end\n    if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> and <not <(y vel) > [0]>>> then\n        set [y vel v] to (jump height)\n    else\n        set [y vel v] to [0]\n    end\nelse\n    change [y vel v] by (gravity)\nend\nif <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n    change [x vel v] by (movement speed)\n    point in direction (90)\nend\nif <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n    change [x vel v] by ((-1) * (movement speed))\n    point in direction (-90)\nend\nchange x by (x vel)\nif <touching color (#000000)?> then\n    set [old y v] to (y position)\n    repeat (([abs v] of (x vel) ) + (1))\n        if <touching color (#000000)?> then\n            change y by (1)\n        end\n    end\n    if <touching color (#000000)?> then\n        set y to (old y)\n        repeat ([ceiling v] of ([abs v] of (x vel) ) )\n            if <touching color (#000000)?> then\n                change x by ((-1) * (([abs v] of (x vel) ) / (x vel)))\n            end\n        end\n        if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n            if <(x vel) < [0]> then\n                set [x vel v] to [0]\n                if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n                    point in direction (90)\n                    set [x vel v] to (wall jump hm)\n                    set [y vel v] to (wall jump vm)\n                end\n            else\n                set [x vel v] to [0]\n                if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n                    point in direction (-90)\n                    set [x vel v] to ((-1) * (wall jump hm))\n                    set [y vel v] to (wall jump vm)\n                end\n            end\n        end\n    end\nend\nset [x vel v] to ((x vel) * (friction))\n\nwhen flag clicked\nswitch costume to (normal v)\ngo to x: (-200) y: (50)\nshow\nset [y vel v] to [0]\nset [x vel v] to [0]\nforever\n    if <touching color (#b2b2b2)?> then\n        broadcast (Fish v)\n        wait until <not <touching color (#b2b2b2)?>>\n    end\n    platform physics (12) (-1) (0.9) (1) (8) (8)\nend\n\n@Cuby3\n\nwhen I start as a clone\nforever\n    if <(ehfehkt) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I start as a clone\nchange [color v] effect by (1)\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-2)\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nset [ready v] to [0]\nforever\n    wait until <touching color (#808080)?>\n    change [ready v] by (1)\n    wait until <not <touching color (#808080)?>>\n    change [ready v] by (-1)\nend\n\nwhen I receive [i just died v]\ngo to x: (-200) y: (-50)\nset [y vel v] to [0]\nset [x vel v] to [0]\n\nwhen I receive [stay der v]\nwait (STAY de) seconds\ngo to x: (-200) y: (-50)\nset [y vel v] to [0]\nset [x vel v] to [0]\n\ndefine platform physics (jump height) (gravity) (friction) (movement speed) (wall jump vm) (wall jump hm)\nset rotation style [left-right v]\nchange y by (y vel)\nif <touching color (#000000)?> then\n    repeat ([abs v] of (y vel) )\n        if <touching color (#000000)?> then\n            change y by ((-1) * (([abs v] of (y vel) ) / (y vel)))\n        end\n    end\n    if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> and <not <(y vel) > [0]>>> then\n        set [y vel v] to (jump height)\n    else\n        set [y vel v] to [0]\n    end\nelse\n    change [y vel v] by (gravity)\nend\nif <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n    change [x vel v] by (movement speed)\n    point in direction (90)\nend\nif <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n    change [x vel v] by ((-1) * (movement speed))\n    point in direction (-90)\nend\nchange x by (x vel)\nif <touching color (#000000)?> then\n    set [old y v] to (y position)\n    repeat (([abs v] of (x vel) ) + (1))\n        if <touching color (#000000)?> then\n            change y by (1)\n        end\n    end\n    if <touching color (#000000)?> then\n        set y to (old y)\n        repeat ([ceiling v] of ([abs v] of (x vel) ) )\n            if <touching color (#000000)?> then\n                change x by ((-1) * (([abs v] of (x vel) ) / (x vel)))\n            end\n        end\n        if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n            if <(x vel) < [0]> then\n                set [x vel v] to [0]\n                if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n                    point in direction (90)\n                    set [x vel v] to (wall jump hm)\n                    set [y vel v] to (wall jump vm)\n                end\n            else\n                set [x vel v] to [0]\n                if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n                    point in direction (-90)\n                    set [x vel v] to ((-1) * (wall jump hm))\n                    set [y vel v] to (wall jump vm)\n                end\n            end\n        end\n    end\nend\nset [x vel v] to ((x vel) * (friction))\n\nwhen flag clicked\ngo to x: (-200) y: (-50)\nshow\nset [y vel v] to [0]\nset [x vel v] to [0]\nforever\n    if <touching color (#b2b2b2)?> then\n        broadcast (Fish v)\n        wait until <not <touching color (#b2b2b2)?>>\n    end\n    platform physics (12) (-1) (0.9) (1) (8) (8)\nend\n\n@Cuby4\n\nwhen I start as a clone\nforever\n    if <(ehfehkt) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nchange [color v] effect by (1)\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-2)\nend\ndelete this clone\n\nwhen flag clicked\nset [ready v] to [0]\nforever\n    wait until <touching color (#808080)?>\n    change [ready v] by (1)\n    wait until <not <touching color (#808080)?>>\n    change [ready v] by (-1)\nend\n\nwhen I receive [i just died v]\ngo to x: (-200) y: (150)\nset [y vel v] to [0]\nset [x vel v] to [0]\n\nwhen I receive [stay der v]\nwait (STAY de) seconds\ngo to x: (-200) y: (150)\nset [y vel v] to [0]\nset [x vel v] to [0]\n\ndefine platform physics (jump height) (gravity) (friction) (movement speed) (wall jump vm) (wall jump hm)\nset rotation style [left-right v]\nchange y by (y vel)\nif <touching color (#000000)?> then\n    repeat ([abs v] of (y vel) )\n        if <touching color (#000000)?> then\n            change y by ((-1) * (([abs v] of (y vel) ) / (y vel)))\n        end\n    end\n    if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> and <not <(y vel) > [0]>>> then\n        set [y vel v] to (jump height)\n    else\n        set [y vel v] to [0]\n    end\nelse\n    change [y vel v] by (gravity)\nend\nif <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n    change [x vel v] by (movement speed)\n    point in direction (90)\nend\nif <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n    change [x vel v] by ((-1) * (movement speed))\n    point in direction (-90)\nend\nchange x by (x vel)\nif <touching color (#000000)?> then\n    set [old y v] to (y position)\n    repeat (([abs v] of (x vel) ) + (1))\n        if <touching color (#000000)?> then\n            change y by (1)\n        end\n    end\n    if <touching color (#000000)?> then\n        set y to (old y)\n        repeat ([ceiling v] of ([abs v] of (x vel) ) )\n            if <touching color (#000000)?> then\n                change x by ((-1) * (([abs v] of (x vel) ) / (x vel)))\n            end\n        end\n        if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n            if <(x vel) < [0]> then\n                set [x vel v] to [0]\n                if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n                    point in direction (90)\n                    set [x vel v] to (wall jump hm)\n                    set [y vel v] to (wall jump vm)\n                end\n            else\n                set [x vel v] to [0]\n                if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n                    point in direction (-90)\n                    set [x vel v] to ((-1) * (wall jump hm))\n                    set [y vel v] to (wall jump vm)\n                end\n            end\n        end\n    end\nend\nset [x vel v] to ((x vel) * (friction))\n\nwhen flag clicked\ngo to x: (-200) y: (150)\nshow\nset [lvl v] to [1]\nset [y vel v] to [0]\nset [x vel v] to [0]\nforever\n    if <touching color (#b2b2b2)?> then\n        broadcast (Fish v)\n        wait until <not <touching color (#b2b2b2)?>>\n    end\n    platform physics (12) (-1) (0.9) (1) (8) (8)\nend\n\n@Ground\n\nwhen flag clicked\ngo to x: (0) y: (-5)\ngo to [back v] layer\nforever\n    switch costume to (lvl)\nend\n\nwhen flag clicked\nforever\n    if <<key (o v) pressed?> and <key (p v) pressed?>> then\n        broadcast (Fish v)\n        wait (0.5) seconds\n        change [lvl v] by (1)\n    end\n    wait until <not <<key (o v) pressed?> and <key (p v) pressed?>>>\nend\n\nwhen [r v] key pressed\nbroadcast (I just died v)\n\n@eFFECT\n\nwhen I receive [fish v]\nset [ghost v] effect to (100)\nrepeat (10)\n    broadcast (Stay DER v)\n    change [ghost v] effect by (-10)\nend\nbroadcast (Stay DER v)\nrepeat (5)\n    wait (0.1) seconds\n    broadcast (Stay DER v)\nend\nbroadcast (Stay DER v)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nset [ghost v] effect to (100)\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nset size to (10000) %\nset [ghost v] effect to (100)\ncreate clone of (_myself_ v)\nforever\n    go to [front v] layer\nend\n\nwhen I start as a clone\nswitch costume to (costume2 v)\ngo to x: (0) y: (0)\nset size to (50) %\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\n    turn right (36) degrees\nend\n\nset size to (100) %\n\n@Effect\n\nwhen flag clicked\nset [ghost v] effect to (50)\nhide\nforever\n    create clone of (_myself_ v)\n    wait (1) seconds\nend\n\nwhen I start as a clone\ngo to [back v] layer\nshow\nset size to (120) %\ngo to x: (240) y: (180)\npoint in direction (-45)\nglide (6) secs to x: (-240) y: (-180)\ndelete this clone\n\nwhen flag clicked\nset [ehfehkt v] to [1]\nforever\n    wait until <key (l v) pressed?>\n    wait until <not <key (l v) pressed?>>\n    set [ehfehkt v] to [0]\n    wait until <key (l v) pressed?>\n    wait until <not <key (l v) pressed?>>\n    set [ehfehkt v] to [1]\nend\n\nwhen I start as a clone\nclear graphic effects\nforever\n    if <(ehfehkt) = [0]> then\n        hide\n    else\n        show\n    end\nend\n\n@On/Off MUSIC\n\nwhen flag clicked\nswitch costume to (on v)\nset volume to (100) %\nforever\n    play sound [timelapseL v] until done\nend\n\nwhen this sprite clicked\nnext costume\nif <(costume [number v]) = [1]> then\n    set volume to (0) %\nend\nif <(costume [number v]) = [2]> then\n    set volume to (100) %\nend\n\nwhen flag clicked\nforever\n    if <<(distance to [cuby v]) < [50]> or <<(distance to [cuby2 v]) < [50]> or <<(distance to [cuby3 v]) < [50]> or <(distance to [cuby4 v]) < [50]>>>> then\n        repeat (2)\n            change [ghost v] effect by (50)\n        end\n        hide\n        wait until <not <<(distance to [cuby v]) < [50]> or <<(distance to [cuby2 v]) < [50]> or <<(distance to [cuby3 v]) < [50]> or <(distance to [cuby4 v]) < [50]>>>>>\n    else\n        repeat (2)\n            change [ghost v] effect by (-50)\n        end\n        show\n        wait until <<(distance to [cuby v]) < [50]> or <<(distance to [cuby2 v]) < [50]> or <<(distance to [cuby3 v]) < [50]> or <(distance to [cuby4 v]) < [50]>>>>\n    end\nend\n\n