Groovy-Girl - Scrolling Platformer - Fan Game v1.0


@Stage\n\nwhen I receive [start music v]\nplay sound [it's raining tacos v] until done\nif <not <(LEVEL) = [5]>> then\n    broadcast (start music v)\nend\n\nwhen I receive [green flag v]\nset volume to (30) %\nbroadcast (Start Game v)\n\nwhen I receive [play game v]\nswitch backdrop to (LEVEL)\n\nwhen I receive [new level v]\nwait (0) seconds\nswitch backdrop to (LEVEL)\n\n@Sprite2\n\nwhen flag clicked\nshow variable [points v]\nswitch costume to (costume1 v)\nshow\ngo to [front v] layer\ngo [backward v] (3) layers\ngo to x: (0) y: (0)\n\nwhen I receive [end game v]\ncreate clone of (_myself_ v)\nswitch costume to (costume1 v)\n\nwhen I start as a clone\nnext costume\nset [ghost v] effect to (100)\nrepeat (40)\n    change [ghost v] effect by (-2.5)\n    go to [front v] layer\nend\nhide variable [points v]\nif <(costume [number v]) = [2]> then\n    create clone of (_myself_ v)\nend\nforever\n    go to [front v] layer\nend\n\n@Tiles\n\nwhen I start as a clone\nshow\nclear graphic effects\nset [am i a clone? v] to [true]\n\ndefine Create Clones\nhide\ngo to x: (-228) y: (168)\nrepeat (12)\n    repeat (16)\n        set [my x v] to (x position)\n        set [my y v] to (y position)\n        create clone of (_myself_ v)\n        change x by (30)\n    end\n    set x to (-228)\n    change y by (-30)\nend\n\nwhen I receive [start game v]\nswitch costume to (3 v)\nrepeat (1)\n    delete this clone\nend\nReset Collectibles\nhide\nerase all\nset [am i a clone? v] to [false]\nset [level height v] to [200]\nset [level width v] to [440]\nCreate Clones\nbroadcast (Level is Generated v)\n\ndefine Reset Collectibles\ndelete all of [collectibles? v]\nrepeat (Level Width)\n    repeat (Level Height)\n        add [1] to [collectibles? v]\n    end\nend\n\nwhen I receive [new level v]\nif <(Am I a clone?) = [false]> then\n    Reset Collectibles\nend\n\nwhen I receive [hide passables v]\nif <<[passable tiles? v] contains (Item My Position of Level)?> or <<(Item My Position of Level) = [11]> and <<([y position v] of [player v]) < ((y position) + (14))> or <key (down arrow v) pressed?>>>> then\n    hide\nend\n\nwhen I receive [tick v]\nif <(Am I a clone?) = [true]> then\n    go to x: ((My X) - (SCROLL X)) y: (((My Y) - (SCROLL Y)) + (extra y))\n    set [my position v] to (((((My X) * (Level Height)) + (My Y)) + (1)) / (30))\n    set [my position v] to (round (My Position))\n    if <(LEVEL) = [1]> then\n        set [item my position of level v] to (item (My Position) of [level 1 v])\n    else\n        if <(LEVEL) = [2]> then\n            set [item my position of level v] to (item (My Position) of [level 2 v])\n        else\n            if <(LEVEL) = [3]> then\n                set [item my position of level v] to (item (My Position) of [level 3 v])\n            else\n                if <(LEVEL) = [4]> then\n                    set [item my position of level v] to (item (My Position) of [level 4 v])\n                else\n                    if <(LEVEL) = [5]> then\n                        set [item my position of level v] to (item (My Position) of [level 4 v])\n                    end\n                end\n            end\n        end\n    end\n    if <((My X) - (SCROLL X)) > [240]> then\n        change [my x v] by (-480)\n    end\n    if <((My X) - (SCROLL X)) < [-240]> then\n        change [my x v] by (480)\n    end\n    if <((My Y) - (SCROLL Y)) > [180]> then\n        change [my y v] by (-360)\n    end\n    if <((My Y) - (SCROLL Y)) < [-180]> then\n        change [my y v] by (360)\n    end\n    switch costume to (Item My Position of Level)\n    if <(LEVEL) = [1]> then\n        if <not <[passable tiles? v] contains (item ((My Position) + (1)) of [level 1 v])?>> then\n            if <(Item My Position of Level) = [1]> then\n                switch costume to (2 v)\n            end\n        end\n    else\n        if <(LEVEL) = [2]> then\n            if <not <[passable tiles? v] contains (item ((My Position) + (1)) of [level 2 v])?>> then\n                if <(Item My Position of Level) = [1]> then\n                    switch costume to (2 v)\n                end\n            end\n        else\n            if <(LEVEL) = [3]> then\n                if <not <[passable tiles? v] contains (item ((My Position) + (1)) of [level 3 v])?>> then\n                    if <(Item My Position of Level) = [1]> then\n                        switch costume to (2 v)\n                    end\n                end\n            else\n                if <not <[passable tiles? v] contains (item ((My Position) + (1)) of [level 4 v])?>> then\n                    if <(Item My Position of Level) = [1]> then\n                        switch costume to (2 v)\n                    end\n                end\n            end\n        end\n    end\n    point in direction (90)\n    set size to (107) %\n    if <(item (My Position) of [collectibles? v]) = [0]> then\n        hide\n    else\n        show\n    end\n    if <(Item My Position of Level) = [10]> then\n        if <<(distance to [player v]) < [25]> or <touching (player v)?>> then\n            if <(item (My Position) of [collectibles? v]) = [1]> then\n                start sound [Collect v]\n                change [points v] by (1)\n            end\n            replace item (My Position) of [collectibles? v] with [0]\n        end\n        point in direction ((([sin v] of ((bounce) + (-50)) ) * (5)) + (90))\n        set size to ((([sin v] of (bounce) ) * (-5)) + (101)) %\n        change [bounce v] by (8)\n    end\n    clear graphic effects\n    if <(LEVEL) = [3]> then\n        change [brightness v] effect by (-30)\n    end\n    if <<<touching (hitbox v)?> and <([y position v] of [player v]) < ((y position) - (5))>> and <(Item My Position of Level) = [21]>> then\n        set [particle x v] to (x position)\n        set [particle y v] to (y position)\n        start sound [Glass Breaking v]\n        broadcast (particles v)\n        replace item (My Position) of [collectibles? v] with [0]\n    end\n    if <<(Item My Position of Level) = [4]> and <touching (hitbox v)?>> then\n        broadcast (hurt v)\n    end\nend\n\nif <<(distance to [mouse-pointer v]) < [14]> and <mouse down?>> then\n    place block\nend\n\ndefine bounce block\nif <(bouncing?) = [0]> then\n    if <<touching (hitbox v)?> and <([y position v] of [player v]) < ((y position) - (5))>> then\n        set [bouncing? v] to [1]\n    end\nend\nif <(bouncing?) = [1]> then\n    change [extra y v] by (1)\nend\nif <(extra y) > [5]> then\n    set [bouncing? v] to [-1]\nend\nif <(bouncing?) = [-1]> then\n    change [extra y v] by (-1)\nend\nif <(extra y) < [0]> then\n    set [bouncing? v] to [0]\n    set [extra y v] to [0]\nend\n\ndefine place block\nif <(LEVEL) = [1]> then\n    replace item (My Position) of [level 1 v] with (Tile?)\nelse\n    if <(LEVEL) = [2]> then\n        replace item (My Position) of [level 2 v] with (Tile?)\n    else\n        if <(LEVEL) = [3]> then\n            replace item (My Position) of [level 3 v] with (Tile?)\n        else\n            if <(LEVEL) = [4]> then\n                replace item (My Position) of [level 4 v] with (Tile?)\n            end\n        end\n    end\nend\n\nsay []\nif <(distance to [mouse-pointer v]) < [14]> then\n    say (My Y)\nend\n\nReset Collectibles\n\n@Player\n\nwhen flag clicked\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [play game v]\nset [points v] to [0]\nset rotation style [left-right v]\nset [begun v] to [false]\nshow\nset [sy v] to [0]\nset [level v] to [1]\nset [walk animation v] to [2]\nGame On\nbroadcast (start music v)\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    Game On\n    repeat until <(LEVEL) = [5]>\n        broadcast (hide passables v) and wait\n        Sense Hurt\n        go to [front v] layer\n        switch costume to (hitbox v)\n        set [xv v] to [0]\n        Tick\n        reset Scrolling\n        if <(SCROLL X) < [9012]> then\n            set [scroll x v] to [9012]\n        end\n        if <(SCROLL Y) < [-315]> then\n            set [scroll y v] to [-315]\n        end\n        if <<(SCROLL X) > [10550]> and <(LEVEL) = [1]>> then\n            set [scroll x v] to [10550]\n            if <(x) > ((SCROLL X) + (226))> then\n                change [level v] by (1)\n                Game On\n                broadcast (new level v)\n            end\n        end\n        if <<(SCROLL X) > [11557]> and <(LEVEL) = [2]>> then\n            set [scroll x v] to [11557]\n            if <(x) > ((SCROLL X) + (226))> then\n                change [level v] by (1)\n                Game On\n                broadcast (new level v)\n            end\n        end\n        if <<(SCROLL X) > [12041]> and <(LEVEL) = [3]>> then\n            set [scroll x v] to [12041]\n            if <(x) > ((SCROLL X) + (226))> then\n                change [level v] by (1)\n                Game On\n                broadcast (new level v)\n            end\n        end\n        if <<(SCROLL X) > [12887]> and <(LEVEL) = [4]>> then\n            set [scroll x v] to [12887]\n            if <(x) > ((SCROLL X) + (226))> then\n                change [level v] by (1)\n                broadcast (end game v)\n            end\n        end\n        Position\n        if <(y position) < [-205]> then\n            set [lives v] to [0]\n            broadcast (Tick v) and wait\n            wait (1) seconds\n            broadcast (new level v)\n        end\n        erase all\n        clear graphic effects\n        change [walk animation v] by (0.5)\n        if <(walk animation) > [9]> then\n            set [walk animation v] to [2]\n        end\n        change [flash? v] by (0.2)\n        if <(flash?) > [2]> then\n            set [flash? v] to [0]\n        end\n        set correct costume\n        broadcast (Tick v) and wait\n    end\nend\n\ndefine Game On\nset [hurt? v] to [false]\nset [x v] to [8886]\nset [y v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nshow\nset size to (100) %\n\ndefine Tick\nif <not <(hurt?) = [true]>> then\n    if <key (left arrow v) pressed?> then\n        point in direction (-90)\n        Change Player X by [-7]\n    end\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n        Change Player X by [7]\n    end\n    if <key (up arrow v) pressed?> then\n        if <(in air) < [4]> then\n            set [sy v] to [16]\n        end\n    end\nend\nchange [sy v] by (-2)\nChange Player Y by (sy)\n\ndefine Change Player Y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nif <(sy) < [-20]> then\n    set [sy v] to [-20]\nend\nrepeat until <not <touching (tiles v)?>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: (((y) - (30)) - (SCROLL Y))\n\ndefine Change Player X by (sx)\nset [xv v] to (sx)\nchange [x v] by (sx)\nPosition\nif <touching (tiles v)?> then\n    repeat (11)\n        change [y v] by (1)\n        Position\n        if <not <touching (tiles v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-11)\n    repeat until <not <touching (tiles v)?>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\nwhen I receive [play game v]\nwait (2) seconds\nbroadcast (finally start v)\nset [begun v] to [true]\n\nwhen I receive [bounce v]\nset [sy v] to [13]\n\ndefine set correct costume\nif <(LEVEL) = [3]> then\n    set [brightness v] effect to (-30)\nend\nswitch costume to (stand_1 v)\nif <([abs v] of (XV) ) > [0]> then\n    switch costume to (round (walk animation))\nend\nif <(sy) > [0]> then\n    switch costume to (jump_1 v)\nend\nif <(sy) < [0]> then\n    switch costume to (jump_2 v)\nend\nif <(hurt?) = [true]> then\n    if <(in air) = [0]> then\n        switch costume to (hurt_2 v)\n    else\n        switch costume to (hurt_1 v)\n    end\nend\nif <(hurt?) = [getup]> then\n    switch costume to (round ((time hurt) + (13)))\nend\nif <(hurt?) = [later]> then\n    if <(flash?) > [1]> then\n        set [ghost v] effect to (0)\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\ndefine reset Scrolling\nset [scroll x v] to (x)\nset [scroll y v] to (y)\nset [scroll y v] to ((y) + (((-1) * (sy)) / (3)))\n\nwhen I receive [hurt v]\nif <(hurt?) = [false]> then\n    start sound [hurt v]\n    change [lives v] by (-1)\n    if <(LIVES) < [1]> then\n        broadcast (new level v)\n    end\n    set [hurt? v] to [true]\n    set [sy v] to [15]\nend\n\nwhen I receive [new level v]\nGame On\nset [y v] to [-328]\nset [sy v] to [0]\n\ndefine Sense Hurt\nif <<(hurt?) = [true]> and <(in air) = [0]>> then\n    change [time hurt v] by (1)\nend\nif <(hurt?) = [false]> then\n    set [time hurt v] to [0]\nend\nif <(time hurt) > [50]> then\n    set [time hurt v] to [0]\n    set [hurt? v] to [getup]\nend\nif <(hurt?) = [getup]> then\n    change [time hurt v] by (0.6)\n    if <(time hurt) > [2]> then\n        set [hurt? v] to [later]\n    end\nend\nif <(hurt?) = [later]> then\n    change [time hurt v] by (-1)\nend\nif <(time hurt) < [-50]> then\n    set [time hurt v] to [0]\n    set [hurt? v] to [false]\nend\n\n@enemies\n\nwhen I receive [tick v]\ndo blob stuff\n\nwhen I start as a clone\nset [dead? v] to [false]\nset [direction? v] to [right]\nset [clone? v] to [true]\nset rotation style [left-right v]\nshow\n\ndefine Redblob at X (x) Y (y) Range? (rng) extra X (xx)\nset [my x v] to (x)\nset [my y v] to (y)\nset [range? v] to (rng)\nset [extra x v] to (xx)\ncreate clone of (_myself_ v)\n\nwhen I receive [play game v]\nhide\nset [clone? v] to [false]\nif <(LEVEL) = [1]> then\n    Redblob at X [9303] Y [-26] Range? [255] extra X [0]\n    Redblob at X [9850] Y [-56] Range? [490] extra X [100]\n    Redblob at X [9850] Y [-56] Range? [490] extra X [490]\nend\n\nwhen I receive [new level v]\nrepeat (1)\n    delete this clone\nend\nif <(LEVEL) = [1]> then\n    Redblob at X [9303] Y [-26] Range? [255] extra X [0]\n    Redblob at X [9850] Y [-56] Range? [490] extra X [100]\n    Redblob at X [9850] Y [-56] Range? [490] extra X [490]\nend\nif <(LEVEL) = [2]> then\n    Redblob at X [8832] Y [-387] Range? [450] extra X [300]\n    Redblob at X [8832] Y [-387] Range? [450] extra X [200]\n    Redblob at X [10212] Y [184] Range? [180] extra X [0]\n    Redblob at X [10570] Y [512] Range? [210] extra X [0]\nend\nif <(LEVEL) = [3]> then\n    Redblob at X [10422] Y [-267] Range? [390] extra X [0]\n    Redblob at X [10422] Y [-267] Range? [390] extra X [100]\n    Redblob at X [10422] Y [-267] Range? [390] extra X [230]\nend\nif <(LEVEL) = [4]> then\n    Redblob at X [11262] Y [-88] Range? [180] extra X [0]\nend\n\ndefine do blob stuff\nif <(Clone?) = [true]> then\n    change [blob costume v] by (0.3)\n    if <(blob costume) > [3]> then\n        set [blob costume v] to [1]\n    end\n    switch costume to (round (blob costume))\n    go to x: (((My X) - (SCROLL X)) + (extra x)) y: ((My Y) - (SCROLL Y))\n    if <(dead?) = [false]> then\n        set [time dead? v] to [0]\n        if <(direction?) = [right]> then\n            point in direction (90)\n            change [extra x v] by (2)\n        end\n        if <(extra x) > (range?)> then\n            set [direction? v] to [left]\n        end\n        if <(direction?) = [left]> then\n            point in direction (-90)\n            change [extra x v] by (-2)\n        end\n        if <(extra x) < [0]> then\n            set [direction? v] to [right]\n        end\n        if <<(distance to [player v]) < [30]> and <not <(hurt?) = [true]>>> then\n            if <<([y position v] of [player v]) > ((y position) + (2))> and <([sy v] of [player v]) < [0]>> then\n                start sound [Splash v]\n                broadcast (bounce v)\n                set [dead? v] to [true]\n            else\n                if <touching (hitbox v)?> then\n                    broadcast (hurt v)\n                end\n            end\n        end\n    else\n        switch costume to (blob squish v)\n        change [time dead? v] by (0.05)\n    end\n    if <(time dead?) > [0.6]> then\n        change [points v] by (1)\n        delete this clone\n    end\n    clear graphic effects\n    if <(LEVEL) = [3]> then\n        set [brightness v] effect to (-30)\n    end\n    show\n    if <touching (_edge_ v)?> then\n        hide\n    end\nend\n\n@hitbox\n\nwhen I receive [tick v]\nset rotation style [left-right v]\ngo to (player v)\nset [ghost v] effect to (100)\ngo to [front v] layer\npoint in direction ([direction v] of [player v])\n\n@particles\n\nwhen I receive [particles v]\nif <(XV) = [0]> then\n    make particles\nend\n\nwhen I start as a clone\nset [yv v] to [0]\nset [xv v] to (pick random (-20) to (20))\nif <(XV) = [0]> then\n    set [xv v] to (pick random (-20) to (20))\n    if <(XV) = [0]> then\n        set [xv v] to (pick random (-20) to (20))\n        if <(XV) = [0]> then\n            delete this clone\n        end\n    end\nend\n\nwhen I receive [tick v]\nhide\nclear graphic effects\nif <([abs v] of (XV) ) > [0]> then\n    if <(LEVEL) = [3]> then\n        set [brightness v] effect to (-30)\n    end\n    show\n    turn right ((XV) * (2)) degrees\n    change [yv v] by (-1)\n    change y by (YV)\n    set [xv v] to ((XV) * (0.9))\n    change x by (XV)\n    if <<touching (_edge_ v)?> or <(y position) < [-170]>> then\n        delete this clone\n    end\nend\n\nwhen flag clicked\nset [xv v] to [0]\nset [yv v] to [0]\nhide\n\ndefine make particles\ngo to x: (Particle X) y: (Particle Y)\nswitch costume to (costume1 v)\nrepeat (4)\n    create clone of (_myself_ v)\n    next costume\nend\n\n@lives\n\nwhen I receive [tick v]\ndisplay lives\n\ndefine display lives\nrepeat (1)\n    delete this clone\nend\nset size to (60) %\ngo to [front v] layer\ngo to x: (190) y: (135)\nhide\nrepeat (LIVES)\n    switch costume to (costume1 v)\n    create clone of (_myself_ v)\n    change x by (-35)\nend\nrepeat ((3) - (LIVES))\n    switch costume to (costume3 v)\n    create clone of (_myself_ v)\n    change x by (-35)\nend\n\nwhen flag clicked\nset [lives v] to [3]\n\nwhen I receive [new level v]\nset [lives v] to [3]\n\nwhen I start as a clone\nshow\n\n@Thumbnail\n\nwhen flag clicked\nhide\n\n