Magic Lands | A Platformer #games #all

Instructions: Welcome to the magic lands! collect the potion in each level to move on to the next. Beware, as you progress through the levels, they get harder and harder.

@Stage\n\nwhen flag clicked\nforever\n    switch backdrop to (LEVEL)\nend\n\nwhen flag clicked\nforever\n    if <(Music) = [1]> then\n        play sound [Final Exploration - PaulRHJT v] until done\n    end\nend\n\n@INSTRUCTIONS (delete)\n\n@Player\n\nwhen I start as a clone\nrepeat (30)\n    change [ghost v] effect by (2.4)\nend\ndelete this clone\n\nwhen flag clicked\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\nwhen I receive [play game v]\nset [level v] to [1]\nforever\n    broadcast (Setup v) and wait\n    setup\n    repeat until <(EXIT) > []>\n        loop\n        broadcast (Loop v) and wait\n    end\n    if <(EXIT) = [next]> then\n        change [level v] by (1)\n        hide\n        broadcast (NEXT LEVEL v) and wait\n    end\n    if <(EXIT) = [skip]> then\n        hide\n        broadcast (NEXT LEVEL v) and wait\n    end\n    set [exit v] to []\nend\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\ndefine setup\nset [in air2 v] to [0]\nset [x v2 v] to [0]\nset [y v v] to [0]\ngo to x: (-111) y: (-139)\nshow\n\ndefine loop\nif <<not <<(TrussUp) = [1]> or <(TrussDown) = [1]>>> and <<key (left arrow v) pressed?> or <<<mouse down?> and <(mouse x) < (Player X)>> or <key (a v) pressed?>>>> then\n    change [x v2 v] by (-1)\nend\nif <<not <<(TrussUp) = [1]> or <(TrussDown) = [1]>>> and <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > (Player X)>>>>> then\n    change [x v2 v] by (1)\nend\nset [x v2 v] to ((x v2) * (0.8))\nif <([abs v] of (x v2) ) > [0.9]> then\n    change player x by (round (x v2))\nend\nif <<not <<touching (climbable v)?> or <touching (truss on v)?>>> and <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <((mouse y) - (30)) > [0]>>>>> then\n    if <(in air2) < [4]> then\n        set [y v v] to [10]\n    end\nend\nchange [y v v] by (-2)\nchange player y by (y v)\nif <(y position) > [179]> then\n    set [exit v] to [next]\nend\nif <(y position) < [-179]> then\n    set [exit v] to [die]\n    set [died v] to [1]\n    broadcast (ae v)\nend\nif <<touching (spikes v)?> or <touching (moving spikes v)?>> then\n    if <(Potion 2 Created) = [0]> then\n        set [exit v] to [die]\n        set [level v] to [1]\n    end\nend\nif <touching (spring v)?> then\n    if <([costume # v] of [spring v]) = [1]> then\n        set [y v v] to [27]\n    else\n        if <([costume # v] of [spring v]) = [2]> then\n            set [y v v] to [-8]\n        else\n            set [x v2 v] to [-27]\n        end\n    end\nend\n\ndefine change player y by (y v)\nif <not <<touching (climbable v)?> or <touching (truss on v)?>>> then\n    change y by (y v)\n    change [in air2 v] by (1)\n    repeat until <not <<touching (moving platforms v)?> or <<touching (on v)?> or <<touching (platform v)?> or <<touching (truss v)?> or <<<touching (conveyor right v)?> or <touching (conveyor left v)?>> or <<touching (conveyor left strong v)?> or <<touching (keydoor v)?> or <<touching (barrier v)?> or <touching (conveyor right strong v)?>>>>>>>>>>\n        if <(y v) > [0]> then\n            change y by (-1)\n        else\n            change y by (1)\n            set [in air2 v] to [0]\n        end\n        set [y v v] to [0]\n    end\nend\n\nwhen I receive [reset v]\nsetup\n\nhide\n\nwhen flag clicked\nforever\n    if <<touching (climbable v)?> or <touching (truss on v)?>> then\n        set [in air2 v] to [0]\n    end\nend\n\nwhen flag clicked\nforever\n    if <<touching (climbable v)?> or <touching (truss on v)?>> then\n        if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <(TrussUp) = [1]>>> then\n            change y by (5)\n        else\n            if <<key (down arrow v) pressed?> or <<key (s v) pressed?> or <(TrussDown) = [1]>>> then\n                change y by (-5)\n            end\n        end\n    end\nend\n\nrepeat (10)\n\nchange y by (10)\n\nwhen flag clicked\nforever\n    if <(y v) < [-20]> then\n        set [y v v] to [-20]\n    end\nend\n\nwhen flag clicked\nforever\n    if <<touching (climbable v)?> or <touching (truss on v)?>> then\n        set [y v v] to [-5]\n        set [touchingclimbable v] to [1]\n    else\n        set [touchingclimbable v] to [0]\n    end\nend\n\n\n\nwhen flag clicked\nforever\n    change y by (-1)\n    if <touching (conveyor left v)?> then\n        change x by (-5)\n    else\n        if <touching (conveyor right v)?> then\n            change x by (5)\n        else\n            if <touching (conveyor left strong v)?> then\n                change x by (-10)\n            else\n                if <touching (conveyor right strong v)?> then\n                    change x by (10)\n                end\n            end\n        end\n    end\n    change y by (1)\nend\n\n\n\nwhen flag clicked\nforever\n    if <touching (bouncepad v)?> then\n        set [y v v] to [15]\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (teleport v)?> then\n        repeat (10)\n            go to (teleport exit v)\n        end\n    end\nend\n\nwhen flag clicked\nswitch costume to (costume4 v)\nforever\n    wait until <not <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <mouse down?>>>>\n    wait until <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <mouse down?>>>\n    if <touching (orbs v)?> then\n        start sound [Jump v]\n        set [y v v] to [15]\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        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    end\nend\n\nwait until <touching (orbs v)?>\n\n\n\nset [y v v] to [15]\nwait (0.2) seconds\n\nwhen flag clicked\nforever\n    if <touching (cannon v)?> then\n        broadcast (check if zip v)\n    end\nend\n\nwhen I receive [confirm v]\nset [x v2 v] to [20]\n\ndefine change player x by (x v)\nchange x by (x v)\nif <<touching (moving platforms v)?> or <<touching (on v)?> or <<touching (platform v)?> or <<touching (truss v)?> or <<<touching (conveyor right v)?> or <touching (conveyor left v)?>> or <<touching (conveyor left strong v)?> or <<touching (keydoor v)?> or <<touching (barrier v)?> or <touching (conveyor right strong v)?>>>>>>>>> then\n    repeat (10)\n        change y by (1)\n        if <not <<touching (moving platforms v)?> or <<touching (on v)?> or <<touching (platform v)?> or <<touching (truss v)?> or <<<touching (conveyor right v)?> or <touching (conveyor left v)?>> or <<touching (conveyor left strong v)?> or <<touching (keydoor v)?> or <<touching (barrier v)?> or <touching (conveyor right strong v)?>>>>>>>>>> then\n            stop [this script v]\n        end\n    end\n    change y by (-10)\n    if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <<<touching (truss on v)?> or <touching (platform v)?>> or <<<touching (conveyor right v)?> or <touching (conveyor left v)?>> or <<touching (conveyor left strong v)?> or <<touching (barrier v)?> or <<touching (bap invert v)?> or <touching (conveyor right strong v)?>>>>>>>>> then\n    repeat until <not <<touching (moving platforms v)?> or <<touching (on v)?> or <<touching (platform v)?> or <<<touching (conveyor right v)?> or <touching (conveyor left v)?>> or <<touching (conveyor left strong v)?> or <<touching (keydoor v)?> or <<touching (barrier v)?> or <touching (conveyor right strong v)?>>>>>>>>>\n        if <(x v) > [0]> then\n            change x by (-1)\n        else\n            change x by (1)\n        end\n    end\nend\n\nwhen I start as a clone\nset [ghost v] effect to (0)\nswitch costume to (costume2 v)\npoint in direction (pick random (360) to (0))\nforever\n    move (1) steps\nend\n\nwhen flag clicked\nswitch costume to (costume4 v)\nforever\n    wait until <touching (orbs inactive v)?>\n    wait until <not <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <mouse down?>>>>\n    wait until <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <mouse down?>>>\n    if <<touching (orbs inactive v)?> and <(Orb Active) = [1]>> then\n        start sound [Jump v]\n        set [y v v] to [15]\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        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    end\nend\n\nwhen flag clicked\nset [died v] to [0]\n\nwhen I receive [ae v]\nwait (0.1) seconds\nset [died v] to [0]\n\nwhen flag clicked\nforever\n    set [player x v] to (x position)\nend\n\n@Timer\n\nwhen I receive [reset v]\nset [seconds v] to [0]\nset [minutes v] to [0]\n\nwhen flag clicked\nshow variable [seconds v]\n\nwhen flag clicked\nif < (LEVEL) contains [Win]?> then\n    broadcast (Win v)\nelse\n    repeat until < (backdrop [name v]) contains [Win]?>\n        wait (1) seconds\n        change [seconds v] by (1)\n    end\nend\n\nwhen flag clicked\nset [seconds v] to [0]\n\n@Platform\n\nwhen flag clicked\nforever\n    switch costume to (LEVEL)\nend\n\nset [level v] to [4]\n\nwhen flag clicked\nrepeat (10)\n    go to [front v] layer\nend\n\n@Moving Platforms\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    glide (1) secs to x: (1) y: (74)\n    wait (1) seconds\n    glide (1) secs to x: (0) y: (0)\n    wait (1) seconds\nend\n\n@Climbable\n\nwhen flag clicked\nset [ghost v] effect to (0)\n\nset [ghost v] effect to (0)\n\nwhen flag clicked\ngo to [front v] layer\nforever\n    switch costume to (LEVEL)\nend\n\n@TrussButton1\n\nwhen flag clicked\ngo to x: (-218) y: (-136)\nforever\n    if <(TouchingClimbable) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <<mouse down?> and <touching (mouse-pointer v)?>> then\n        set [trussup v] to [1]\n    else\n        set [trussup v] to [0]\n    end\nend\n\n@TrussButton2\n\nwhen flag clicked\ngo to x: (-171) y: (-136)\nforever\n    if <(TouchingClimbable) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <<mouse down?> and <touching (mouse-pointer v)?>> then\n        set [trussdown v] to [1]\n    else\n        set [trussdown v] to [0]\n    end\nend\n\n@Conveyor Left\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\nend\n\nif <(LEVEL) = [1]> then\n    show\nelse\n    hide\nend\n\n@Conveyor Right Strong\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\nend\n\nif <(LEVEL) = [1]> then\n    show\nelse\n    hide\nend\n\n@Orbs\n\nwhen flag clicked\nforever\n    switch costume to (LEVEL)\nend\n\nset [level v] to [4]\n\n@Barrier\n\nwhen flag clicked\nset [potion1 v] to [0]\nforever\n    if <(LEVEL) = [1]> then\n        switch costume to (costume1 v)\n        if <(Potion1) = [1]> then\n            hide\n        else\n            show\n        end\n    else\n        if <(LEVEL) = [2]> then\n            switch costume to (costume2 v)\n            if <(Potion2) = [1]> then\n                hide\n            else\n                show\n            end\n        else\n            if <(LEVEL) = [3]> then\n                switch costume to (costume3 v)\n                if <(Potion3) = [1]> then\n                    hide\n                else\n                    show\n                end\n            else\n                if <(LEVEL) = [4]> then\n                    switch costume to (costume4 v)\n                    if <(Potion4) = [1]> then\n                        hide\n                    else\n                        show\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nset [potion3 v] to [0]\n\n@Potion1\n\nwhen I start as a clone\nrepeat (30)\n    change [ghost v] effect by (2.4)\nend\ndelete this clone\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nshow\nwait (1) seconds\nforever\n    if <(LEVEL) = [1]> then\n        switch costume to (costume1 v)\n        wait until <touching (player v)?>\n        start sound [Magic Spell 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        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        create clone of (_myself_ v)\n        hide\n        set [potion1 v] to [1]\n        stop [this script v]\n    else\n    end\nend\n\nif <(LEVEL) = [2]> then\n    show\n    switch costume to (costume3 v)\n    wait until <touching (player v)?>\n    start sound [Magic Spell 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    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    create clone of (_myself_ v)\n    hide\n    set [potion2 v] to [1]\n    wait until <(LEVEL) = [3]>\nelse\n    if <(LEVEL) = [3]> then\n        show\n        switch costume to (costume4 v)\n        wait until <touching (player v)?>\n        start sound [Magic Spell 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        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        create clone of (_myself_ v)\n        hide\n        set [potion2 v] to [1]\n        wait until <(LEVEL) = [4]>\n    end\nend\n\nwhen I start as a clone\nset size to (75) %\nswitch costume to (costume2 v)\npoint in direction (pick random (360) to (0))\nset [ghost v] effect to (0)\nshow\nif <(LEVEL) = [1]> then\n    go to x: (221) y: (36)\nend\nif <(LEVEL) = [2]> then\n    go to x: (102) y: (103)\nend\nforever\n    move (1) steps\nend\n\nset [died v] to [0]\n\n@Potion Menu\n\nwhen flag clicked\nswitch costume to (costume1 v)\nset [potion menu v] to [0]\nforever\n    go to [front v] layer\n    go [backward v] (6) layers\nend\n\nwhen this sprite clicked\nif <(costume [number v]) = [1]> then\n    set [potion menu v] to [1]\n    switch costume to (costume2 v)\nelse\n    set [potion menu v] to [0]\n    switch costume to (costume1 v)\nend\n\n@R1\n\nwhen flag clicked\nset [potion 1 created? v] to [0]\nset [potion2 v] to [0]\nforever\n    go to [front v] layer\n    go [backward v] (5) layers\n    if <(Potion Menu) = [1]> then\n        show\n    else\n        hide\n    end\n    if <(Potion 1 Created?) = [0]> then\n        if <<(Potion1) = [1]> and <(Potion2) = [1]>> then\n            switch costume to (costume2 v)\n        else\n            switch costume to (costume1 v)\n        end\n    else\n        switch costume to (costume3 v)\n    end\nend\n\nwhen this sprite clicked\nif <(costume [number v]) = [2]> then\n    broadcast (Make Potion 1 v)\nend\n\n@Sprite1\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\nforever\n    go to [front v] layer\n    go [backward v] (3) layers\nend\n\nwhen I receive [make potion 1 v]\nswitch costume to (costume1 v)\nshow\nwait (1) seconds\nbroadcast (combine 1 v)\n\nwhen I receive [potion name v]\nswitch costume to (costume2 v)\nwait (3) seconds\nhide\nbroadcast (e v)\nset [potion 1 created? v] to [1]\n\nwhen I receive [make potion 2 v]\nswitch costume to (costume1 v)\nshow\nwait (1) seconds\nbroadcast (combine 2 v)\n\nwhen I receive [potion name 2 v]\nswitch costume to (costume3 v)\nwait (3) seconds\nhide\nbroadcast (e v)\nset [potion 2 created v] to [1]\n\nwhen flag clicked\nset [potion 2 created v] to [0]\n\n@P1\n\nwhen I receive [combine 1 v]\nswitch costume to (costume1 v)\ngo to x: (-260) y: (0)\nshow\nrepeat (13)\n    move (20) steps\nend\nhide\n\nwhen flag clicked\nclear graphic effects\nhide\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go [backward v] (1) layers\nend\n\nwhen I receive [e v]\nhide\n\nwhen I receive [combine 2 v]\nswitch costume to (costume2 v)\ngo to x: (-260) y: (0)\nshow\nrepeat (13)\n    move (20) steps\nend\nhide\n\n@P2\n\nwhen I start as a clone\nrepeat (30)\n    change [ghost v] effect by (3.333)\nend\ndelete this clone\n\nwhen I receive [combine 1 v]\nswitch costume to (costume1 v)\ngo to x: (260) y: (0)\nshow\nrepeat (13)\n    move (-20) steps\nend\nswitch costume to (costume2 v)\nstart sound [Magic Spell v]\nrepeat (4)\n    create clone of (_myself_ v)\n    create clone of (_myself_ v)\n    create clone of (_myself_ v)\n    create clone of (_myself_ v)\nend\nwait (2) seconds\nbroadcast (Potion Name v)\n\nwhen flag clicked\nclear graphic effects\nswitch costume to (costume1 v)\nhide\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (0)\nif <(costume [number v]) = [2]> then\n    switch costume to (costume3 v)\nelse\n    switch costume to (costume6 v)\nend\npoint in direction (pick random (360) to (0))\nforever\n    move (4) steps\nend\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    go [backward v] (1) layers\nend\n\nwhen I receive [e v]\nhide\n\nwhen I receive [combine 2 v]\nswitch costume to (costume4 v)\ngo to x: (260) y: (0)\nshow\nrepeat (13)\n    move (-20) steps\nend\nswitch costume to (costume5 v)\nstart sound [Magic Spell v]\nrepeat (4)\n    create clone of (_myself_ v)\n    create clone of (_myself_ v)\n    create clone of (_myself_ v)\n    create clone of (_myself_ v)\nend\nwait (2) seconds\nbroadcast (Potion Name 2 v)\n\n@Orbs Inactive\n\nwhen flag clicked\nset [orb active v] to [0]\nforever\n    if <(LEVEL) = [3]> then\n        if <(Orb Active) = [1]> then\n            switch costume to (floor 3 2 v)\n        else\n            switch costume to (floor 3 1 v)\n        end\n    else\n        switch costume to (none v)\n    end\nend\n\nwhen this sprite clicked\nif <(Potion 1 Created?) = [1]> then\n    set [orb active v] to [1]\nend\n\n@Potion2\n\nwhen I start as a clone\nrepeat (30)\n    change [ghost v] effect by (2.4)\nend\ndelete this clone\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nhide\nwait (1) seconds\nforever\n    if <(LEVEL) = [2]> then\n        show\n        switch costume to (costume3 v)\n        if <touching (player v)?> then\n            start sound [Magic Spell 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            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            create clone of (_myself_ v)\n            hide\n            set [potion2 v] to [1]\n            stop [this script v]\n        end\n    else\n        hide\n    end\nend\n\nwhen I start as a clone\nset size to (75) %\nswitch costume to (costume2 v)\npoint in direction (pick random (360) to (0))\nset [ghost v] effect to (0)\nshow\nif <(LEVEL) = [1]> then\n    go to x: (221) y: (36)\nend\nif <(LEVEL) = [2]> then\n    go to x: (102) y: (103)\nend\nforever\n    move (1) steps\nend\n\nshow\n\n@Potion3\n\nwhen I start as a clone\nrepeat (30)\n    change [ghost v] effect by (2.4)\nend\ndelete this clone\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nhide\nwait (1) seconds\nforever\n    if <(LEVEL) = [3]> then\n        show\n        switch costume to (costume4 v)\n        if <touching (player v)?> then\n            start sound [Magic Spell 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            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            create clone of (_myself_ v)\n            hide\n            set [potion3 v] to [1]\n            stop [this script v]\n        end\n    else\n        hide\n    end\nend\n\nshow\n\nwhen I start as a clone\nset size to (75) %\nswitch costume to (costume2 v)\npoint in direction (pick random (360) to (0))\nset [ghost v] effect to (0)\nshow\nif <(LEVEL) = [1]> then\n    go to x: (221) y: (36)\nend\nif <(LEVEL) = [2]> then\n    go to x: (102) y: (103)\nend\nif <(LEVEL) = [3]> then\n    go to x: (224) y: (48)\nend\nforever\n    move (1) steps\nend\n\n@Potion4\n\nwhen I start as a clone\nrepeat (30)\n    change [ghost v] effect by (2.4)\nend\ndelete this clone\n\nwhen flag clicked\nset [potion4 v] to [0]\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nhide\nwait (1) seconds\nforever\n    if <(LEVEL) = [4]> then\n        show\n        switch costume to (costume4 v)\n        if <touching (player v)?> then\n            start sound [Magic Spell 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            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            create clone of (_myself_ v)\n            hide\n            set [potion4 v] to [1]\n            stop [this script v]\n        end\n    else\n        hide\n    end\nend\n\nshow\n\nwhen I start as a clone\nset size to (75) %\nswitch costume to (costume2 v)\npoint in direction (pick random (360) to (0))\nset [ghost v] effect to (0)\nshow\nif <(LEVEL) = [1]> then\n    go to x: (221) y: (36)\nend\nif <(LEVEL) = [2]> then\n    go to x: (102) y: (103)\nend\nif <(LEVEL) = [4]> then\n    go to x: (123) y: (-88)\nend\nforever\n    move (1) steps\nend\n\n@Spikes\n\nwhen flag clicked\nforever\n    if <(LEVEL) = [5]> then\n        show\n    else\n        hide\n    end\nend\n\n@R2\n\nwhen flag clicked\nset [potion 2 created v] to [0]\nforever\n    go to [front v] layer\n    go [backward v] (4) layers\n    if <(Potion Menu) = [1]> then\n        show\n    else\n        hide\n    end\n    if <(Potion 2 Created) = [0]> then\n        if <<(Potion3) = [1]> and <(Potion4) = [1]>> then\n            switch costume to (costume2 v)\n        else\n            switch costume to (costume1 v)\n        end\n    else\n        switch costume to (costume3 v)\n    end\nend\n\nwhen this sprite clicked\nif <(costume [number v]) = [2]> then\n    broadcast (Make Potion 2 v)\nend\n\n@Golden Potion\n\nwhen I start as a clone\nrepeat (30)\n    change [ghost v] effect by (2.4)\nend\ndelete this clone\n\nwhen flag clicked\nset [potion4 v] to [0]\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nhide\nwait (1) seconds\nforever\n    if <(LEVEL) = [5]> then\n        show\n        switch costume to (costume4 v)\n        if <touching (player v)?> then\n            broadcast (End Game v)\n            stop [this script v]\n        end\n    else\n        hide\n    end\nend\n\nstart sound [Magic Spell v]\n\nshow\n\n@Thumbnail\n\nwhen flag clicked\nset [music v] to [1]\nhide\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen I receive [end game v]\nswitch costume to (costume1 v)\nset [music v] to [0]\nstop all sounds\nstart sound [Win v]\nshow\n\n