Legend Rush [Platformer] V3.0
@Stage\n\nwhen flag clicked\nset [song v] to [0]\nset [time v] to [0]\nbroadcast (Setup v) and wait\nset [gamestatus v] to [intro]\nswitch backdrop to (backdrop1 v)\nbroadcast (Intro v) and wait\nswitch backdrop to (stage v)\nset [gamestatus v] to [menu]\nbroadcast (Music v)\nbroadcast (Play v)\nbroadcast (Start v)\nwait until <key (any v) pressed?>\nset [screen v] to [Menu]\nbroadcast (Menu v) and wait\n\nwhen I receive [begin game v]\nreset timer\nset [time v] to [0]\nswitch backdrop to (backdrop1 v)\nset [gamestatus v] to [playing]\nbroadcast (Music v)\nbroadcast (HPSetup v) and wait\nbroadcast (Render v) and wait\nbroadcast (Render Text v) and wait\nbroadcast (Render Entities v) and wait\nbroadcast (LevelBegin v)\n\nwhen I receive [play v]\nforever\n    play sound (Song) until done\nend\n\nwhen I receive [music v]\nstop all sounds\nchange [song v] by (1)\n\nwhen I receive [levelbegin v]\nset volume to (Volume) %\n\nwhen I receive [render v]\nset volume to ((Volume) / (2)) %\n\nwhen I receive [update volume v]\nset volume to (Volume) %\n\n@Hitbox\n\ndefine Water physics when <>\nif <sprite?> then\n    set [underwater? v] to [1]\n    set [jump height v] to [5]\n    set [speed v] to [0.5]\n    set [gravity v] to [-0.05]\nelse\n    set [underwater? v] to [0]\n    set [jump height v] to [9.5]\n    set [speed v] to [1.5]\n    set [gravity v] to [0.8]\nend\n\ndefine Reset\nshow\nif <(Level) = [10]> then\n    go to x: (-220) y: (-48)\nelse\n    go to x: (-220) y: (0)\nend\nset [xv v] to [0]\nset [yv v] to [0]\nset [jump height v] to [9.5]\nset [speed v] to [1.5]\nset [gravity v] to [0.8]\nset [falling? v] to [6]\nset [frame v] to [0]\nset [attacking? v] to [0]\nset [jump key v] to [0]\nset [attack key v] to [0]\n\nwhen I receive [render v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [setup v]\nhide\n\ndefine Touch Ground <>\nchange [falling? v] by (1)\nrepeat until <not <touching (map v)?>>\n    if <<up?> and <(Underwater?) = [0]>> then\n        change y by (-1)\n    else\n        change y by (1)\n        set [falling? v] to [0]\n    end\n    set [yv v] to [0]\nend\n\ndefine Physics\nset [ghost v] effect to (100)\ngo [backward v] (1) layers\nset size to (60) %\nswitch costume to (hitbox v)\nchange y by (Yv)\nchange [yv v] by ((0) - (Gravity))\nTouch Ground <(Yv) > [0]>\nset rotation style [left-right v]\nset [xv v] to ((Xv) * (0.7))\nif <(Attacking?) > [0]> then\n    change [attacking? v] by (-1)\nelse\n    if <(Ranged) > [0]> then\n        change [ranged v] by (-1)\n    else\n        if <(Shield) > [0]> then\n            change [shield v] by (-1)\n        else\n            if <key (left arrow v) pressed?> then\n                change [xv v] by ((0) - (Speed))\n            end\n            if <key (right arrow v) pressed?> then\n                change [xv v] by (Speed)\n            end\n        end\n    end\nend\nif <(Xv) > [0.5]> then\n    Walk (90) (Xv)\nelse\n    if <(Xv) < [-0.5]> then\n        Walk (-90) (Xv)\n    else\n        set [frame v] to [0]\n    end\nend\nif <key (up arrow v) pressed?> then\n    if <<(Jump Key) = [0]> and <(Falling?) < [3]>> then\n        set [yv v] to (Jump Height)\n        set [falling? v] to [6]\n        set [jump key v] to [1]\n        start sound [Jump v]\n    else\n        set [jump key v] to [0]\n    end\nend\nif <key (space v) pressed?> then\n    if <<(Falling?) < [3]> and <<<(Attack Key) = [0]> and <(Attacking?) = [0]>> and <<(Ranged) = [0]> and <(Shield) = [0]>>>> then\n        set [attacking? v] to [5]\n        set [attack key v] to [1]\n    end\nelse\n    set [attack key v] to [0]\nend\nif <mouse down?> then\n    if <<(Falling?) < [3]> and <<<(RangedKey) = [0]> and <(Ranged) = [0]>> and <<(Attacking?) = [0]> and <(Shield) = [0]>>>> then\n        set [ranged v] to [10]\n        set [rangedkey v] to [1]\n    end\nelse\n    set [rangedkey v] to [0]\nend\nif <key (down arrow v) pressed?> then\n    if <<(Falling?) < [3]> and <<<(Shield Key) = [0]> and <(Shield) = [0]>> and <<(Attacking?) = [0]> and <(Ranged) = [0]>>>> then\n        set [shield v] to [20]\n        set [shield key v] to [1]\n    end\nelse\n    set [shield key v] to [0]\nend\nif <(y position) < [-180]> then\n    Reset\nend\nif <touching (obstacles v)?> then\n    Set HP to (0)\nend\nif <touching (win v)?> then\n    broadcast (Next v)\nend\nif <not <(HP) > [0]>> then\n    start sound [Hit_Hurt v]\n    broadcast (Dead v)\nend\nWater physics when <touching (liquids v)?>\nSet Costume\n\ndefine None\npoint in direction (dir)\nchange x by (speed)\nset [slope v] to [0]\nrepeat until <<not <touching (map v)?>> or <(Slope) = [8]>>\n    change y by (1)\n    change [slope v] by (1)\nend\nif <(Slope) = [8]> then\n    change x by ((0) - (speed))\n    change y by ((0) - (Slope))\n    set [xv v] to [0]\nend\nchange [frame v] by (0.5)\n\nwhen I receive [next v]\nhide\n\ndefine None\nset [hp v] to (value)\nbroadcast (UpdateHP v)\n\nwhen I receive [dead v]\nwait until <(Animating?) = [1]>\nhide\nstop [other scripts in sprite v]\nbroadcast (LevelBegin v)\n\ndefine Set Costume\nif <(Falling?) < [3]> then\n    if <(Attacking?) > [0]> then\n        set [costume v] to (((Character) * (8)) + (7))\n    else\n        if <(Ranged) > [0]> then\n        else\n            if <(Shield) > [0]> then\n            else\n                if <([abs v] of (Xv) ) > [0.5]> then\n                    set [costume v] to ([floor v] of ((((Character) * (8)) + (1)) + ((Frame) mod (4))) )\n                else\n                    set [costume v] to (((Character) * (8)) + (1))\n                end\n            end\n        end\n    end\nelse\n    if <(Yv) > [0]> then\n        set [costume v] to (((Character) * (8)) + (5))\n    else\n        set [costume v] to (((Character) * (8)) + (6))\n    end\nend\n\nwhen I receive [levelbegin v]\nwait until <(Animating?) = [0]>\nReset\nbroadcast (Character v)\nSet HP to (100)\nforever\n    Physics\n    change [frametick v] by (1)\nend\n\ndefine Calculate FPS\nif <not <(timer) < [1]>> then\n    set [fps v] to (FrameTick)\n    set [frametick v] to [0]\n    reset timer\nend\n\nCalculate FPS\n\n@Map\n\nwhen I receive [setup v]\ngo to x: (0) y: (14)\nswitch costume to (level 1 v)\nset size to (1600) %\nhide\n\nwhen I receive [next v]\nchange [level v] by (1)\nnext costume\nbroadcast (ResetImpData v) and wait\nbroadcast (Render v) and wait\nbroadcast (Render Text v) and wait\nbroadcast (Render Entities v) and wait\nbroadcast (LevelBegin v)\n\nwhen I receive [reset maps v]\ngo to x: (0) y: (14)\nswitch costume to (level 1 v)\nset size to (1600) %\nhide\n\nwhen I receive [progress v]\nchange [level v] by (1)\nnext costume\n\nwhen I receive [hide v]\nset [ghost v] effect to (100)\n\nwhen I receive [show v]\nclear graphic effects\nshow\n\nwhen I receive [begin game v]\nset [ghost v] effect to (100)\nshow\n\n@Obstacles\n\nwhen I receive [setup v]\ngo to x: (0) y: (-2)\nswitch costume to (level 1 v)\nset size to (1600) %\nhide\n\nwhen I receive [next v]\nnext costume\n\nwhen I receive [reset maps v]\ngo to x: (0) y: (-2)\nswitch costume to (level 1 v)\nset size to (1600) %\nhide\n\nwhen I receive [progress v]\nnext costume\n\nwhen I receive [show v]\nclear graphic effects\nshow\n\nwhen I receive [hide v]\nset [ghost v] effect to (100)\n\nwhen I receive [begin game v]\nset [ghost v] effect to (100)\nshow\n\n@Cosmetics\n\nwhen I receive [next v]\nnext costume\n\nwhen I receive [setup v]\ngo to x: (0) y: (-2)\nswitch costume to (level 1 v)\nset size to (1600) %\nhide\n\nwhen I receive [reset maps v]\ngo to x: (0) y: (-2)\nswitch costume to (level 1 v)\nset size to (1600) %\nhide\n\nwhen I receive [progress v]\nnext costume\n\nwhen I receive [show v]\nclear graphic effects\nshow\n\nwhen I receive [hide v]\nset [ghost v] effect to (100)\n\nwhen I receive [begin game v]\nset [ghost v] effect to (100)\nshow\n\n@Liquids\n\nwhen I receive [next v]\nnext costume\n\nwhen I receive [setup v]\ngo to x: (0) y: (-2)\nswitch costume to (level 1 v)\nset size to (1600) %\nhide\n\nwhen I receive [reset maps v]\ngo to x: (0) y: (-2)\nswitch costume to (level 1 v)\nset size to (1600) %\nhide\n\nwhen I receive [progress v]\nnext costume\n\nwhen I receive [show v]\nclear graphic effects\nshow\n\nwhen I receive [hide v]\nset [ghost v] effect to (100)\n\nwhen I receive [begin game v]\nset [ghost v] effect to (100)\nshow\n\n@Character\n\nwhen I receive [render v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [dead v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [setup v]\nset [yv v] to [0]\nset [xv v] to [0]\nhide\n\nwhen I receive [character v]\nset [yv v] to [0]\nset [xv v] to [0]\nshow\nset rotation style [left-right v]\nforever\n    go to (hitbox v)\n    point in direction ([direction v] of [hitbox v])\n    switch costume to (Costume)\n    Set Size\nend\n\ndefine Set Size\nif <<<<<(Costume) > [17]> and <(Costume) < [24]>> and <not <(Costume) = [19]>>> or <<<(Costume) > [25]> and <(Costume) < [33]>> and <not <(Costume) = [27]>>>> or <((Costume) mod (8)) = [0]>> then\n    set size to (30) %\nelse\n    set size to (60) %\nend\n\n@Imp \n\nwhen I receive [render entities v]\nDelete Clones\nset [n v] to [0]\nrepeat (length of [impx v])\n    change [n v] by (1)\n    Create imp at X: (item (n) of [impx v]) Y: (item (n) of [impy v])\nend\nbroadcast (Render Health Bars v)\n\ndefine None\nchange [#cloneid v] by (1)\nset [x v] to (x)\nset [y v] to (y)\nadd [10] to [impstatus v]\nadd [000000] to [impid v]\nadd [0] to [projectile data v]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nSetup\nrepeat until <not <(Level) = (MyLevel)>>\n    ShootProjectileIf <(Timer) > [35]>\n    UpdateImpStatus\nend\ndelete this clone\n\ndefine Setup\nshow\ngo to [front v] layer\nset [mylevel v] to (Level)\nset rotation style [left-right v]\ngo to x: (X) y: (Y)\npoint in direction (([direction v] of [hitbox v]) - (180))\n\ndefine Delete Clones\nset [#cloneid v] to [0]\ndelete this clone\n\ndefine UpdateImpStatus\nif <(x position) > ([x position v] of [hitbox v])> then\n    point in direction (-90)\nelse\n    point in direction (90)\nend\nif <<(Attacking?) > [0]> and <touching (character v)?>> then\n    if <((direction) - (180)) = ([direction v] of [character v])> then\n        replace item (#CloneID) of [impstatus v] with ((item (#CloneID) of [impstatus v]) - (0.25))\n    else\n        replace item (#CloneID) of [impstatus v] with ((item (#CloneID) of [impstatus v]) - (0.5))\n    end\nend\nif <not <(item (#CloneID) of [impstatus v]) > [0]>> then\n    set [deletedid v] to (#CloneID)\n    delete (#CloneID) of [impstatus v]\n    delete (#CloneID) of [impid v]\n    delete (#CloneID) of [projectile data v]\n    broadcast (ShiftImpID v)\n    delete this clone\nend\n\nwhen I receive [shiftimpid v]\nif <(#CloneID) > (DeletedID)> then\n    change [#cloneid v] by (-1)\nend\n\nwhen I receive [resetimpdata v]\ndelete (all) of [impstatus v]\ndelete (all) of [projectile data v]\ndelete (all) of [impid v]\ndelete (all) of [impx v]\ndelete (all) of [impy v]\n\nwhen I receive [setup v]\ndelete (all) of [impstatus v]\ndelete (all) of [impid v]\ndelete (all) of [impx v]\ndelete (all) of [impy v]\nDelete Clones\nhide\n\ndefine ShootProjectileIf <>\nif <condition> then\n    set [timer v] to [0]\n    replace item (#CloneID) of [impid v] with (join ((x position) + (500)) ((y position) + (535)))\n    replace item (#CloneID) of [projectile data v] with [1]\nelse\n    change [timer v] by (1)\nend\n\n@Blob King\n\nwhen I receive [render entities v]\nDelete Clones\nset [n v] to [0]\nrepeat (((length of [bossx v]) + (length of [bossy v])) / (2))\n    change [n v] by (1)\n    Create Boss at (item (n) of [bossx v]) (item (n) of [bossy v])\nend\n\ndefine Update Boss Status\nif <(x position) > ([x position v] of [hitbox v])> then\n    point in direction (-90)\nelse\n    point in direction (90)\nend\nif <<(Attacking?) > [0]> and <touching (character v)?>> then\n    if <((direction) - (180)) = ([direction v] of [character v])> then\n        replace item (#CloneID) of [impstatus v] with ((item (#CloneID) of [impstatus v]) - (0.25))\n    else\n        replace item (#CloneID) of [impstatus v] with ((item (#CloneID) of [impstatus v]) - (0.5))\n    end\nend\nif <not <(item (#CloneID) of [impstatus v]) > [0]>> then\n    set [time v] to (timer)\n    broadcast (Game Over v)\n    set [deletedid2 v] to (#CloneID)\n    delete (#CloneID) of [impstatus v]\n    delete (#CloneID) of [impid v]\n    delete (#CloneID) of [projectile data v]\n    broadcast (ShiftBossId v)\n    delete this clone\nend\n\nwhen I start as a clone\nSetup\nrepeat until <not <(Level) = (MyLevel)>>\n    Shoot Projectiles if <(Timer) > [50]>\n    Update Boss Status\nend\ndelete this clone\n\nwhen I receive [setup v]\ndelete (all) of [bossx v]\ndelete (all) of [bossy v]\nDelete Clones\nhide\n\nwhen I receive [resetimpdata v]\ndelete (all) of [bossx v]\ndelete (all) of [bossy v]\n\ndefine Delete Clones\nset [#cloneid v] to [0]\ndelete this clone\n\ndefine Setup\ngo to x: (x) y: (y)\nshow\ngo to [front v] layer\nclear graphic effects\nset size to (400) %\nset [mylevel v] to (Level)\n\ndefine Shoot Projectiles if <>\nif <condition> then\n    set [timer v] to [0]\n    replace item (#CloneID) of [impid v] with (join ((x position) + (500)) ((y position) + (518)))\n    replace item (#CloneID) of [projectile data v] with [2]\nelse\n    change [timer v] by (1)\nend\n\ndefine None\nchange [#cloneid v] by (1)\nset [x v] to (x)\nset [y v] to (y)\nadd [75] to [impstatus v]\nadd [000000] to [impid v]\nadd [0] to [projectile data v]\ncreate clone of (_myself_ v)\n\nwhen I receive [shiftbossid v]\nif <(#CloneID) > (DeletedID)> then\n    change [#cloneid v] by (-1)\nend\n\n@Health Bars\n\ndefine Render Health Bars\nhide\nset [#cloneid v] to [0]\nrepeat (length of [impstatus v])\n    change [#cloneid v] by (1)\n    create clone of (_myself_ v)\nend\nset [#cloneid v] to [-1]\n\nwhen I start as a clone\nshow\nset [maxhealth v] to (item (#CloneID) of [impstatus v])\nset [mylevel v] to (Level)\nrepeat until <not <(Level) = (MyLevel)>>\n    Update Health Bar\nend\ndelete this clone\n\ndefine Update Health Bar\nset x to ((join (letter (1) of (item (#CloneID) of [impid v])) (join (letter (2) of (item (#CloneID) of [impid v])) (letter (3) of (item (#CloneID) of [impid v])))) - (500))\nset y to ((join (letter (4) of (item (#CloneID) of [impid v])) (join (letter (5) of (item (#CloneID) of [impid v])) (letter (6) of (item (#CloneID) of [impid v])))) - (455))\nset [% v] to (((item (#CloneID) of [impstatus v]) / (MaxHealth)) * (100))\nif <(%) > [90]> then\n    switch costume to (10 v)\nelse\n    if <(%) > [80]> then\n        switch costume to (9 v)\n    else\n        if <(%) > [70]> then\n            switch costume to (8 v)\n        else\n            if <(%) > [60]> then\n                switch costume to (7 v)\n            else\n                if <(%) > [50]> then\n                    switch costume to (6 v)\n                else\n                    if <(%) > [40]> then\n                        switch costume to (5 v)\n                    else\n                        if <(%) > [30]> then\n                            switch costume to (4 v)\n                        else\n                            if <(%) > [20]> then\n                                switch costume to (3 v)\n                            else\n                                if <(%) > [10]> then\n                                    switch costume to (2 v)\n                                else\n                                    if <(%) > [0]> then\n                                        switch costume to (1 v)\n                                    else\n                                        delete this clone\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [render health bars v]\nhide\nDelete Clones\nRender Health Bars\n\ndefine Delete Clones\ndelete this clone\n\n@Projectiles\n\nwhen I receive [levelbegin v]\nDeleteClones\nset [mylevel v] to (Level)\nrepeat until <not <(Level) = (MyLevel)>>\n    if <(Ranged) > [0]> then\n        if <(Ammo) > [0]> then\n            change [ammo v] by (-1)\n            create clone of (_myself_ v)\n        end\n    end\n    wait until <(Ranged) = [0]>\nend\n\nwhen I receive [setup v]\nDeleteClones\nhide\n\ndefine DeleteClones\ndelete this clone\n\nwhen I start as a clone\nshow\ngo to x: ([x position v] of [hitbox v]) y: (([y position v] of [hitbox v]) + (40))\npoint towards (mouse-pointer v)\nif <(Character) = [0]> then\nelse\n    if <(Character) = [1]> then\n    else\n        if <(Character) = [3]> then\n        end\n    end\nend\ndelete this clone\n\n@Imp Projectiles\n\nwhen I receive [setup v]\nDeleteClones\nhide\n\ndefine DeleteClones\nset [#cloneid v] to [0]\ndelete this clone\n\ndefine None\nset [direction v] to ([atan v] of (((y position) - (y)) / ((x) - (x position))) )\nif <((x) - (x position)) < [0]> then\n    change [direction v] by (180)\nelse\n    if <(Direction) < [0]> then\n        change [direction v] by (1)\n    end\nend\nchange [direction v] by (90)\npoint in direction (Direction)\n\ndefine FindIndex\nset [n v] to [0]\nrepeat until <(item (n) of [projectile data v]) = [1]>\n    change [n v] by (1)\n    if <(n) > (length of [projectile data v])> then\n        set [n v] to [0]\n    end\nend\nset [index v] to (n)\nreplace item (n) of [projectile data v] with [0]\n\nwhen I receive [levelbegin v]\nset [mylevel v] to (Level)\nrepeat until <not <(MyLevel) = (Level)>>\n    if <[projectile data v] contains [1]?> then\n        FindIndex\n        set [#cloneid v] to (index)\n        create clone of (_myself_ v)\n        set [#cloneid v] to [-1]\n    end\nend\n\ndefine None\nset [hp v] to (value)\nbroadcast (UpdateHP v)\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nswitch costume to (projectile v)\nclear graphic effects\nset [x v] to ((join (letter (1) of (item (#CloneID) of [impid v])) (join (letter (2) of (item (#CloneID) of [impid v])) (letter (3) of (item (#CloneID) of [impid v])))) - (500))\nset [y v] to ((join (letter (4) of (item (#CloneID) of [impid v])) (join (letter (5) of (item (#CloneID) of [impid v])) (letter (6) of (item (#CloneID) of [impid v])))) - (500))\ngo to x: (X) y: (Y)\nPoint Towards ([x position v] of [hitbox v]) (([y position v] of [hitbox v]) + (30))\nrepeat until <<touching (hitbox v)?> or <<touching (_edge_ v)?> or <touching (map v)?>>>\n    move (10) steps\nend\nif <touching (hitbox v)?> then\n    Set HP to ((HP) - (35))\nelse\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\nend\ndelete this clone\n\n@King Projectiles\n\ndefine Delete Clones\nset [#cloneid v] to [0]\ndelete this clone\n\nwhen I receive [setup v]\nDelete Clones\nhide\n\ndefine None\nset [hp v] to (value)\nbroadcast (UpdateHP v)\n\nwhen I start as a clone\nset size to (200) %\nshow\ngo to [front v] layer\nswitch costume to (costume1 v)\nclear graphic effects\nset [x v] to ((join (letter (1) of (item (#CloneID) of [impid v])) (join (letter (2) of (item (#CloneID) of [impid v])) (letter (3) of (item (#CloneID) of [impid v])))) - (500))\nset [y v] to ((join (letter (4) of (item (#CloneID) of [impid v])) (join (letter (5) of (item (#CloneID) of [impid v])) (letter (6) of (item (#CloneID) of [impid v])))) - (500))\ngo to x: (X) y: (Y)\nPoint towards ([x position v] of [hitbox v]) (([y position v] of [hitbox v]) + (35))\nrepeat until <<touching (hitbox v)?> or <<touching (map v)?> or <touching (_edge_ v)?>>>\n    move (10) steps\nend\nif <touching (hitbox v)?> then\n    Set HP to ((HP) - (35))\nelse\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\nend\ndelete this clone\n\ndefine None\nset [direction v] to ([atan v] of (((y position) - (y)) / ((x) - (x position))) )\nif <((x) - (x position)) < [0]> then\n    change [direction v] by (180)\nelse\n    if <(Direction) < [0]> then\n        change [direction v] by (1)\n    end\nend\nchange [direction v] by (90)\npoint in direction (Direction)\n\nwhen I receive [levelbegin v]\nset [mylevel v] to (Level)\nrepeat until <not <(MyLevel) = (Level)>>\n    if <[projectile data v] contains [2]?> then\n        Find Index\n        set [#cloneid v] to (index)\n        create clone of (_myself_ v)\n        set [#cloneid v] to [-1]\n    end\nend\n\ndefine Find Index\nset [n v] to [0]\nrepeat until <(item (n) of [projectile data v]) = [2]>\n    change [n v] by (1)\n    if <(n) > (length of [projectile data v])> then\n        set [n v] to [0]\n    end\nend\nset [index v] to (n)\nreplace item (index) of [projectile data v] with [0]\n\n@HP\n\nwhen I receive [setup v]\nDeleteClones\nhide\nswitch costume to (2 v)\n\ndefine DeleteClones\ndelete this clone\n\nwhen I receive [hpsetup v]\nCreateHearts\n\nwhen I start as a clone\ngo to x: ((((#CloneID) - (1)) * (24)) - (225)) y: (160)\nswitch costume to (item (#CloneID) of [heartstatus v])\nset size to (100) %\ngo to [front v] layer\nshow\n\nwhen I receive [updatehp v]\nif <(#CloneID) > [0]> then\n    if <(HP) < ((item (#CloneID) of [heartdata v]) + (1))> then\n        replace item (#CloneID) of [heartstatus v] with [0]\n    else\n        if <(HP) < ((item (#CloneID) of [heartdata v]) + (6))> then\n            replace item (#CloneID) of [heartstatus v] with [1]\n        else\n            if <not <(HP) < ((item (#CloneID) of [heartdata v]) + (6))>> then\n                replace item (#CloneID) of [heartstatus v] with [2]\n            end\n        end\n    end\n    switch costume to (item (#CloneID) of [heartstatus v])\n    go to [front v] layer\n    show\nend\n\ndefine CreateHearts\ndelete (all) of [heartdata v]\ndelete (all) of [heartstatus v]\nset [#cloneid v] to [0]\nrepeat (10)\n    change [#cloneid v] by (1)\n    add (((#CloneID) * (-10)) + (100)) to [heartdata v]\n    add [2] to [heartstatus v]\n    create clone of (_myself_ v)\nend\nset [#cloneid v] to [-1]\n\n@Death Animation\n\nwhen I receive [render v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [dead v]\nset [animating? v] to [1]\ngo to (character v)\npoint in direction ([direction v] of [character v])\nshow\ngo to [front v] layer\nset rotation style [all around v]\nset size to (60) %\nswitch costume to ((Character) + (1))\nif <not <(y position) < [-180]>> then\n    set [yv v] to [5]\n    set [xv v] to ([xv v] of [hitbox v])\n    repeat until <(y position) < [-180]>\n        set [yv v] to ((Yv) - (1))\n        set [xv v] to ((Xv) * (0.9))\n        turn right (15) degrees\n        change y by (Yv)\n        change x by (Xv)\n    end\nend\nhide\nset [animating? v] to [0]\n\nwhen I receive [setup v]\nset [animating? v] to [0]\nset [yv v] to [0]\nset [xv v] to [0]\nhide\n\n@Tiles\n\nwhen I receive [render v]\nRender\n\ndefine Upload\nshow\ngo to x: (-232) y: (-172)\nset size to (100) %\nerase all\nbroadcast (show v) and wait\nrepeat (23)\n    repeat (30)\n        switch costume to (render v)\n        if <touching color (#666666)?> then\n            switch costume to (dirt v)\n        else\n            if <touching color (#e5e5e5)?> then\n                switch costume to (grass v)\n            else\n                if <touching color (#000000)?> then\n                    switch costume to (rock v)\n                else\n                    if <touching color (#006622)?> then\n                        switch costume to (mossy rock v)\n                    else\n                        if <touching color (#990000)?> then\n                            switch costume to (spike v)\n                        else\n                            if <touching color (#ff0000)?> then\n                                switch costume to (spike2 v)\n                            else\n                                if <touching color (#00cc44)?> then\n                                    switch costume to (bricks v)\n                                else\n                                    if <touching color (#66004c)?> then\n                                        switch costume to (dark wood planks v)\n                                    else\n                                        if <touching color (#cc0099)?> then\n                                            switch costume to (light wood planks v)\n                                        else\n                                            if <touching color (#ff99e5)?> then\n                                                switch costume to (thatch v)\n                                            else\n                                                if <touching color (#ffccf2)?> then\n                                                    switch costume to (glass v)\n                                                else\n                                                    if <touching color (#4c0099)?> then\n                                                        switch costume to (tree trunk dark v)\n                                                    else\n                                                        if <touching color (#7f00ff)?> then\n                                                            switch costume to (tree trunk v)\n                                                        else\n                                                            if <touching color (#006666)?> then\n                                                                switch costume to (cobblestone v)\n                                                            else\n                                                                if <touching color (#009999)?> then\n                                                                    switch costume to (mossy cobblestone v)\n                                                                else\n                                                                    if <touching color (#ffff00)?> then\n                                                                        switch costume to (leaves v)\n                                                                    else\n                                                                        if <touching color (#999900)?> then\n                                                                            switch costume to (leaves dark v)\n                                                                        else\n                                                                            if <touching color (#ffff99)?> then\n                                                                                switch costume to (imp v)\n                                                                            else\n                                                                                if <touching color (#003fff)?> then\n                                                                                    switch costume to (pick random (16) to (17))\n                                                                                else\n                                                                                    if <touching color (#ccffdd)?> then\n                                                                                        switch costume to (tall grass v)\n                                                                                    else\n                                                                                        if <touching color (#99ffbb)?> then\n                                                                                            switch costume to (extra tall grass v)\n                                                                                        else\n                                                                                            if <touching color (#00cc44)?> then\n                                                                                                switch costume to (witheredgrass v)\n                                                                                            else\n                                                                                                if <touching color (#009933)?> then\n                                                                                                    switch costume to (flower v)\n                                                                                                else\n                                                                                                    if <touching color (#b8ff71)?> then\n                                                                                                        switch costume to (boss v)\n                                                                                                    else\n                                                                                                        if <touching color (#a0c3ff)?> then\n                                                                                                            switch costume to (pick random (26) to (27))\n                                                                                                        end\n                                                                                                    end\n                                                                                                end\n                                                                                            end\n                                                                                        end\n                                                                                    end\n                                                                                end\n                                                                            end\n                                                                        end\n                                                                    end\n                                                                end\n                                                            end\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        add ((costume [number v]) - (1)) to [level_data v]\n        change x by (16)\n    end\n    set x to (-232)\n    change y by (16)\nend\nbroadcast (hide v)\nhide\n\nwhen I receive [next v]\ndelete this clone\n\nwhen I receive [setup v]\nerase all\nhide\n\nwhen I receive [levelbegin v]\nif <(Cloned?) = [1]> then\n    set [n v] to [0]\n    forever\n        go to [front v] layer\n        set [n v] to ((1) - (n))\n        switch costume to ((n) + (17))\n        set [ghost v] effect to (30)\n        wait (pick random (0.25) to (0.4)) seconds\n    end\nelse\n    if <(Cloned?) = [2]> then\n        set [n v] to [0]\n        forever\n            set [n v] to ((1) - (n))\n            switch costume to ((n) + (26))\n            set [ghost v] effect to (pick random (0) to (10))\n            wait (pick random (0.25) to (0.4)) seconds\n        end\n    end\nend\n\ndefine Render\nLoad Level Data\nshow\ngo to x: (-232) y: (-172)\nset size to (100) %\nerase all\nset [loadmarker v] to [0]\nrepeat (length of [level_ v])\n    change [loadmarker v] by (1)\n    if <not <(item (loadMarker) of [level_ v]) = [0]>> then\n        switch costume to ((item (loadMarker) of [level_ v]) + (1))\n        if <<(item (loadMarker) of [level_ v]) = [15]> or <(item (loadMarker) of [level_ v]) = [16]>> then\n            next costume\n            set [cloned? v] to [1]\n            create clone of (_myself_ v)\n            set [cloned? v] to [0]\n        else\n            if <<(item (loadMarker) of [level_ v]) = [25]> or <(item (loadMarker) of [level_ v]) = [26]>> then\n                next costume\n                set [cloned? v] to [2]\n                create clone of (_myself_ v)\n                set [cloned? v] to [0]\n            else\n                if <(item (loadMarker) of [level_ v]) = [24]> then\n                    add (x position) to [impx v]\n                    add ((y position) - (8)) to [impy v]\n                else\n                    if <(item (loadMarker) of [level_ v]) = [27]> then\n                        add (x position) to [bossx v]\n                        add ((y position) - (8)) to [bossy v]\n                    else\n                        stamp\n                    end\n                end\n            end\n        end\n    end\n    change x by (16)\n    if <((loadMarker) mod (30)) = [0]> then\n        change y by (16)\n        set x to (-232)\n    end\nend\nhide\n\ndefine Load Level Data\ndelete (all) of [level_ v]\nset [loaddatamarker v] to (((Level) - (1)) * (690))\nrepeat until <(length of [level_ v]) = [690]>\n    insert [0] at (last) of [level_ v] \n    change [loaddatamarker v] by (1)\n    if <not <((item (loadDataMarker) of [level_data v]) mod (length of [level_data v])) = [0]>> then\n        replace item (last) of [level_ v] with ((item (loadDataMarker) of [level_data v]) mod (length of [level_data v]))\n    end\nend\n\ndefine Upload All\ndelete (all) of [level_data v]\nbroadcast (Reset Maps v) and wait\nrepeat (length of [levels v])\n    Upload\n    broadcast (Progress v) and wait\nend\n\n@Win\n\nwhen I receive [setup v]\nset [level v] to [1]\nhide\n\nwhen I receive [next v]\nhide\n\nwhen I receive [levelbegin v]\nshow\ngo to x: (item (Level) of [winx v]) y: (item (Level) of [winy v])\nif <(Level) = [12]> then\n    hide\nend\n\ngo to x: ((round ((x position) / (16))) * (16)) y: ((round ((y position) / (16))) * (16))\nchange x by (-4)\nchange y by (-10)\nadd (x position) to [winx v]\nadd (y position) to [winy v]\n\n@Character Select\n\nwhen I receive [characterselect v]\nhide\nSetup\nset [ghost v] effect to (100)\nset [posing? v] to [0]\nset [turn v] to [0]\nset [#cloneid v] to [0]\nswitch costume to (jtg stand v)\nrepeat (4)\n    change [#cloneid v] by (1)\n    create clone of (_myself_ v)\n    repeat (2)\n        next costume\n    end\nend\nset [#cloneid v] to [-1]\nrepeat until <not <(Character) = []>>\n    change [turn v] by (3)\nend\n\nwhen this sprite clicked\nif <<(#CloneID) > [0]> and <(Posing?) = [0]>> then\n    set [character v] to ((#CloneID) - (1))\n    broadcast (Begin Game v)\n    delete this clone\nend\n\nwhen I receive [setup v]\nset [turn v] to [3]\nset [character v] to []\nhide\ndelete this clone\n\nwhen I receive [start v]\nPose Characters\n\ndefine Pose Characters\nset [posing? v] to [1]\nset [#cloneid v] to [0]\nrepeat (4)\n    change [#cloneid v] by (1)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nif <(Posing?) = [1]> then\n    show\n    go to [front v] layer\n    set size to (300) %\n    if <(#CloneID) = [1]> then\n        switch costume to (jtg stand v)\n        go to x: (-150) y: (-220)\n        point in direction (75)\n    else\n        if <(#CloneID) = [2]> then\n            switch costume to (hakon stand v)\n            go to x: (-47) y: (-210)\n            point in direction (85)\n        else\n            if <(#CloneID) = [3]> then\n                switch costume to (mtm stand v)\n                go to x: (45) y: (-280)\n                point in direction (95)\n            else\n                if <(#CloneID) = [4]> then\n                    switch costume to (etk stand v)\n                    go to x: (150) y: (-260)\n                    point in direction (105)\n                end\n            end\n        end\n    end\n    wait until <key (any v) pressed?>\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Posing?) = [0]> then\n    set size to (150) %\n    show\n    go to [front v] layer\n    go to x: ((-165) + (((#CloneID) - (1)) * (100))) y: (-50)\n    point in direction ((([cos v] of ((0) - ((Turn) + (#CloneID))) ) * (10)) + (90))\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    repeat until <not <(Character) = []>>\n        point in direction ((([cos v] of ((0) - ((Turn) + (#CloneID))) ) * (10)) + (90))\n        if <touching (mouse-pointer v)?> then\n            repeat until <<not <touching (mouse-pointer v)?>> or <mouse down?>>\n                switch costume to ((#CloneID) * (2))\n                say (item (#CloneID) of [catchphrases v])\n                point in direction (90)\n            end\n            switch costume to (((#CloneID) * (2)) - (1))\n            say [] for (0) seconds\n        end\n    end\n    delete this clone\nend\n\ndefine Setup\ndelete (all) of [catchphrases v]\nadd [Now it's Vidar time!] to [catchphrases v]\nadd [Make the decision!] to [catchphrases v]\nadd [Precision!] to [catchphrases v]\nadd [Flame powers activate!] to [catchphrases v]\n\ndefine Delete Clones\ndelete this clone\n\nwhen I receive [menu v]\ndelete this clone\n\n@Currency\n\ndefine Delete Clones\ndelete this clone\n\ndefine None\nchange [#cloneid v] by (1)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nclear graphic effects\nset size to (100) %\ngo to x: (X) y: (Y)\nset [mylevel v] to (Level)\nrepeat until <<not <(Level) = (MyLevel)>> or <touching (hitbox v)?>>\n    repeat (3)\n        change size by (5)\n    end\n    repeat (3)\n        change size by (-5)\n    end\nend\nif <touching (hitbox v)?> then\n    change [money v] by (10)\n    repeat (5)\n        change y by (4)\n        change [ghost v] effect by (20)\n    end\nend\ndelete this clone\n\nwhen I receive [render entities v]\nDelete Clones\nset [n v] to [0]\nrepeat (((length of [coinx v]) + (length of [coiny v])) / (2))\n    change [n v] by (1)\n    Create Coin at (item (n) of [coinx v]) (item (n) of [coiny v])\nend\n\n@Menu\n\nwhen I receive [setup v]\nDelete Clones\nhide\n\ndefine Delete Clones\ndelete this clone\n\ndefine Create Clones\nset [#cloneid v] to [0]\nrepeat (3)\n    change [#cloneid v] by (1)\n    create clone of (_myself_ v)\nend\nset [#cloneid v] to [-1]\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nswitch costume to (#CloneID)\nif <(#CloneID) = [1]> then\n    go to x: (0) y: (0)\nelse\n    if <(#CloneID) = [2]> then\n        go to x: (0) y: (-60)\n    else\n        go to x: (0) y: (-120)\n    end\nend\nrepeat until <not <(Screen) = [menu]>>\n    if <touching (mouse-pointer v)?> then\n        if <mouse down?> then\n            go to x: (2) y: ((((#CloneID) - (1)) * (-60)) + (2))\n        else\n            go to x: (0) y: (((#CloneID) - (1)) * (-60))\n        end\n        set [brightness v] effect to (10)\n    else\n        set [brightness v] effect to (0)\n    end\nend\ndelete this clone\n\nwhen I receive [menu v]\nCreate Clones\n\nwhen this sprite clicked\nwait until <not <mouse down?>>\nif <(#CloneID) = [1]> then\n    set [screen v] to [Character Select]\n    broadcast (CharacterSelect v)\nelse\n    if <(#CloneID) = [2]> then\n        if  then\n            set [screen v] to [Character]\n            broadcast (Character Options v)\n        else\n            say [This feature is not ready yet. Expect an update soon!] for (4) seconds\n        end\n    else\n        set [screen v] to [Options]\n        broadcast (Options v)\n    end\nend\n\n@Volume/Difficulty Changers\n\nwhen I receive [setup v]\nDelete Clones\nset [imp dif v] to [3]\nset [volume v] to [100]\nhide variable [imp dif v]\nhide variable [volume v]\nhide\n\ndefine Delete Clones\ndelete this clone\n\ndefine Create Clones\nshow variable [imp dif v]\nshow variable [volume v]\nset [#cloneid v] to [0]\nrepeat (6)\n    change [#cloneid v] by (1)\n    create clone of (_myself_ v)\nend\nset [#cloneid v] to [-1]\n\nwhen this sprite clicked\nwait until <not <mouse down?>>\nif <(#CloneID) = [2]> then\n    if <(Imp Dif) < [5]> then\n        change [imp dif v] by (1)\n    end\nelse\n    if <(#CloneID) = [3]> then\n        if <(Imp Dif) > [1]> then\n            change [imp dif v] by (-1)\n        end\n    else\n        if <(#CloneID) = [5]> then\n            if <(Volume) < [100]> then\n                change [volume v] by (10)\n            end\n        else\n            if <(#CloneID) = [6]> then\n                if <(Volume) > [0]> then\n                    change [volume v] by (-10)\n                end\n            end\n        end\n        broadcast (Update Volume v) and wait\n    end\nend\n\nwhen I receive [options v]\nCreate Clones\n\nwhen I start as a clone\nshow\nif <(#CloneID) < [4]> then\n    go to x: (-180) y: (25)\nelse\n    go to x: (-180) y: (-50)\nend\nset [x v] to (x position)\nset [y v] to (y position)\nif <(#CloneID) = [1]> then\n    switch costume to (backing1 v)\n    wait until <not <(Screen) = [Options]>>\n    delete this clone\nelse\n    if <(#CloneID) = [4]> then\n        switch costume to (backing2 v)\n        wait until <not <(Screen) = [Options]>>\n        delete this clone\n    else\n        if <<(#CloneID) = [2]> or <(#CloneID) = [5]>> then\n            switch costume to (up v)\n            repeat until <not <(Screen) = [Options]>>\n                if <touching (mouse-pointer v)?> then\n                    if <mouse down?> then\n                        go to x: ((X) + (1)) y: ((Y) + (1))\n                    else\n                        go to x: (X) y: (Y)\n                    end\n                    set [ghost v] effect to (10)\n                else\n                    set [ghost v] effect to (0)\n                end\n            end\n            delete this clone\n        else\n            switch costume to (down v)\n            repeat until <not <(Screen) = [Options]>>\n                if <touching (mouse-pointer v)?> then\n                    if <mouse down?> then\n                        go to x: ((X) + (1)) y: ((Y) + (1))\n                    else\n                        go to x: (X) y: (Y)\n                    end\n                    set [ghost v] effect to (10)\n                else\n                    set [ghost v] effect to (0)\n                end\n            end\n            delete this clone\n        end\n    end\nend\n\nwhen I receive [menu v]\nhide variable [imp dif v]\nhide variable [volume v]\n\n@Character Menu\n\ndefine Update Character Specs\nif <(Upgrade?) = [1]> then\n    if <(UpgradeID) = [1]> then\n    else\n        if <(UpgradeID) = [2]> then\n        else\n            if <(UpgradeID) = [3]> then\n            end\n        end\n    end\n    set [upgrade? v] to [0]\n    set [upgradeid v] to [0]\nend\n\nwhen I receive [update specs v]\nUpdate Character Specs\n\ndefine Setup Upgrades\nrepeat (12)\n    add [1] to [upgradedata v]\nend\n\nadd [0.5] to [upgradevalues v]\nadd [1] to [upgradevalues v]\nadd [1.5] to [upgradevalues v]\n\nreplace item (((Character) * (3)) + (1)) of [attributes v] with []\nreplace item (((Character) * (3)) + (2)) of [attributes v] with []\nreplace item (((Character) * (3)) + (3)) of [attributes v] with []\n\n@Back Button\n\nwhen I receive [setup v]\nset size to (150) %\nhide\n\nwhen I receive [back button v]\nset [currentscreen v] to (Screen)\ngo to x: (-195) y: (-135)\nswitch costume to (costume1 v)\nshow\nrepeat until <not <(Screen) = (CurrentScreen)>>\n    if <touching (mouse-pointer v)?> then\n        repeat until <(size) = [170]>\n            change size by (5)\n        end\n    else\n        repeat until <(size) = [150]>\n            change size by (-5)\n        end\n    end\nend\nhide\n\nwhen this sprite clicked\nset [screen v] to [Menu]\nbroadcast (Menu v)\n\nwhen I receive [options v]\nbroadcast (Back Button v)\n\nwhen I receive [characterselect v]\nbroadcast (Back Button v)\n\nwhen I receive [begin game v]\nhide\n\n@Text\n\ndefine None\nset size to ((size) * (100)) %\nif <(centered?) = [1]> then\n    set [. v] to [0]\n    set [.. v] to [0]\n    set y to (y)\n    repeat until <(length of (text)) < ((.) + (1))>\n        change [. v] by (1)\n        switch costume to (letter (.) of (text))\n        if <(letter ((.) + (1)) of (text)) = [\]> then\n            switch costume to (join (letter (.) of (text)) (letter (.) of (text)))\n            change [. v] by (1)\n        end\n        change [.. v] by (((item (costume [number v]) of [width v]) + (1)) * (size))\n    end\n    hide\n    set x to ((0) - ((..) / (2)))\nelse\n    go to x: (x) y: (y)\nend\nset [. v] to [0]\nshow\nrepeat until <(length of (text)) < ((.) + (1))>\n    change [. v] by (1)\n    switch costume to (letter (.) of (text))\n    if <(letter ((.) + (1)) of (text)) = [\]> then\n        switch costume to (join (letter (.) of (text)) (letter (.) of (text)))\n    end\n    if <not <(letter (.) of (text)) = [_]>> then\n        stamp\n    end\n    change x by (((item (costume [number v]) of [width v]) + (1)) * (size))\n    if <(letter ((.) + (1)) of (text)) = [\]> then\n        change [. v] by (1)\n    end\nend\nhide\n\nwhen I receive [setup v]\ndelete (all) of [width v]\nadd [5] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [2] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [1] to [width v]\nadd [2] to [width v]\nadd [3] to [width v]\nadd [1] to [width v]\nadd [5] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [2] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [5] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [1] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [3] to [width v]\nadd [5] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [3] to [width v]\nadd [4] to [width v]\nadd [5] to [width v]\nadd [8] to [width v]\nadd [4] to [width v]\nadd [5] to [width v]\nadd [4] to [width v]\nadd [1] to [width v]\nadd [2] to [width v]\nadd [2] to [width v]\nadd [1] to [width v]\nadd [4] to [width v]\nadd [5] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [4] to [width v]\nadd [2] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [4] to [width v]\nadd [1] to [width v]\nadd [3] to [width v]\nadd [4] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [4] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\nadd [3] to [width v]\n\nwhen I receive [start v]\nrepeat until <key (any v) pressed?>\n    Print: [l\egend_r\ush] at x: (0) y: (120) size: (7) centered: (1)\n    Print: [p\ress_a\ny_k\ey_to_c\ontinue] at x: (0) y: (20) size: (4) centered: (1)\n    wait (0.5) seconds\n    erase all\n    Print: [l\egend_r\ush] at x: (0) y: (120) size: (7) centered: (1)\n    wait (0.3) seconds\n    erase all\n    Print: [l\egend_r\ush] at x: (0) y: (120) size: (7) centered: (1)\nend\n\nwhen I receive [characterselect v]\nerase all\nPrint: [c\haracter_s\elect] at x: (0) y: (130) size: (7) centered: (1)\nPrint: [c\lick_to_choose!] at x: (0) y: (-140) size: (5) centered: (1)\nPrint: [v\idar] at x: (-200) y: (-90) size: (3) centered: (0)\nPrint: [h\akon] at x: (-100) y: (-90) size: (3) centered: (0)\nPrint: [i\ngrin] at x: (0) y: (-90) size: (3) centered: (0)\nPrint: [p\yrus] at x: (100) y: (-90) size: (3) centered: (0)\n\nwhen I receive [render text v]\nif <(Level) = [1]> then\n    Print: [u\se_the_arrows_to_move_and_jump] at x: (0) y: (140) size: (2) centered: (1)\n    Print: [a\void_the_spikes!] at x: (0) y: (110) size: (2) centered: (1)\n    Print: [a\nd_get_to_the_gems!] at x: (0) y: (80) size: (2) centered: (1)\nelse\n    if <(Level) = [2]> then\n        Print: [h\ow_hard_can_it_get?] at x: (-50) y: (130) size: (2) centered: (0)\n    else\n        if <(Level) = [3]> then\n            Print: [t\his_hard,_for_now...] at x: (-30) y: (130) size: (2) centered: (1)\n        else\n            if <(Level) = [4]> then\n                Print: [a\_lake?] at x: (0) y: (130) size: (2) centered: (1)\n                Print: [w\e'll_just_have_to_swim!] at x: (0) y: (100) size: (2) centered: (1)\n            else\n                if <(Level) = [5]> then\n                    Print: [g\oing_diving?] at x: (50) y: (85) size: (2) centered: (0)\n                else\n                    if <(Level) = [7]> then\n                        Print: [j\ump!] at x: (0) y: (100) size: (3) centered: (1)\n                    else\n                        if <(Level) = [8]> then\n                            Print: [w\hat's_this?_a\n_i\mp?] at x: (0) y: (150) size: (2) centered: (1)\n                            Print: [a\ttack_him_with_your_weapon!] at x: (0) y: (130) size: (2) centered: (1)\n                            Print: [p\ress_space!] at x: (0) y: (110) size: (2) centered: (1)\n                        else\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [menu v]\nstop [other scripts in sprite v]\nerase all\nPrint: [l\egend_r\ush] at x: (0) y: (120) size: (7) centered: (1)\n\nwhen I receive [options v]\nPrint: [d\ifficulty] at x: (-220) y: (60) size: (3) centered: (0)\nPrint: [v\olume] at x: (-217) y: (-15) size: (3) centered: (0)\n\nwhen I receive [game over v]\nPrint: (join [w\ell_done!_y\ou_did_it_in_] (join (Time) [_seconds!])) at x: (0) y: (70) size: (2) centered: (1)\n\n@Splash Text\n\nwhen I receive [setup v]\nset size to (400) %\ngo to x: (165) y: (90)\npoint in direction (70)\nhide\n\nwhen I receive [start v]\ngo to [front v] layer\nshow\nrepeat until <(GameStatus) = [playing]>\n    repeat (10)\n        change size by (5)\n    end\n    repeat (10)\n        change size by (-5)\n    end\nend\nhide\n\nwhen I receive [characterselect v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [menu v]\ngo to [front v] layer\nshow\nrepeat until <(GameStatus) = [playing]>\n    repeat (10)\n        change size by (5)\n    end\n    repeat (10)\n        change size by (-5)\n    end\nend\nhide\n\n@Intro\n\ndefine Intro\nif <(SkipIntro?) = [0]> then\n    set rotation style [left-right v]\n    erase all\n    set size to (100) %\n    point in direction (90)\n    go to x: (0) y: (4)\n    switch costume to (platform v)\n    show\n    stamp\n    set size to (75) %\n    switch costume to (stand v)\n    go to [front v] layer\n    go to x: (16) y: (38)\n    point in direction (-90)\n    wait (1) seconds\n    set [y v] to [10]\n    set [x v] to [-4]\n    start sound [Jump v]\n    repeat until <touching color (#b2b2b2)?>\n        change [y v] by (-1)\n        set [x v] to ((x) * (0.9))\n        change y by (y)\n        change x by (x)\n        switch costume to (run v)\n    end\n    start sound [Hit_Hurt v]\n    set rotation style [all around v]\n    create clone of (_myself_ v)\n    set [x v] to [-3]\n    change [y v] by (([abs v] of (y) ) * (2))\n    repeat until <(y position) < [-180]>\n        change [y v] by (-1)\n        set [x v] to ((x) * (0.9))\n        change y by (y)\n        change x by (x)\n        turn left (15) degrees\n        switch costume to (stand v)\n    end\n    go to x: (0) y: (4)\n    point in direction ((([cos v] of (3) ) * (10)) + (90))\n    switch costume to (writing v)\n    set [ghost v] effect to (100)\n    set size to (50) %\n    start sound [To The Stars v]\n    repeat (10)\n        change [ghost v] effect by (-10)\n        change size by (10)\n    end\n    reset timer\n    set [turn v] to [0]\n    repeat until <(timer) > [5.7]>\n        change [turn v] by (3)\n        point in direction ((([cos v] of (turn) ) * (10)) + (90))\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n        change size by (10)\n    end\nend\nhide\ndelete this clone\n\nwhen I receive [intro v]\nIntro\n\nwhen I start as a clone\nerase all\nswitch costume to (platform v)\nset size to (100) %\ngo to x: (0) y: (4)\nset rotation style [all around v]\nshow\ngo [backward v] (99) layers\nset [x v] to [3]\nchange [y v] by (([abs v] of (y) ) * (2))\nrepeat until <(y position) < [-180]>\n    change [y v] by (-1)\n    set [x v] to ((x) * (0.9))\n    change y by (y)\n    change x by (x)\n    turn right (15) degrees\nend\ndelete this clone\n\nwhen I receive [setup v]\nhide\n\n@Thumbnail\n\nwhen flag clicked\ngo to [front v] layer\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\n\n
This is the best version of LEGEND RUSH.\nPlay in full-screen, and double-click green flag.\nThe point of the game is to collect all of the gemstones at the end of each level by jumping through the platforms.\nAll levels are possible!\nMore levels coming soon!\n\nSigton's Best: 66 secs\n\nControls:\nLeft/right arrows to walk left/right.\nUp arrow to jump.\nSpace to attack.\n\nUpdate Log\nAlpha V0.1 Initial release\nV1.0 Ok, I skipped a lot of the alphas but I thought it was ready to leave alpha stage.\nV1.1 Bugfixes in menu and in the death animation.\nV1.2 Changed all of Hakon's Costumes to the ones used in Scratchers Fantasy by @RiceParadox\nV1.3 Volume changes while rendering\nV1.4 Music Change\nV2.0 Complete re-design of the render system, allowing for super-speed level loading!\nV3.0 HUGE changes for the new version!\n- Imp AI's\n- HP\n- Better Menu's\n- More levels\n- New Platforming engine\n- Attacks\n- Cosmetics\n- Attributes\n- New Hakon Designs\n- Animations\n- Debugging\n- Minor Improvements across the board\n- Health Bars