Dash - Demo (Platformer) v0.3


@Stage\n\nwhen I receive [next level v]\nrepeat until <(Level) = [3]>\n    broadcast (Tick v)\nend\n\nwhen I receive [next level v]\nrepeat (10)\n    change volume by (-10)\nend\nset [song v] to (join [Level] (Level))\nstop all sounds\nwait (1) seconds\nrepeat (10)\n    change volume by (10)\nend\nset volume to (100) %\nrepeat until <not <(Song) = (join [Level] (Level))>>\n    play sound (Song) until done\nend\n\nwhen flag clicked\nset volume to (100) %\n\nbroadcast (Click to continue v)\n\nwhen flag clicked\n\nstart sound [Level1 v]\n\n@blank\n\n@Fellah\n\nset [ghost v] effect to (0)\nset size to (400) %\nswitch costume to (dasheffect v)\nset rotation style [all around v]\nset [x v] to (ScrollX)\nset [y v] to (ScrollY)\nset [yspeed v] to [0]\nturn right (180) degrees\nturn right (pick random (-45) to (45)) degrees\nchange [x v] by (([cos v] of ((90) - (direction)) ) * (20))\nchange [y v] by (([sin v] of ((90) - (direction)) ) * (20))\nchange [xspeed v] by (([cos v] of ((90) - (direction)) ) * (1))\nchange [yspeed v] by (([sin v] of ((90) - (direction)) ) * (1))\nrepeat (20)\n    go to x: (((X) - (ScrollX)) + (Xspeed)) y: (((Y) - (ScrollY)) + (Yspeed))\n    change [x v] by (Xspeed)\n    change [y v] by (Yspeed)\n    change size by (-20)\n    change [ghost v] effect by (5)\n    if <touching (_edge_ v)?> then\n        delete this clone\n    end\nend\ndelete this clone\n\nwhen I start as a clone\nif <(ID) = [5]> then\n    forever\n        go to x: ((X) - (ScrollX)) y: ((Y) - (ScrollY))\n    end\nend\n\nrepeat until <not <touching (collisions v)?>>\n    Move // X: [] Y: []\nend\n\nwhen I receive [next level v]\n\nwhen flag clicked\nwait (1) seconds\nforever\n    if <touching (death triggers v)?> then\n        set [playerhealth v] to [0]\n        broadcast (PlayerHurt v)\n        wait until <not <touching (death triggers v)?>>\n        wait (1) seconds\n    end\nend\n\nbroadcast (Transition v) and wait\nbroadcast (Next Level v) and wait\n\nset [yspeed v] to [10]\n\nwhen I receive [next level v]\n\nwait (1) seconds\n\nwhen flag clicked\n\nwait until <(Level) = [0]>\n\nif <<(X) > [930]> and <(EnemyCount) = [0]>> then\n\nwhen I receive [next level v]\n\nstop [all v]\n\nwait until <<(X) > [930]> or <not <(Level) = [1]>>>\nchange [level v] by (1)\nbroadcast (Transition v) and wait\nbroadcast (Next Level v) and wait\n\nwait (1) seconds\nstop [all v]\n\nwhen flag clicked\nforever\n    if <(Level) = [0]> then\n        wait until <<<(X) > [930]> and <(EnemyCount) = [0]>> or <not <(Level) = [0]>>>\n        change [level v] by (1)\n        broadcast (Transition v) and wait\n        broadcast (Next Level v)\n        wait (2) seconds\n    end\n    if <(Level) = [1]> then\n        wait until <<(X) > [900]> or <not <(Level) = [1]>>>\n        change [level v] by (1)\n        broadcast (Transition v) and wait\n        broadcast (Next Level v)\n        wait (2) seconds\n    end\n    if <(Level) = [2]> then\n        wait until <<(X) > [900]> or <not <(Level) = [2]>>>\n        change [level v] by (1)\n        broadcast (Transition v) and wait\n        broadcast (Next Level v)\n        wait (2) seconds\n    end\nend\n\nwhen flag clicked\nset [x v] to [-615]\nset [y v] to [-200]\nMove // X: [0] Y: [0]\nshow\nset [level v] to [0]\n\nwhen I receive [tick v]\nif <(ID) = [3]> then\n    Controller // Speed: [0.6]\n    Animation //\n    Camera // Speed: [0.9]\nend\n\ndefine Controller // Speed: (speed)\nset rotation style [don't rotate v]\nswitch costume to (hitbox v)\nif <key (a v) pressed?> then\n    change [xspeed v] by ((speed) * (-1))\nend\nif <key (d v) pressed?> then\n    change [xspeed v] by (speed)\nend\nset [xspeed v] to ((Xspeed) * (0.9))\nchange [yspeed v] by (-1)\nchange [floating v] by (1)\nMove // X: [] Y: (Yspeed)\nif <touching (collisions v)?> then\n    Move // X: [] Y: ((0) - (Yspeed))\n    if <not <(Yspeed) = [0]>> then\n        if <(Yspeed) > [0]> then\n            set [jump v] to [0]\n        else\n            set [jump v] to [1]\n        end\n        set [floating v] to [0]\n        set [yspeed v] to [0]\n    end\nend\nMove // X: (Xspeed) Y: []\nset [slope v] to [0]\nif <<<key (w v) pressed?> or <key (space v) pressed?>> and <<(floating) < [5]> and <(Jump) = [1]>>> then\n    change [yspeed v] by (10)\n    set [jump v] to [0]\n    set [floating v] to [0]\nend\nrepeat until <<(Slope) = [8]> or <not <touching (collisions v)?>>>\n    change [slope v] by (1)\n    Move // X: [] Y: [1]\nend\nif <(Slope) > [7]> then\n    set [jump v] to [0]\n    if <(canplaysound) = [1]> then\n        start sound (pick random (2) to (3))\n        broadcast (soundplayed v)\n        set [canplaysound v] to [0]\n    end\n    Move // X: [] Y: ((Slope) * (-1))\n    if <(Xspeed) > [0]> then\n        Move // X: (((Xspeed) + (0.2)) * (-1)) Y: []\n    end\n    if <(Xspeed) < [0]> then\n        Move // X: (((Xspeed) + (-0.2)) * (-1)) Y: []\n    end\n    set [xspeed v] to ((Xspeed) * (-1))\n    if <<(Xspeed) < [0.5]> and <(Xspeed) > [-0.5]>> then\n        if <<(Xspeed) < [0.5]> and <(Xspeed) > [0]>> then\n            set [xspeed v] to [0]\n        end\n        if <<(Xspeed) < [0]> and <(Xspeed) > [-0.5]>> then\n            set [xspeed v] to [0]\n        end\n    end\nend\nif <touching (_edge_ v)?> then\n    Move // X: ((0) - (Xspeed)) Y: []\nend\nif <(Yspeed) < [-30]> then\n    set [yspeed v] to [-30]\nend\npoint towards (mouse-pointer v)\nset rotation style [left-right v]\nswitch costume to (Costume)\n\ndefine Move // X: (x) Y: (y)\ngo to x: (((X) - (ScrollX)) + (x)) y: (((Y) - (ScrollY)) + (y))\nchange [x v] by (x)\nchange [y v] by (y)\n\ndefine Animation //\nif <([abs v] of (Xspeed) ) > [0.1]> then\n    Animate // [4] [4] (([abs v] of (Xspeed) ) / (12))\nelse\n    Animate // [2] [2] [0.1]\nend\n\ndefine Animate // (start costume) (maxcostumes) (speed)\nswitch costume to (walk2 v)\nswitch costume to ([floor v] of ((start costume) + ((Costume) mod (maxcostumes))) )\nchange [costume v] by (speed)\nif <(Costume) > [100]> then\n    set [costume v] to [0]\nend\n\ndefine Camera // Speed: (speed)\nif <<(X) > [-717]> and <(X) < [717]>> then\n    set [scrollx v] to (X)\nend\nset [scrolly v] to ((Y) + (10))\n\nwhen I start as a clone\nif <(ID) = [1]> then\n    go to [front v] layer\n    forever\n        if <(DashCharge) > [1]> then\n            show\n        else\n            hide\n        end\n        set size to (400) %\n        set rotation style [all around v]\n        go to (fellah v)\n        point towards (mouse-pointer v)\n    end\nelse\n    if <(ID) = [2]> then\n        go to [front v] layer\n        forever\n            if <(DashCharge) > [1]> then\n                show\n            else\n                hide\n            end\n            set size to (400) %\n            go to (fellah v)\n            change y by (15)\n            point towards (mouse-pointer v)\n            switch costume to (join [Charge] ([floor v] of (DashCharge) ))\n        end\n    else\n        if <(ID) = [4]> then\n            set [ghost v] effect to (0)\n            set size to (400) %\n            switch costume to (dasheffect v)\n            set rotation style [all around v]\n            set [yspeed v] to [0]\n            set [xspeed v] to [0]\n            turn right (180) degrees\n            turn right (pick random (-45) to (45)) degrees\n            change [x v] by (([cos v] of ((90) - (direction)) ) * (20))\n            change [y v] by (([sin v] of ((90) - (direction)) ) * (20))\n            change [xspeed v] by (([cos v] of ((90) - (direction)) ) * (1))\n            change [yspeed v] by (([sin v] of ((90) - (direction)) ) * (1))\n            repeat (20)\n                go to x: (((X) - (ScrollX)) + (Xspeed)) y: (((Y) - (ScrollY)) + (Yspeed))\n                change [x v] by (Xspeed)\n                change [y v] by (Yspeed)\n                change size by (-20)\n                change [ghost v] effect by (5)\n                if <touching (_edge_ v)?> then\n                    delete this clone\n                end\n            end\n            delete this clone\n        else\n            if <(ID) = [5]> then\n                switch costume to (dasheffectf1 v)\n                repeat (3)\n                    set rotation style [all around v]\n                    wait (0.05) seconds\n                    next costume\n                end\n                repeat (2)\n                    wait (0.1) seconds\n                    change [ghost v] effect by (50)\n                end\n                delete this clone\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <<<key (e v) pressed?> and <(Cooldown) = [0]>> and <(Stamina) > [0]>> then\n        repeat until <<<not <key (e v) pressed?>> or <(DashCharge) > [8]>> or <(Stamina) < [0.1]>>\n            change [dashcharge v] by (0.2)\n            change [stamina v] by (-0.4)\n            if <(Stamina) < [0.1]> then\n                set [stamina v] to [0]\n            end\n        end\n        set volume to ((DashCharge) * (12)) %\n        start sound [Dash v]\n        set [id v] to [5]\n        create clone of (_myself_ v)\n        set [id v] to [4]\n        create clone of (_myself_ v)\n        create clone of (_myself_ v)\n        create clone of (_myself_ v)\n        set [id v] to [3]\n        set [yspeed v] to [0]\n        change [xspeed v] by (([cos v] of ((90) - (direction)) ) * ((DashCharge) * (2.8)))\n        change [yspeed v] by (([sin v] of ((90) - (direction)) ) * ((DashCharge) * (2.8)))\n        set [cooldown v] to [20]\n        set [dashcharge v] to [1]\n        set volume to (100) %\n    end\n    if <(Cooldown) > [0]> then\n        change [cooldown v] by (-1)\n    end\n    if <<(Stamina) < [50]> and <([abs v] of (Xspeed) ) < [0.5]>> then\n        change [stamina v] by (0.05)\n    end\nend\n\nif <(Xspeed) > [0]> then\n    repeat until <not <touching (collisions v)?>>\n        set [xspeed v] to [0]\n        Move // X: [-1] Y: []\n    end\nelse\n    repeat until <not <touching (collisions v)?>>\n        set [xspeed v] to [0]\n        Move // X: [1] Y: [0]\n    end\nend\n\nwhen I receive [next level v]\nset [brightness v] effect to (0)\nset [ghost v] effect to (0)\nset size to (400) %\nif <[1] = [1]> then\n    delete this clone\nend\nset [playerhealth v] to [50]\nset [stamina v] to [50]\nset [id v] to [1]\nswitch costume to (arrow v)\ncreate clone of (_myself_ v)\nset [id v] to [2]\nswitch costume to (charge1 v)\ncreate clone of (_myself_ v)\nset [id v] to [3]\nswitch costume to (hitbox v)\nset [floating v] to [0]\nset [dashcharge v] to [1]\nset [cooldown v] to [0]\nset [xspeed v] to [0]\nset [yspeed v] to [0]\nset [slope v] to [0]\nset [costume v] to [1]\nif <(Level) = [0]> then\n    set [x v] to [-615]\n    set [y v] to [-200]\n    set [scrollx v] to [-615]\n    set [scrolly v] to [-200]\nelse\n    set [x v] to [-800]\n    set [y v] to [-200]\n    set [scrollx v] to [-700]\n    set [scrolly v] to [-200]\nend\n\nwhen I receive [playerhurt v]\nif <(ID) = [3]> then\n    set [brightness v] effect to (100)\n    set [xspeed v] to ((Xspeed) * (-1))\n    if <(PlayerHealth) < [1]> then\n        set volume to (100) %\n        start sound [Death v]\n        repeat (5)\n            change [ghost v] effect by (20)\n        end\n        broadcast (Transition v) and wait\n        broadcast (Next Level v)\n    end\n    repeat (10)\n        change [brightness v] effect by (-10)\n    end\n    set [brightness v] effect to (0)\nend\n\n@Collisions\n\nwhen I receive [tick v]\nforever\n    switch costume to (costume3 v)\n    go to x: ((X) - (ScrollX)) y: ((Y) - (ScrollY))\n    switch costume to (Costume)\nend\n\ngo to (fellah v)\n\nwhen I receive [next level v]\nswitch costume to (costume2 v)\nset size to (400) %\nset [costume v] to (join [Collisions] (Level))\nswitch costume to (join [Collisions] (Level))\nset [x v] to [0]\nset [y v] to [0]\n\nswitch costume to (collisions-1 v)\n\n@Background\n\ngo to (fellah v)\n\ngo to [back v] layer\n\nwhen I receive [next level v]\nswitch costume to (costume2 v)\nset size to (400) %\nset [costume v] to (join [Background] (Level))\nswitch costume to (join [Background] (Level))\nset [x v] to [0]\nset [y v] to [0]\n\nwhen I receive [tick v]\nforever\n    switch costume to (costume3 v)\n    go to x: ((X) - (ScrollX)) y: ((Y) - (ScrollY))\n    switch costume to (Costume)\nend\n\ngo [backward v] (1) layers\n\n@UI\n\nwhen I start as a clone\nif <(ID) = [1]> then\n    forever\n        if <(Level) = [0]> then\n            if <(ScrollX) > [-500]> then\n                switch costume to (message1 v)\n                go to x: (0) y: (240)\n                set [ghost v] effect to (100)\n                show\n                change [speed v] by (-8)\n                repeat (20)\n                    change y by (Speed)\n                    change [ghost v] effect by (-10)\n                    set [speed v] to ((Speed) * (0.8))\n                end\n                set [speed v] to [0]\n                wait until <(ScrollX) > [-240]>\n                set [ghost v] effect to (0)\n                show\n                change [speed v] by (8)\n                repeat (20)\n                    change y by (Speed)\n                    change [ghost v] effect by (10)\n                    set [speed v] to ((Speed) * (0.8))\n                end\n                set [speed v] to [0]\n                wait until <(ScrollX) > [100]>\n                switch costume to (message2 v)\n                go to x: (0) y: (240)\n                set [ghost v] effect to (100)\n                show\n                change [speed v] by (-8)\n                repeat (20)\n                    change y by (Speed)\n                    change [ghost v] effect by (-10)\n                    set [speed v] to ((Speed) * (0.8))\n                end\n                set [speed v] to [0]\n                wait until <(ScrollX) > [340]>\n                set [ghost v] effect to (0)\n                show\n                change [speed v] by (8)\n                repeat (20)\n                    change y by (Speed)\n                    change [ghost v] effect by (10)\n                    set [speed v] to ((Speed) * (0.8))\n                end\n                set [speed v] to [0]\n                wait until <(ScrollX) > [400]>\n                switch costume to (message3 v)\n                go to x: (0) y: (240)\n                set [ghost v] effect to (100)\n                show\n                change [speed v] by (-8)\n                repeat (20)\n                    change y by (Speed)\n                    change [ghost v] effect by (-10)\n                    set [speed v] to ((Speed) * (0.8))\n                end\n                set [speed v] to [0]\n                wait until <(EnemyCount) = [0]>\n                set [ghost v] effect to (0)\n                show\n                change [speed v] by (8)\n                repeat (20)\n                    change y by (Speed)\n                    change [ghost v] effect by (10)\n                    set [speed v] to ((Speed) * (0.8))\n                end\n                set [speed v] to [0]\n                wait until <(EnemyCount) = [0]>\n                wait (1) seconds\n                switch costume to (message4 v)\n                go to x: (0) y: (240)\n                set [ghost v] effect to (100)\n                show\n                change [speed v] by (-8)\n                repeat (20)\n                    change y by (Speed)\n                    change [ghost v] effect by (-10)\n                    set [speed v] to ((Speed) * (0.8))\n                end\n                set [speed v] to [0]\n                wait until <(Level) = [1]>\n                set [ghost v] effect to (0)\n                show\n                change [speed v] by (8)\n                repeat (20)\n                    change y by (Speed)\n                    change [ghost v] effect by (10)\n                    set [speed v] to ((Speed) * (0.8))\n                end\n                set [speed v] to [0]\n                wait until <(ScrollX) > [710]>\n            end\n        end\n    end\nend\n\nwait (1) seconds\n\nwhen I receive [next level v]\nif <[1] = [1]> then\n    delete this clone\nend\nset size to (100) %\nhide\nset [id v] to [1]\ncreate clone of (_myself_ v)\n\n\n\ndelete this clone\n\n\n\n@Enemy\n\nwhen I receive [tick v]\nif <(ID) = [1]> then\n    Movement // Speed: [0.5]\n    Animation //\nend\nif <(ID) = [2]> then\n    Movement // Speed: [0.3]\n    Animation //\nend\n\ndefine Movement // Speed: (speed)\nset rotation style [don't rotate v]\nswitch costume to (hitbox v)\nif <<([x v] of [fellah v]) < (X)> and <(distance to [fellah v]) < [200]>> then\n    change [xspeed v] by ((speed) * (-1))\nend\nif <<([x v] of [fellah v]) > (X)> and <(distance to [fellah v]) < [200]>> then\n    change [xspeed v] by (speed)\nend\nset [xspeed v] to ((Xspeed) * (0.9))\nif <not <touching (_edge_ v)?>> then\n    change [yspeed v] by (-1)\n    Move // X: [] Y: (Yspeed)\nend\nif <(Yspeed) > [0]> then\n    repeat until <not <touching (collisions v)?>>\n        set [yspeed v] to [0]\n        Move // X: [] Y: [-1]\n        set [jump v] to [0]\n    end\nelse\n    repeat until <not <touching (collisions v)?>>\n        set [yspeed v] to [0]\n        Move // X: [] Y: [1]\n        set [jump v] to [1]\n    end\nend\nMove // X: (Xspeed) Y: []\nset [slope v] to [0]\nrepeat until <<(Slope) = [8]> or <not <touching (collisions v)?>>>\n    change [slope v] by (1)\n    Move // X: [] Y: [1]\nend\nif <(Slope) > [7]> then\n    Move // X: (((Xspeed) * (-1)) - (Xspeed)) Y: ((0) - (Slope))\n    set [xspeed v] to ((Xspeed) * (-1))\n    if <(Jump) = [1]> then\n        change [yspeed v] by (10)\n        set [jump v] to [0]\n    end\nend\nif <(Yspeed) < [-30]> then\n    set [yspeed v] to [-30]\nend\npoint towards (fellah v)\nset rotation style [left-right v]\nswitch costume to (Costume)\n\n\n\nwhen I start as a clone\nif <(ID) = [1]> then\n    show\n    set [health v] to [15]\n    set [xspeed v] to [0]\n    set [yspeed v] to [0]\n    set [slope v] to [0]\n    set [costume v] to [1]\nend\nif <(ID) = [2]> then\n    show\n    set [health v] to [30]\n    set [xspeed v] to [0]\n    set [yspeed v] to [0]\n    set [slope v] to [0]\n    set [costume v] to [1]\nend\n\nset [x v] to [-615]\nset [y v] to [-200]\n\ndefine Move // X: (x) Y: (y)\nswitch costume to (size v)\ngo to x: (((X) - (ScrollX)) + (x)) y: (((Y) - (ScrollY)) + (y))\nswitch costume to (hitbox v)\nchange [x v] by (x)\nchange [y v] by (y)\n\nstart sound [pop v]\n\nset [y v] to [0]\n\nforever\n\ndefine Animation //\nif <(ID) = [1]> then\n    if <([abs v] of (Xspeed) ) > [0.1]> then\n        Animate // [4] [4] (([abs v] of (Xspeed) ) / (12))\n    else\n        Animate // [2] [2] [0.1]\n    end\nelse\n    if <(ID) = [2]> then\n        if <([abs v] of (Xspeed) ) > [0.1]> then\n            Animate // [10] [4] (([abs v] of (Xspeed) ) / (12))\n        else\n            Animate // [8] [2] [0.1]\n        end\n    end\nend\n\ndefine Animate // (startcostume) (maxcostume) (speed)\nswitch costume to (walk2 v)\nswitch costume to ([floor v] of ((startcostume) + ((Costume) mod (maxcostume))) )\nchange [costume v] by (speed)\nif <(Costume) > [100]> then\n    set [costume v] to [0]\nend\n\nwhen I start as a clone\nif <<(ID) = [1]> or <(ID) = [2]>> then\n    change [enemycount v] by (1)\n    wait (1) seconds\n    forever\n        change [cooldown v] by (-1)\n        if <touching (hitbox v)?> then\n            if <([cooldown v] of [fellah v]) > [10]> then\n                set [xspeed v] to (([xspeed v] of [fellah v]) * (0.5))\n                set [brightness v] effect to (100)\n                change [health v] by ((([abs v] of ([xspeed v] of [fellah v]) ) + ([abs v] of ([yspeed v] of [fellah v]) )) * (-0.8))\n                wait (0.1) seconds\n                if <<(Health) < [0]> or <(Health) = [0]>> then\n                    start sound [Death v]\n                    set [id v] to [3]\n                    create clone of (_myself_ v)\n                    create clone of (_myself_ v)\n                    create clone of (_myself_ v)\n                    create clone of (_myself_ v)\n                    create clone of (_myself_ v)\n                    set [id v] to [1]\n                    repeat (5)\n                        change [ghost v] effect by (20)\n                    end\n                    change [enemycount v] by (-1)\n                    delete this clone\n                else\n                    start sound [Hit v]\n                end\n                repeat (10)\n                    change [brightness v] effect by (-10)\n                end\n            else\n                if <(Cooldown) < [1]> then\n                    change [playerhealth v] by (-10)\n                    start sound [Hit v]\n                    broadcast (PlayerHurt v)\n                    set [cooldown v] to [50]\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nif <(ID) = [3]> then\n    point in direction (pick random (-179) to (180))\n    set [ghost v] effect to (0)\n    set size to (400) %\n    switch costume to (dasheffect v)\n    set rotation style [all around v]\n    change [xspeed v] by (([cos v] of ((90) - (direction)) ) * (0.5))\n    change [yspeed v] by (([sin v] of ((90) - (direction)) ) * (0.5))\n    repeat (20)\n        go to x: (((X) - (ScrollX)) + (Xspeed)) y: (((Y) - (ScrollY)) + (Yspeed))\n        change [x v] by (Xspeed)\n        change [y v] by (Yspeed)\n        change size by (10)\n        change [ghost v] effect by (5)\n    end\n    delete this clone\nend\n\nchange [color v] effect by (1)\n\nsay (Health)\n\nwhen I receive [next level v]\nwait (0) seconds\nif <[1] = [1]> then\n    set [enemycount v] to [0]\n    delete this clone\nend\nswitch costume to (hitbox v)\nif <(Level) = [0]> then\n    set [id v] to [1]\n    set [x v] to [615]\n    set [y v] to [-200]\n    create clone of (_myself_ v)\n    set [id v] to [0]\n    hide\nend\nif <(Level) = [1]> then\n    set [id v] to [2]\n    set [x v] to [-550]\n    set [y v] to [-200]\n    create clone of (_myself_ v)\n    set [x v] to [550]\n    set [y v] to [-200]\n    create clone of (_myself_ v)\n    set [id v] to [1]\n    set [x v] to [650]\n    set [y v] to [-200]\n    create clone of (_myself_ v)\n    set [id v] to [0]\n    hide\nend\n\nwait (1) seconds\n\nwhen flag clicked\nset [enemycount v] to [0]\n\n@Hitbox\n\nwhen flag clicked\nshow\n\nwhen I receive [tick v]\ngo to (fellah v)\nset [ghost v] effect to (100)\n\n@Intro\n\nwhen flag clicked\nset [level v] to [0]\nshow\ngo to x: (0) y: (0)\nset [id v] to [1]\nswitch costume to (demo v)\ncreate clone of (_myself_ v)\nset [id v] to [2]\nswitch costume to (logo v)\ncreate clone of (_myself_ v)\nset [id v] to [3]\nswitch costume to (click to continue v)\ncreate clone of (_myself_ v)\nswitch costume to (background v)\nset [id v] to [0]\n\nwhen I start as a clone\nif <(ID) = [3]> then\n    hide\nend\nif <(ID) = [2]> then\n    set size to (800) %\nelse\n    set size to (200) %\nend\ngo to x: (0) y: (210)\nchange [yspeed v] by (-40)\ngo to [front v] layer\nstart sound [Icon v]\nrepeat (40)\n    change y by (Yspeed)\n    set [yspeed v] to ((Yspeed) * (0.8))\nend\nif <(ID) = [1]> then\n    start sound [Demo v]\n    change [yspeed v] by (-5)\n    repeat (20)\n        change y by (Yspeed)\n        set [yspeed v] to ((Yspeed) * (0.8))\n    end\n    broadcast (Click to continue v)\nelse\n    change [yspeed v] by (5)\n    repeat (20)\n        change y by (Yspeed)\n        set [yspeed v] to ((Yspeed) * (0.8))\n    end\nend\n\nwhen I receive [transition v]\nif <(ID) < [4]> then\n    wait (1) seconds\n    hide\n    if <[1] = [1]> then\n        delete this clone\n    end\n    broadcast (Next Level v)\nend\nset [id v] to [4]\n\nwhen I receive [click to continue v]\nif <(ID) = [3]> then\n    go to x: (0) y: (-100)\n    show\n    set [ghost v] effect to (100)\n    repeat until <mouse down?>\n        repeat (20)\n            change [ghost v] effect by (-5)\n            if <mouse down?> then\n                broadcast (Transition v)\n                stop [this script v]\n            end\n        end\n    end\n    broadcast (Transition v)\nend\n\n@Screen\n\nwhen flag clicked\nswitch costume to (screen0 v)\nset [brightness v] effect to (0)\nset [ghost v] effect to (0)\nhide\nset [id v] to [1]\ncreate clone of (_myself_ v)\nset [id v] to [0]\nforever\n    go to x: (0) y: (0)\nend\n\nwhen I receive [next level v]\nif <(ID) = [1]> then\n    set [brightness v] effect to (0)\n    switch costume to (join [Screen] (Level))\n    if <(Level) = [2]> then\n        set [id v] to [2]\n        create clone of (_myself_ v)\n        set [id v] to [1]\n    end\n    set [brightness v] effect to (100)\n    show\n    repeat (10)\n        change [brightness v] effect by (-10)\n    end\n    wait (1) seconds\n    repeat (10)\n        change [brightness v] effect by (10)\n    end\n    repeat (20)\n        go to [front v] layer\n        change [ghost v] effect by (5)\n    end\n    hide\n    set [ghost v] effect to (0)\nend\n\nwhen I receive [transition v]\nif <(ID) = [1]> then\n    set [brightness v] effect to (100)\n    switch costume to (screen0 v)\n    show\n    set [ghost v] effect to (100)\n    repeat (20)\n        go to [front v] layer\n        change [ghost v] effect by (-5)\n    end\nend\n\nwhen I receive [playerhurt v]\nif <(ID) = [1]> then\n    set [brightness v] effect to (100)\n    switch costume to (screen0 v)\n    show\n    repeat (5)\n        go to [front v] layer\n        change [ghost v] effect by (20)\n    end\n    hide\n    set [ghost v] effect to (0)\nend\n\nwhen I start as a clone\nif <(ID) = [2]> then\n    switch costume to (coming soon :\) v)\nend\n\n@Thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\n@Sprite1\n\nwhen I receive [tick v]\nforever\n    go to [back v] layer\n    switch costume to (costume1 v)\n    if <(ID) = [0]> then\n        go to x: (((X) - (ScrollX)) * (0.2)) y: (((Y) - (ScrollY)) * (0.1))\n    else\n        go to x: (((X) - (ScrollX)) * (0.1)) y: (((Y) - (ScrollY)) * (0.8))\n    end\n    switch costume to (join [backdrop] (ID))\nend\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nif <(ID) = [0]> then\n    switch costume to (backdrop0 v)\n    set size to (200) %\n    set [y v] to (pick random (500) to (1000))\nend\nif <(ID) = [1]> then\n    switch costume to (costume2 v)\n    set size to (400) %\n    switch costume to (backdrop1 v)\nend\n\nwhen I receive [next level v]\nif <[1] = [1]> then\n    delete this clone\nend\nset rotation style [left-right v]\nshow\nset [id v] to (Level)\nif <(ID) = [0]> then\n    set [x v] to [-1500]\n    change [x v] by (pick random (1) to (1000))\n    point in direction (pick random (90) to (-90))\n    create clone of (_myself_ v)\n    change [x v] by (pick random (600) to (1500))\n    point in direction (pick random (90) to (-90))\n    create clone of (_myself_ v)\n    change [x v] by (pick random (600) to (1500))\n    point in direction (pick random (90) to (-90))\n    create clone of (_myself_ v)\n    set [id v] to [N/A]\nend\nif <(ID) = [1]> then\n    point in direction (90)\n    set [x v] to [0]\n    set [y v] to [50]\n    create clone of (_myself_ v)\nend\nhide\n\n@Death Triggers\n\nwhen I receive [tick v]\nforever\n    switch costume to (costume3 v)\n    go to x: ((X) - (ScrollX)) y: ((Y) - (ScrollY))\n    switch costume to (Costume)\nend\n\nwhen I receive [next level v]\nhide\nwait (0) seconds\nshow\nswitch costume to (costume2 v)\nset size to (400) %\nset [costume v] to (join [Death] (Level))\nswitch costume to (join [Death] (Level))\nset [x v] to [0]\nset [y v] to [0]\n\nwhen flag clicked\nhide\nwait (1) seconds\nshow\ngo to [back v] layer\nset [ghost v] effect to (100)\n\n@Bars\n\nwhen flag clicked\nswitch costume to (health v)\ngo to x: (0) y: (-110)\nset [id v] to [0]\ncreate clone of (_myself_ v)\nset [id v] to [1]\ncreate clone of (_myself_ v)\nset [id v] to [2]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(ID) = [1]> then\n    switch costume to (health2 v)\n    go [forward v] (3) layers\n    go to x: (0) y: (-110)\n    forever\n        if <(PlayerHealth) > [25]> then\n            switch costume to (health2 v)\n            change x by (((((64) * ((PlayerHealth) / (50))) - (64)) - (x position)) * (0.8))\n        else\n            switch costume to (health3 v)\n            change x by (((((64) * ((PlayerHealth) / (50))) - (32)) - (x position)) * (0.8))\n        end\n    end\nelse\n    if <(ID) = [2]> then\n        switch costume to (stamina2 v)\n        go [forward v] (1) layers\n        go to x: (0) y: (-130)\n        forever\n            if <(Stamina) > [25]> then\n                switch costume to (stamina2 v)\n                change x by (((((64) * ((Stamina) / (50))) - (64)) - (x position)) * (0.8))\n            else\n                switch costume to (stamina3 v)\n                change x by (((((64) * ((Stamina) / (50))) - (32)) - (x position)) * (0.8))\n            end\n        end\n    else\n        switch costume to (stamina v)\n        go to x: (0) y: (-130)\n    end\nend\n\n@Dash Orbs\n\nwhen flag clicked\nset [x v] to [0]\nset [y v] to [0]\nset [id v] to [0]\nhide\n\nwhen I receive [next level v]\nif <[1] = [1]> then\n    delete this clone\nend\nif <(ID) = [0]> then\n    set [id v] to [0]\n    Create [4] Clones\n    set [id v] to [0]\nend\n\ndefine Create (clones) Clones\nrepeat (clones)\n    change [id v] by (1)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\ngo to [back v] layer\ngo [forward v] (8) layers\nif <(Level) = [0]> then\n    switch costume to (dashorb1/3 v)\n    if <(ID) = [1]> then\n        set [x v] to [-120]\n        set [y v] to [-200]\n    end\n    if <(ID) = [2]> then\n        set [x v] to [220]\n        set [y v] to [-200]\n    end\n    if <(ID) = [3]> then\n        set [x v] to [400]\n        set [y v] to [-50]\n    end\n    if <(ID) = [4]> then\n        set [x v] to [750]\n        set [y v] to [-200]\n    end\n    forever\n        switch costume to (dashorb1/3 v)\n        wait (0.1) seconds\n        switch costume to (dashorb2/3 v)\n        wait (0.1) seconds\n        switch costume to (dashorb3/3 v)\n        wait (0.1) seconds\n        switch costume to (dashorb3/3 v)\n        wait (0.1) seconds\n        switch costume to (dashorb2/3 v)\n        wait (0.1) seconds\n        switch costume to (dashorb1/3 v)\n        wait (0.1) seconds\n    end\nend\nif <(Level) = [1]> then\n    switch costume to (dashorb1/3 v)\n    if <(ID) = [1]> then\n        set [x v] to [-560]\n        set [y v] to [-200]\n    end\n    if <(ID) = [2]> then\n        set [x v] to [-340]\n        set [y v] to [-80]\n    end\n    if <(ID) = [3]> then\n        set [x v] to [10]\n        set [y v] to [44]\n    end\n    if <(ID) = [4]> then\n        set [x v] to [820]\n        set [y v] to [-80]\n    end\n    forever\n        switch costume to (dashorb1/3 v)\n        wait (0.1) seconds\n        switch costume to (dashorb2/3 v)\n        wait (0.1) seconds\n        switch costume to (dashorb3/3 v)\n        wait (0.1) seconds\n        switch costume to (dashorb3/3 v)\n        wait (0.1) seconds\n        switch costume to (dashorb2/3 v)\n        wait (0.1) seconds\n        switch costume to (dashorb1/3 v)\n        wait (0.1) seconds\n    end\nend\n\nwhen I receive [tick v]\nforever\n    set [costume v] to (costume [number v])\n    switch costume to (costume1 v)\n    go to x: ((X) - (ScrollX)) y: ((Y) - (ScrollY))\n    switch costume to (Costume)\nend\n\nwhen I start as a clone\nforever\n    if <touching (hitbox v)?> then\n        change [stamina v] by (25)\n        if <(Stamina) > [50]> then\n            set [stamina v] to [50]\n        end\n        start sound [Collect v]\n        delete this clone\n    end\nend\n\n