Crumbling Platformer        #games #art #crumble #poliakoff

Instructions: Intro tournament: \nhttps://scratch.mit.edu/projects/488642706/\n\n100% by me\nLevels are randomly generated\nA filler project really, it didn't take very long\n\nRemember to love and fav\n\n\nThis is a filler because I have been making a mutliplayer race for school (basically like kahoot)

@Stage\n\n@ground\n\nwhen I receive [make level v]\nbroadcast (killclone v) and wait\nset [allow gaps v] to [0]\nbuild level without screen refresh\nbroadcast (Play v)\n\nwhen flag clicked\nset [allow gaps v] to [0]\nset [instant v] to [1]\nhide\n\ndefine build level without screen refresh\nhide\nset size to (50) %\nswitch costume to (grass v)\nset [x v] to [-225]\nset [y v] to [0]\nrepeat (18)\n    go to [front v] layer\n    switch costume to (grass v)\n    set [y v] to (((30) * (pick random (-3) to (3))) - (20))\n    create clone of (_myself_ v)\n    repeat (pick random (-5) to (1))\n    repeat (2)\n        switch costume to (dirt v)\n        change [y v] by (-30)\n        create clone of (_myself_ v)\n    end\n    switch costume to (stone v)\n    repeat (10)\n        change [y v] by (-30)\n        create clone of (_myself_ v)\n    end\n    if <(allow gaps) = [1]> then\n        change [x v] by ((30) * (pick random (1) to (3)))\n    else\n        change [x v] by (30)\n    end\nend\n\nwhen flag clicked\nbroadcast (killclone v) and wait\ngo to x: (0) y: (0)\nbroadcast (make level v)\n\nrepeat (10)\n    switch costume to (dirt v)\n    change y by (-32)\n    stamp\nend\n\nwhen I start as a clone\nclone loop\n\nshow\n\nwhen I receive [killclone v]\ndelete this clone\n\nwhen I receive [bounce v]\nif <(costume [number v]) = [4]> then\n    switch costume to (springcollisiondetect v)\n    if <touching (sprite1 v)?> then\n        bounce thing\n    end\n    switch costume to (spring v)\nend\n\ndefine bounce thing\nstart sound [Big Boing v]\nswitch costume to (spring v)\nswitch costume to (springsquash1 v)\nrepeat (2)\n    next costume\nend\nrepeat (2)\n    switch costume to ((costume [number v]) - (1))\nend\ngo to x: (x) y: (y)\nswitch costume to (spring v)\n\ndefine build with screen refresh\nhide\nset size to (50) %\nswitch costume to (grass v)\nset [x v] to [-225]\nset [y v] to [0]\nrepeat (18)\n    go to [front v] layer\n    switch costume to (grass v)\n    set [y v] to (((30) * (pick random (-3) to (3))) - (20))\n    create clone of (_myself_ v)\n    repeat (pick random (1) to (4))\n        switch costume to (dirt v)\n        change [y v] by (-30)\n        create clone of (_myself_ v)\n    end\n    switch costume to (stone v)\n    repeat (10)\n        change [y v] by (-30)\n        create clone of (_myself_ v)\n    end\n    if <(allow gaps) = [1]> then\n        change [x v] by ((30) * (pick random (1) to (3)))\n    else\n        change [x v] by (30)\n    end\nend\n\ndefine clone loop\ngo to x: (x) y: (y)\nset [allow gaps v] to [0]\nset [y-vel v] to [0]\nshow\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    delete this clone\nend\nif <(costume [number v]) = [4]> then\n    go to [back v] layer\nend\nwait (0) seconds\nclear graphic effects\nforever\n    set size to (55) %\n    if <touching (sprite1 v)?> then\n        set size to (50) %\n        wait (0.05) seconds\n        add (x position) to [crumble v]\n        add (y position) to [crumble v]\n        add (costume [name v]) to [crumble v]\n        repeat (5)\n            change [ghost v] effect by (20)\n        end\n        hide\n        delete this clone\n    end\n    set size to (50) %\nend\n\nswitch costume to (spring v)\nchange [y v] by (30)\ncreate clone of (_myself_ v)\nchange [y v] by (-30)\n\n@Sprite1\n\nwhen flag clicked\nhide\ngo to x: (-200) y: (0)\n\nwhen I receive [play v]\ngo to x: (-225) y: (160)\nshow\nset [sx v] to [0]\nchange y by (sy) <(sy) > [0]>\nchange y by (25)\nset [sy v] to [0]\nforever\n    switch costume to (hit v)\n    change [sy v] by (-1)\n    set [sx v] to ((sx) * (0.85))\n    change y by (sy) <(sy) > [0]>\n    change x by (sx) <(sx) > [0]>\n    set rotation style [don't rotate v]\n    if <(y position) < [-180]> then\n        die\n        go to x: (-225) y: (160)\n        set [sx v] to [0]\n        set [sy v] to [0]\n        broadcast (make level v) and wait\n    end\n    if <(x position) > [240]> then\n        hide\n        switch costume to (big v)\n        broadcast (make level v)\n        stop [this script v]\n    end\n    change y by (-5)\n    if <touching color (#ee9f00)?> then\n        broadcast (bounce v)\n        set [sy v] to [15]\n    end\n    change y by (5)\n    switch costume to (big v)\nend\n\ndefine change x by (sx) <forward>\nchange x by (sx)\nif <touching (ground v)?> then\n    repeat (3)\n        change y by (1)\n        if <not <touching (ground v)?>> then\n            stop [this script v]\n        end\n    end\n    change y by (-3)\n    if <key (up arrow v) pressed?> then\n        set [sy v] to [8]\n        start sound [walljump v]\n        if <forward> then\n            set [sx v] to [-5]\n        else\n            set [sx v] to [5]\n        end\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <touching (ground v)?>>\n        if <(sx) > [0]> then\n            change x by (-1)\n        else\n            change x by (1)\n        end\n    end\nend\n\ndefine change y by (sy) <up >\nchange y by (sy)\nrepeat until <not <touching (ground v)?>>\n    set [sy v] to [0]\n    if <up > then\n        change y by (-1)\n    else\n        change y by (1)\n        if <key (up arrow v) pressed?> then\n            set [sy v] to [12]\n            start sound [Jump v]\n        end\n    end\nend\n\nwhen I receive [play v]\nforever\n    if <key (left arrow v) pressed?> then\n        change [sx v] by (-1)\n    end\n    if <key (right arrow v) pressed?> then\n        change [sx v] by (1)\n    end\nend\n\ndefine die\nswitch costume to (big v)\ndelete all of [crumble v]\ngo to x: (-225) y: (160)\nset [sx v] to [0]\nset [sy v] to [0]\n\nhide\n\nwhen backdrop switches to [3 v]\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen flag clicked\nshow\n\nbroadcast (bounce v)\n\n@thumbnail\n\nwhen flag clicked\nhide variable [allow gaps v]\nhide variable [instant v]\nforever\n    hide\n    reset timer\nend\n\nwhen [timer v] > (0)\nshow\ngo to [front v] layer\n\n@crumble\n\nwhen flag clicked\nforever\n    create clones\nend\n\ndefine create clones\nhide\nrepeat until <(length of [crumble v]) = [0]>\n    repeat (5)\n        go to x: (item (1) of [crumble v]) y: (item (2) of [crumble v])\n        switch costume to (item (3) of [crumble v])\n        change x by (pick random (-12) to (12))\n        change y by (pick random (0) to (15))\n        create clone of (_myself_ v)\n    end\n    delete (1) of [crumble v]\n    delete (1) of [crumble v]\n    delete (1) of [crumble v]\nend\n\nwhen I start as a clone\nset size to (20) %\nclear graphic effects\nshow\ngo to [back v] layer\nset [y-vel v] to [0]\nrepeat (25)\n    change [y-vel v] by (-0.5)\n    change y by (y-vel)\n    change [ghost v] effect by (4)\nend\ndelete this clone\n\n