Minecraft Platformer 2
@Stage\n\nwhen flag clicked\nset volume to (10) %\nforever\n    if <(MusicID) = [1]> then\n        play sound [8BIT LOFI HIPHOP | AMBIENT CHILL BEAT | NO COPYRIGHT MUSIC v] until done\n    end\n    if <(MusicID) = [2]> then\n        play sound [Comfy - Evan King v] until done\n    end\nend\n\nwhen I receive [stopmusic v]\nstop all sounds\nstop [other scripts in sprite v]\n\nwhen flag clicked\nforever\n    switch backdrop to (Level)\nend\n\nwhen I receive [death v]\nrepeat (10)\n    change [pitch v] effect by (-10)\n    change volume by (-1)\nend\nwait (0.3) seconds\nset [pitch v] effect to (0)\nrepeat (10)\n    change volume by (1)\nend\n\nbroadcast (Death v)\n\n@Blank\n\nchange [key v] by (1)\n\nchange [coins v] by (1)\n\nbroadcast (Death v)\n\nchange [crystal v] by (1)\n\nchange [coins v] by (30)\n\nwhen [r v] key pressed\nbroadcast (Death v) and wait\n\nwhen [1 v] key pressed\nbroadcast (StopMusic v) and wait\n\nwhen [2 v] key pressed\nshow variable [mapx v]\nshow variable [mapy v]\nshow variable [-attack.input v]\nshow variable [-down.input v]\nshow variable [-interact.input v]\nshow variable [-left.input v]\nshow variable [-right.input v]\nshow variable [-up.input v]\nwait until <not <key (2 v) pressed?>>\nhide variable [mapx v]\nhide variable [mapy v]\nhide variable [-attack.input v]\nhide variable [-down.input v]\nhide variable [-interact.input v]\nhide variable [-left.input v]\nhide variable [-right.input v]\nhide variable [-up.input v]\n\nwhen [3 v] key pressed\nset [_debug? v] to [1]\nbroadcast (DEBUG v)\n\nwhen flag clicked\nset [_debug? v] to [0]\n\n@Player\n\nwhen flag clicked\nwait (0) seconds\nset [camerax v] to [0]\nset [cameray v] to [-30]\nset [level v] to [1]\nshow\nset [mapx v] to (item ((Level) * (2)) of [mapspawns v])\nset [mapy v] to (item (((Level) * (2)) - (1)) of [mapspawns v])\nset [death? v] to [0]\nset rotation style [left-right v]\ngo to x: (0) y: (0)\nset size to (400) %\nset [playerxvel v] to [0]\nset [playeryvel v] to [0]\nset [playerslope v] to [0]\nforever\n    if <(Death?) = [0]> then\n        INPUT\n        Scroller\n    end\nend\n\ndefine Scroller\nswitch costume to (hitbox v)\nchange [playeryvel v] by (-2)\nif <(-RIGHT.INPUT) = [true]> then\n    change [playerxvel v] by (2)\n    point in direction (90)\nend\nif <(-LEFT.INPUT) = [true]> then\n    change [playerxvel v] by (-2)\n    point in direction (-90)\nend\nset [playerxvel v] to ((PlayerXVel) * (0.75))\nchange x by (PlayerXVel)\nset [playerslope v] to [0]\nrepeat until <<not <<touching (maphitbox v)?> or <touching (movingobjects v)?>>> or <(PlayerSlope) > [8]>>\n    change y by (1)\n    change [playerslope v] by (1)\nend\nif <(PlayerSlope) > [8]> then\n    change y by (() - (PlayerSlope))\n    change x by ((PlayerXVel) * (-1))\n    set [playerxvel v] to [0]\nend\nchange y by (PlayerYVel)\nset [playertouchingground? v] to [0]\nif <<touching (maphitbox v)?> or <touching (movingobjects v)?>> then\n    set [playertouchingground? v] to [1]\n    change y by ((PlayerYVel) * (-1))\n    set [playeryvel v] to [0]\nend\nchange y by (-5)\nif <<(-UP.INPUT) = [true]> and <<touching (maphitbox v)?> or <touching (movingobjects v)?>>> then\n    set [playeryvel v] to [18]\n    if <not <touching (mapclimbing v)?>> then\n        start sound [jump v]\n    end\nend\nif <touching (mapclimbing v)?> then\n    set [playeryvel v] to [0]\n    if <(-UP.INPUT) = [true]> then\n        change [playeryvel v] by (6)\n    end\nend\nchange y by (5)\nchange [mapx v] by ((x position) - (CameraX))\nchange [mapy v] by ((round (y position)) - (CameraY))\ngo to x: (CameraX) y: (CameraY)\nswitch costume to (playerstanding v)\nif <([abs v] of (PlayerXVel) ) > [1]> then\n    switch costume to (join [PlayerMoving] (AnimationFrame))\nend\nif <(PlayerYVel) > [2]> then\n    switch costume to (playerjumping v)\nend\nif <(PlayerYVel) < [-1]> then\n    switch costume to (playerfalling v)\nend\nif <touching (mapclimbing v)?> then\n    switch costume to (join [PlayerClimbing] (AnimationFrame))\nend\nif <(MapY) < [-700]> then\n    broadcast (Death v)\nend\nbroadcast (MapTick v)\n\nwhen flag clicked\nset [animationframe v] to [0]\nforever\n    if <<<(-LEFT.INPUT) = [true]> or <(-RIGHT.INPUT) = [true]>> and <([abs v] of (PlayerXVel) ) > [1]>> then\n        WalkAnimation\n    end\nend\n\ndefine INPUT\nif <(Dialogue?) = [0]> then\n    set [-right.input v] to <<key (right arrow v) pressed?> or <key (d v) pressed?>>\n    set [-left.input v] to <<key (left arrow v) pressed?> or <key (a v) pressed?>>\n    set [-up.input v] to <<key (up arrow v) pressed?> or <key (w v) pressed?>>\n    set [-down.input v] to <<key (down arrow v) pressed?> or <key (s v) pressed?>>\n    set [-attack.input v] to <<key (n v) pressed?> or <key (z v) pressed?>>\nend\nset [-interact.input v] to <<key (m v) pressed?> or <key (x v) pressed?>>\n\nwhen flag clicked\nforever\n    if <touching (mapclimbing v)?> then\n        if <(-UP.INPUT) = [true]> then\n            ClimbingAnimation\n        end\n    end\nend\n\nwhen I receive [pickupcoin v]\nset [dialogue? v] to [1]\nset [-down.input v] to [0]\nset [-up.input v] to [0]\nset [-right.input v] to [0]\nset [-left.input v] to [0]\nwait (0.8) seconds\nstart sound [Coin v]\nchange [coins v] by (1)\nrepeat (30)\n    switch costume to (playerstanding2 v)\nend\nset [dialogue? v] to [0]\n\nwhen I receive [pickupkey v]\nset [dialogue? v] to [1]\nset [-down.input v] to [0]\nset [-up.input v] to [0]\nset [-right.input v] to [0]\nset [-left.input v] to [0]\nwait (0.8) seconds\nstart sound [Key v]\nchange [key v] by (1)\nrepeat (30)\n    switch costume to (playerstanding2 v)\nend\nset [dialogue? v] to [0]\nbroadcast (StopDialogue v)\n\nwhen I receive [nextlevel v]\nset [dialogue? v] to [1]\nset [-down.input v] to [0]\nset [-up.input v] to [0]\nset [-right.input v] to [0]\nset [-left.input v] to [0]\nset [mapx v] to [280]\nwait (0.5) seconds\nset [dialogue? v] to [0]\nbroadcast (Fade v)\nwait (1) seconds\nchange [level v] by (1)\nset [mapx v] to (item (((Level) * (2)) - (1)) of [mapspawns v])\nset [mapy v] to (item ((Level) * (2)) of [mapspawns v])\n\nwhen flag clicked\nset [level v] to [1]\n\nchange [key v] by (1)\n\nchange [mapy v] by (1)\n\nwhen I receive [blobjump v]\nset [playeryvel v] to [18]\n\nwhen I receive [death v]\nstart sound [Death v]\nset [death? v] to [1]\nset [playerxvel v] to [0]\nset [playeryvel v] to [0]\nhide\nwait (1) seconds\nset [mapx v] to (item (((Level) * (2)) - (1)) of [mapspawns v])\nset [mapy v] to (item ((Level) * (2)) of [mapspawns v])\nset [playerxvel v] to [0]\nset [playeryvel v] to [0]\nshow\nset [death? v] to [0]\n\ndefine WalkAnimation\nset [pitch v] effect to (pick random (-20) to (20))\nset [animationframe v] to [1]\nwait (0.1) seconds\nif <(PlayerTouchingGround?) = [1]> then\n    start sound [Step v]\nend\nset [animationframe v] to [2]\nwait (0.1) seconds\nif <(PlayerTouchingGround?) = [1]> then\n    start sound [Step v]\nend\n\ndefine ClimbingAnimation\nset [animationframe v] to [1]\nwait (0.1) seconds\nset [animationframe v] to [2]\nwait (0.1) seconds\n\nwhen flag clicked\nset [mapx v] to (item (((Level) * (2)) - (1)) of [mapspawns v])\nset [mapy v] to (item ((Level) * (2)) of [mapspawns v])\n\nwhen I receive [pickup crystal v]\nset [dialogue? v] to [1]\nset [-down.input v] to [0]\nset [-up.input v] to [0]\nset [-right.input v] to [0]\nset [-left.input v] to [0]\nwait (0.8) seconds\nstart sound [Key v]\nchange [crystal v] by (1)\nrepeat (30)\n    switch costume to (playerstanding2 v)\nend\nset [dialogue? v] to [0]\nbroadcast (StopDialogue v)\n\nwhen flag clicked\nset [camerax v] to [0]\nset [cameray v] to [-30]\n\nwhen [space v] key pressed\n\nforever\n    set [camerax v] to (() - ((mouse x) / (4)))\n    set [cameray v] to (() - ((mouse y) / (4)))\nend\n\nwhen I receive [setcheckpoint v]\nreplace item (((Level) * (2)) - (1)) of [mapspawns v] with (MapX)\nreplace item ((Level) * (2)) of [mapspawns v] with (MapY)\n\nwhen flag clicked\ndelete all of [mapspawns v]\nadd [-70] to [mapspawns v]\nadd [-100] to [mapspawns v]\nadd [0] to [mapspawns v]\nadd [0] to [mapspawns v]\n\nwhen I receive [debug v]\nforever\n    say (join (join (round (PlayerXVel)) (join [:] (round (PlayerYVel)))) (join [   ] (join (round (MapX)) (join [:] (round (MapY))))))\nend\n\n@Knife\n\nwhen flag clicked\nhide\nset [knifex v] to [0]\nset [knifey v] to [0]\nforever\n    if <(-ATTACK.INPUT) = [1]> then\n        create clone of (_myself_ v)\n        wait until <(-ATTACK.INPUT) = [0]>\n        wait (0.2) seconds\n    end\nend\n\nwhen I start as a clone\nset [pitch v] effect to (pick random (-30) to (30))\nstart sound [dfdgfdfd v]\nset size to (25) %\nshow\nset [knifex v] to (MapX)\nset [knifey v] to ((MapY) - (20))\nset [knifedirection v] to (([direction v] of [player v]) / (90))\nwait (0) seconds\nrepeat until <touching (maphitbox v)?>\n    if <(KnifeDirection) = [1]> then\n        change [knifex v] by (8)\n        switch costume to (knife v)\n        turn right (20) degrees\n    else\n        switch costume to (knife2 v)\n        change [knifex v] by (-8)\n        turn left (20) degrees\n    end\n    if <touching (blobs v)?> then\n        repeat (3)\n            change [ghost v] effect by (34)\n            change size by (-5)\n        end\n        delete this clone\n    end\n    if <touching (_edge_ v)?> then\n        delete this clone\n    end\nend\nif <(KnifeDirection) = [1]> then\n    point in direction (180)\nelse\n    point in direction (0)\nend\nstart sound [rteerer v]\nwait (1) seconds\nrepeat (10)\n    change size by (-1)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I receive [maptick v]\ngo to x: (((() - (MapX)) + ((CameraX) / (5))) + (KnifeX)) y: (((() - (MapY)) + ((CameraY) / (5))) + (KnifeY))\n\nwhen I start as a clone\nforever\n    if <(_DEBUG?) = [1]> then\n        say (join (join (join (join (KnifeDirection) [:]) (round (KnifeX))) [:]) (round (KnifeY)))\n    end\nend\n\n@NPC\n\nwhen I receive [maptick v]\npoint towards (player v)\nset size to (1000) %\ngo to x: (((() - (MapX)) + ((CameraX) / (5))) + (NPCX)) y: (((() - (MapY)) + ((CameraY) / (5))) + (NPCY))\nset size to (400) %\n\nwhen I receive [dialogue v]\nset [dialogue? v] to [1]\nset [-right.input v] to [0]\nset [-down.input v] to [0]\nset [-left.input v] to [0]\nset [-up.input v] to [0]\n\nwhen flag clicked\nhide\n\nset [cloneid v] to [Robot]\ncreate clone of (_myself_ v)\nset [cloneid v] to [Magician]\ncreate clone of (_myself_ v)\nset [cloneid v] to [None]\n\nwhen I start as a clone\nif <(CloneID) = [Robot]> then\n    set [npcx v] to [250]\n    set [npcy v] to [80]\n    set [interacted? v] to [0]\n    set [dialogue? v] to [0]\n    show\n    switch costume to (npcnormal v)\n    forever\n        show\n        switch costume to (npchitbox v)\n        if <<touching (player v)?> and <<(Dialogue?) = [0]> and <(Interacted?) = [0]>>> then\n            set [brightness v] effect to (10)\n            set [caninteract? v] to [1]\n            switch costume to (npcnormal v)\n            if <(-INTERACT.INPUT) = [1]> then\n                set [interacted? v] to [1]\n                start sound [Talk v]\n                set [dialogueid v] to [Robot]\n                broadcast (Dialogue v)\n            end\n        else\n            switch costume to (npcnormal v)\n            set [brightness v] effect to (0)\n        end\n    end\nend\n\nwhen I receive [nextlevel v]\nwait (1.9) seconds\ndelete this clone\n\nwhen I start as a clone\nif <(CloneID) = [Magician]> then\n    set [npcx v] to [400]\n    set [npcy v] to [200]\n    set [interacted? v] to [0]\n    set [dialogue? v] to [0]\n    show\n    switch costume to (npcmagician v)\n    forever\n        show\n        switch costume to (npchitbox v)\n        if <<touching (player v)?> and <<(Dialogue?) = [0]> and <(Interacted?) = [0]>>> then\n            set [brightness v] effect to (10)\n            set [caninteract? v] to [1]\n            switch costume to (npcmagician v)\n            if <(-INTERACT.INPUT) = [1]> then\n                if <(Coins) > [0]> then\n                    set [interacted? v] to [1]\n                    start sound [Talk v]\n                    set [dialogueid v] to [Magician]\n                    broadcast (Dialogue v)\n                else\n                    start sound [Talk v]\n                    set [dialogueid v] to [Magician2]\n                    broadcast (Dialogue v)\n                end\n            end\n        else\n            switch costume to (npcmagician v)\n            set [brightness v] effect to (0)\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(_DEBUG?) = [1]> then\n        say (join (join (join (join (join (join (CloneID) [:]) (round (NPCX))) [:]) (round (NPCY))) [:]) (Interacted?))\n    end\nend\n\n@Blobs\n\nwhen flag clicked\nset [blobx v] to [0]\nset rotation style [left-right v]\nhide\nwait (0.1) seconds\nwait until <(PlayerTouchingGround?) = [1]>\npoint in direction (-90)\nforever\n    if <(Level) = [1]> then\n        set [blobx v] to [500]\n        set [bloby v] to [74]\n        create clone of (_myself_ v)\n        set [blobx v] to [530]\n        set [bloby v] to [74]\n        create clone of (_myself_ v)\n        set [blobx v] to [570]\n        set [bloby v] to [74]\n        create clone of (_myself_ v)\n        wait until <not <(Level) = [1]>>\n    end\nend\n\ndefine BlobDetect\nswitch costume to (blobwalldetecthitbox v)\nif <touching (maphitbox v)?> then\n    turn right (180) degrees\nend\nswitch costume to (blobfloordetecthitbox v)\nif <not <touching (maphitbox v)?>> then\n    turn right (180) degrees\nend\nif <not <touching (_edge_ v)?>> then\n    if <(direction) = [90]> then\n        change [blobx v] by (1)\n    else\n        change [blobx v] by (-1)\n    end\nend\nswitch costume to (join [BlobWalk] (BlobAnimationFrame))\nif <touching (player v)?> then\n    broadcast (Death v) and wait\nend\nif <touching (knife v)?> then\n    start sound [rteerer v]\n    repeat (3)\n        change size by (100)\n        change [ghost v] effect by (34)\n    end\n    delete this clone\nend\n\nwhen I receive [maptick v]\nset size to (1200) %\ngo to x: (((() - (MapX)) + ((CameraX) / (5))) + (BlobX)) y: (((() - (MapY)) + ((CameraY) / (5))) + (BlobY))\nset size to (400) %\n\nbroadcast (Death v)\n\nwhen I start as a clone\nshow\nforever\n    BlobDetect\nend\n\nwhen I start as a clone\nshow\nwait (pick random (0) to (0.20)) seconds\nforever\n    wait (0.3) seconds\n    set [blobanimationframe v] to [1]\n    wait (0.3) seconds\n    set [blobanimationframe v] to [2]\nend\n\nwhen I start as a clone\nforever\n    if <(_DEBUG?) = [1]> then\n        say (join (round (BlobX)) (join [:] (round (BlobY))))\n    end\nend\n\n@MapKillersm\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\nwhen I receive [maptick v]\ngo to x: ((() - (MapX)) + ((CameraX) / (5))) y: ((() - (MapY)) + ((CameraY) / (5)))\nif <touching (player v)?> then\n    broadcast (Death v)\nend\n\nwhen flag clicked\nforever\n    switch costume to (blank v)\n    set size to (800) %\n    switch costume to (Level)\nend\n\nset [key v] to [1]\n\nset size to (800) %\n\n@MapHitbox\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\nwhen I receive [maptick v]\ngo to x: ((() - (MapX)) + ((CameraX) / (5))) y: ((() - (MapY)) + ((CameraY) / (5)))\n\nwhen flag clicked\nforever\n    switch costume to (blank v)\n    set size to (800) %\n    switch costume to (Level)\nend\n\nset [key v] to [1]\n\nset size to (800) %\n\n@MapBG\n\nwhen flag clicked\nset [brightness v] effect to (-10)\nset [ghost v] effect to (10)\ngo to x: (0) y: (0)\ngo to [back v] layer\n\nwhen I receive [maptick v]\ngo to x: ((() - (MapX)) + ((CameraX) / (5))) y: ((() - (MapY)) + ((CameraY) / (5)))\n\nchange [mapy v] by (1)\n\nwhen flag clicked\nforever\n    switch costume to (blank v)\n    set size to (800) %\n    switch costume to (Level)\nend\n\n@MapFR\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\nwhen I receive [maptick v]\ngo to x: ((() - (MapX)) + ((CameraX) / (5))) y: ((() - (MapY)) + ((CameraY) / (5)))\n\nwhen flag clicked\nforever\n    switch costume to (blank v)\n    set size to (800) %\n    switch costume to (Level)\nend\n\n@MapClimbing\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\nwhen I receive [maptick v]\ngo to x: ((() - (MapX)) + ((CameraX) / (5))) y: ((() - (MapY)) + ((CameraY) / (5)))\nset size to (800) %\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@IneractableThings\n\nwhen I receive [maptick v]\nset size to (4000) %\ngo to x: (((() - (MapX)) + ((CameraX) / (5))) + (ObjectX)) y: (((() - (MapY)) + ((CameraY) / (5))) + (ObjectY))\nset size to (800) %\n\nwhen flag clicked\nhide\n\nset [cloneid v] to [Chest]\ncreate clone of (_myself_ v)\nset [cloneid v] to [CheckPoint]\ncreate clone of (_myself_ v)\nset [cloneid v] to [CheckPoint2]\ncreate clone of (_myself_ v)\nset [cloneid v] to [None]\n\nwhen I start as a clone\nwait (0.05) seconds\nif <(CloneID) = [Chest]> then\n    set [objectx v] to [200]\n    set [objecty v] to [76]\n    set [interacted? v] to [0]\n    show\n    switch costume to (hitbox v)\n    forever\n        switch costume to (hitbox v)\n        if <<<(Dialogue?) = [0]> and <touching (player v)?>> and <(Interacted?) = [0]>> then\n            set [caninteract? v] to [1]\n            if <(-INTERACT.INPUT) = [1]> then\n                broadcast (PickupCoin v)\n                set [interacted? v] to [1]\n                start sound [Talk v]\n            end\n        end\n        set [brightness v] effect to ((([cos v] of ((timer) * (100)) ) * (10)) + (10))\n        if <(Interacted?) = [1]> then\n            switch costume to (chestopened v)\n        else\n            switch costume to (chest v)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    set [caninteract? v] to [0]\nend\n\nwhen I start as a clone\nwait (0.05) seconds\nif <(CloneID) = [Warderobe]> then\n    set [interacted? v] to [0]\n    show\n    switch costume to (hitbox v)\n    forever\n        switch costume to (checkpointon v)\n        if <<<(Dialogue?) = [0]> and <touching (player v)?>> and <(Interacted?) = [0]>> then\n            set [caninteract? v] to [1]\n            if <(-INTERACT.INPUT) = [1]> then\n                broadcast (PickupCoin v)\n                set [interacted? v] to [1]\n                start sound [Talk v]\n            end\n        end\n        if <(Interacted?) = [1]> then\n            switch costume to (checkpointoff v)\n        else\n            switch costume to (checkpointon v)\n        end\n    end\nend\n\nwhen I start as a clone\nwait (0.05) seconds\nif <(CloneID) = [CheckPoint]> then\n    set [objectx v] to [240]\n    set [objecty v] to [-17]\n    set [interacted? v] to [0]\n    show\n    switch costume to (hitbox v)\n    forever\n        switch costume to (hitbox v)\n        if <<<(Dialogue?) = [0]> and <touching (player v)?>> and <(Interacted?) = [0]>> then\n            if <(Crystal) > [0]> then\n                set [caninteract? v] to [1]\n                if <(-INTERACT.INPUT) = [1]> then\n                    broadcast (SetCheckPoint v)\n                    set [interacted? v] to [1]\n                    start sound [Crystal v]\n                end\n            end\n        end\n        if <(Interacted?) = [1]> then\n            switch costume to (checkpointon v)\n        else\n            switch costume to (checkpointoff v)\n        end\n    end\nend\n\nwhen I receive [nextlevel v]\nwait (1.9) seconds\ndelete this clone\n\nwhen I receive [nextlevel v]\nwait (2.8) seconds\nif <(Level) = [2]> then\n    set [cloneid v] to [None]\nend\n\nwhen I start as a clone\nwait (0.05) seconds\nif <(CloneID) = [Door]> then\n    set [interacted? v] to [0]\n    show\n    switch costume to (doorhitbox v)\n    forever\n        switch costume to (doorhitbox v)\n        if <<<(Dialogue?) = [0]> and <touching (player v)?>> and <(Interacted?) = [0]>> then\n            if <(Key) = [1]> then\n                set [caninteract? v] to [1]\n                if <(-INTERACT.INPUT) = [1]> then\n                    start sound [closet-door-open-5 v]\n                    broadcast (NextLevel v)\n                    set [interacted? v] to [1]\n                    start sound [Talk v]\n                end\n            end\n        end\n        if <(Interacted?) = [1]> then\n            switch costume to (dooropened v)\n        else\n            switch costume to (door v)\n        end\n    end\nend\n\nset [-down.input v] to [0]\nset [-down.input v] to [0]\n\nset [cloneid v] to [Door]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nwait (0.05) seconds\nif <(CloneID) = [CheckPoint2]> then\n    set [objectx v] to [350]\n    set [objecty v] to [-17]\n    set [interacted? v] to [0]\n    show\n    switch costume to (hitbox v)\n    forever\n        switch costume to (hitbox v)\n        if <<<(Dialogue?) = [0]> and <touching (player v)?>> and <(Interacted?) = [0]>> then\n            if <(Crystal) > [0]> then\n                set [caninteract? v] to [1]\n                if <(-INTERACT.INPUT) = [1]> then\n                    broadcast (SetCheckPoint v)\n                    set [interacted? v] to [1]\n                    start sound [Crystal v]\n                end\n            end\n        end\n        if <(Interacted?) = [1]> then\n            switch costume to (checkpointon v)\n        else\n            switch costume to (checkpointoff v)\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(_DEBUG?) = [1]> then\n        say (join (join (CloneID) (join [:] (join (round (ObjectX)) (join [:] (round (ObjectY)))))) (join [   ] (Interacted?)))\n    end\nend\n\n@Dialogue\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [dialogue v]\nset [cloneid v] to [Box]\ncreate clone of (_myself_ v)\nset [cloneid v] to [None]\nwait (0.2) seconds\nif <(DialogueID) = [Robot]> then\n    Talk [WELCOME IN THE TEST ROOM!] [ROBOT:]\n    wait until <(-INTERACT.INPUT) = [1]>\n    start sound [Talk v]\n    Talk [THERE DEVELOPER TESTS THE GAME] [ROBOT:]\n    wait until <(-INTERACT.INPUT) = [1]>\n    start sound [Talk v]\n    broadcast (StopDialogue v)\nend\n\nwhen I start as a clone\nif <(CloneID) = [Box]> then\n    switch costume to (box v)\n    set size to (840) %\n    go to x: (0) y: (-130)\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    show\n    repeat (4)\n        change [ghost v] effect by (-25)\n    end\nend\n\ndefine Talk (text) (person)\nbroadcast (DeleteLetters v)\nhide\nswitch costume to (a v)\nset size to (80) %\ngo to x: (-215) y: (-110)\nset [letter v] to [0]\nset [cloneid v] to [Letter2]\nPerson (person)\nset [cloneid v] to [Letter]\nset [letter v] to [0]\nrepeat (length of (text))\n    change [letter v] by (1)\n    switch costume to (letter (Letter) of (text))\n    if <not <<(letter (Letter) of (text)) = [/]> or <<(letter (Letter) of (text)) = [*]> or <(letter (Letter) of (text)) = [ ]>>>> then\n        create clone of (_myself_ v)\n    end\n    change x by (8)\n    if <(letter (Letter) of (text)) = [*]> then\n        set x to (-215)\n        change y by (-12)\n    end\n    if <(letter (Letter) of (text)) = [/]> then\n        wait (0.2) seconds\n    end\nend\nset [cloneid v] to [None]\n\nwhen I start as a clone\nif <(CloneID) = [Letter]> then\n    set [pitch v] effect to (pick random (-5) to (5))\n    start sound (DialogueID)\n    go to [front v] layer\n    show\n    set [ghost v] effect to (100)\n    repeat (3)\n        change [ghost v] effect by (-34)\n    end\n    wait until <(-INTERACT.INPUT) = [1]>\nend\n\ndefine Person (person)\nset [brightness v] effect to (50)\nrepeat (length of (person))\n    change [letter v] by (1)\n    switch costume to (letter (Letter) of (person))\n    create clone of (_myself_ v)\n    change x by (8)\nend\nset [cloneid v] to [None]\nclear graphic effects\n\nwhen I start as a clone\nif <(CloneID) = [Letter2]> then\n    go to [front v] layer\n    show\n    set [ghost v] effect to (100)\n    repeat (4)\n        change [ghost v] effect by (-25)\n    end\n    wait until <(-INTERACT.INPUT) = [1]>\nend\n\nwhen I receive [deleteletters v]\nif <<(CloneID) = [Letter]> or <(CloneID) = [Letter2]>> then\n    delete this clone\nend\n\nwhen I receive [stopdialogue v]\nif <not <(CloneID) = [None]>> then\n    repeat (4)\n        change [ghost v] effect by (25)\n    end\n    set [dialogue? v] to [0]\n    delete this clone\nend\n\nrepeat (4)\n    change [ghost v] effect by (-25)\nend\nwait until <(-INTERACT.INPUT) = [1]>\n\nturn right (1) degrees\n\npoint in direction (90)\n\nwhen I receive [dialogue v]\nif <(DialogueID) = [Magician]> then\n    Talk [WELCOME...//] [???:]\n    wait until <(-INTERACT.INPUT) = [1]>\n    start sound [Talk v]\n    Talk [I HAVE SOMETHING FOR YOU] [???:]\n    wait until <(-INTERACT.INPUT) = [1]>\n    start sound [Talk v]\n    change [coins v] by (-1)\n    Talk [ITS LIFE CRYSTAL//*YOU CAN INTERACT WITH TOTEM*AND HAVE A CHECKPOINT] [???:]\n    wait until <(-INTERACT.INPUT) = [1]>\n    start sound [Talk v]\n    broadcast (Pickup Crystal v) and wait\n    broadcast (StopDialogue v)\nend\n\nwhen I receive [dialogue v]\nif <(DialogueID) = [Magician2]> then\n    Talk [YOU DONT HAVE MONEY? //BRUH] [???:]\n    wait until <(-INTERACT.INPUT) = [1]>\n    start sound [Talk v]\n    broadcast (StopDialogue v)\nend\n\n@Particles\n\nwhen flag clicked\nhide\nforever\n    if <<(PlayerTouchingGround?) = [1]> and <([abs v] of ([playerxvel v] of [player v]) ) > [2]>> then\n        set [cloneid v] to [RunningSmoke]\n        create clone of (_myself_ v)\n        wait (0.1) seconds\n    end\nend\n\nwhen I start as a clone\nif <(CloneID) = [RunningSmoke]> then\n    point in direction (pick random (-180) to (180))\n    set size to (pick random (290) to (310)) %\n    go to x: (0) y: (-45)\n    set [clonexposition v] to (MapX)\n    set [cloneyposition v] to ((MapY) - (35))\n    set [ghost v] effect to (40)\n    show\n    switch costume to (runningsmoke v)\n    repeat (10)\n        go to x: (((() - (MapX)) + ((CameraX) / (5))) + (CloneXPosition)) y: (((() - (MapY)) + ((CameraY) / (5))) + (CloneYPosition))\n        change [cloneyposition v] by (0.5)\n        change [ghost v] effect by (6)\n    end\n    delete this clone\nend\n\nwhen flag clicked\npoint in direction (90)\nforever\n    if <(CanInteract?) = [1]> then\n        set [cloneid v] to [Interact]\n        create clone of (_myself_ v)\n        wait until <(CanInteract?) = [0]>\n    end\nend\n\nwhen I start as a clone\nif <(CloneID) = [Interact]> then\n    switch costume to (? v)\n    go to (player v)\n    change y by (30)\n    set size to (400) %\n    set [ghost v] effect to (100)\n    show\n    repeat (4)\n        change [ghost v] effect by (-25)\n    end\n    wait until <(CanInteract?) = [0]>\n    repeat (4)\n        change size by (30)\n        change [ghost v] effect by (25)\n    end\n    delete this clone\nend\n\nwhen I receive [pickupcoin v]\nif <(CloneID) = [None]> then\n    set [cloneid v] to [Coin]\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nif <(CloneID) = [Coin]> then\n    go [forward v] (3) layers\n    wait (0.8) seconds\n    switch costume to (coin v)\n    go to (player v)\n    change y by (10)\n    set size to (400) %\n    show\n    repeat (25)\n        change size by (5)\n        change y by (1.5)\n        change [ghost v] effect by (4)\n    end\n    delete this clone\nend\n\nwhen flag clicked\nset [coins v] to [0]\n\nwhen flag clicked\nforever\n    set [cloneid v] to [None]\nend\n\nwhen I receive [pickupkey v]\nif <(CloneID) = [None]> then\n    set [cloneid v] to [Key]\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nset [key v] to [0]\n\nwhen I start as a clone\nif <(CloneID) = [Key]> then\n    go [forward v] (3) layers\n    wait (0.8) seconds\n    switch costume to (key v)\n    go to (player v)\n    change y by (10)\n    set size to (400) %\n    show\n    repeat (25)\n        change size by (5)\n        change y by (1.5)\n        change [ghost v] effect by (4)\n    end\n    delete this clone\nend\n\nwhen flag clicked\nforever\n    if <(Death?) = [1]> then\n        DeathParticles\n        wait until <(Death?) = [0]>\n    end\nend\n\nwhen I start as a clone\nif <(CloneID) = [Death1]> then\n    go to (player v)\n    switch costume to (death1 v)\n    set [clonedirvar v] to (pick random (-180) to (180))\n    set size to (pick random (300) to (340)) %\n    point in direction (CloneDirVar)\n    set [clonexposition v] to (pick random (1) to (3))\n    set [cloneyposition v] to (pick random (4) to (5))\n    wait (pick random (0) to (0.02)) seconds\n    show\n    repeat (pick random (29) to (31))\n        change [ghost v] effect by (4)\n        change y by (CloneYPosition)\n        change [cloneyposition v] by (-0.7)\n        if <(CloneDirVar) > [0]> then\n            change x by (CloneXPosition)\n            turn right (30) degrees\n        else\n            turn left (30) degrees\n            change x by (() - (CloneXPosition))\n        end\n        if <touching (maphitbox v)?> then\n            set [cloneyposition v] to ((() - (CloneYPosition)) / (pick random (1.5) to (2)))\n        end\n    end\n    delete this clone\nend\n\ndefine DeathParticles\nset [cloneid v] to [Death1]\nrepeat (10)\n    create clone of (_myself_ v)\nend\nset [cloneid v] to [Death2]\ncreate clone of (_myself_ v)\nset [cloneid v] to [ShakeScreen]\ncreate clone of (_myself_ v)\n\nbroadcast (Death v)\n\nwhen I start as a clone\nif <(CloneID) = [Death2]> then\n    point in direction (90)\n    switch costume to (death2 v)\n    go to (player v)\n    set size to (70) %\n    show\n    repeat (15)\n        point in direction (pick random (-180) to (180))\n        change size by (60)\n        change [ghost v] effect by (15)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(CloneID) = [ShakeScreen]> then\n    repeat (9)\n        set [mapx v] to ((MapX) - (CloneXPosition))\n        set [mapy v] to ((MapY) - (CloneYPosition))\n        set [clonexposition v] to (pick random (-6) to (6))\n        set [cloneyposition v] to (pick random (-6) to (6))\n        set [mapx v] to ((MapX) + (CloneXPosition))\n        set [mapy v] to ((MapY) + (CloneYPosition))\n        broadcast (MapTick v)\n    end\n    delete this clone\nend\n\nwhen I receive [pickup crystal v]\nif <(CloneID) = [None]> then\n    set [cloneid v] to [Crystal]\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nif <(CloneID) = [Crystal]> then\n    go [forward v] (3) layers\n    wait (0.8) seconds\n    switch costume to (crystal v)\n    go to (player v)\n    change y by (10)\n    set size to (400) %\n    show\n    repeat (25)\n        change size by (5)\n        change y by (1.5)\n        change [ghost v] effect by (4)\n    end\n    delete this clone\nend\n\nwhen flag clicked\nset [crystal v] to [0]\n\n@HUD\n\nwhen flag clicked\nhide\ngo to x: (-130) y: (150)\nset size to (400) %\nset [cloneid v] to [Coin]\ncreate clone of (_myself_ v)\nset [cloneid v] to [Key]\ncreate clone of (_myself_ v)\nset [cloneid v] to [Crystal]\ncreate clone of (_myself_ v)\nset [cloneid v] to [None]\nforever\n    Coins (Coins)\nend\n\nwhen I start as a clone\nif <(CloneID) = [Coin]> then\n    go to [front v] layer\n    switch costume to (coin v)\n    show\n    go to x: (-210) y: (148)\nend\n\nwhen I start as a clone\nif <(CloneID) = [Key]> then\n    go to [front v] layer\n    switch costume to (key v)\n    go to x: (-205) y: (125)\n    set size to (500) %\n    forever\n        if <(Key) = [1]> then\n            show\n            wait until <(Key) = [0]>\n        else\n            hide\n            wait until <(Key) = [1]>\n        end\n    end\nend\n\ndefine Coins (text)\ngo to x: (-190) y: (146)\nbroadcast (DeleteNumbers v)\nset [letter v] to [0]\nset [cloneid v] to [Letter]\nrepeat (length of (text))\n    change [letter v] by (1)\n    switch costume to (letter (Letter) of (text))\n    create clone of (_myself_ v)\n    change x by (10)\nend\nset [cloneid v] to [None]\n\nwhen I receive [deletenumbers v]\nif <(CloneID) = [Letter]> then\n    delete this clone\nend\n\nwhen I start as a clone\nif <(CloneID) = [Letter]> then\n    show\nend\n\nwhen I start as a clone\nif <(CloneID) = [Crystal]> then\n    go to [front v] layer\n    switch costume to (crystal v)\n    go to x: (-210) y: (-148)\n    set size to (500) %\n    forever\n        if <(Crystal) = [1]> then\n            show\n            wait until <(Crystal) = [0]>\n        else\n            hide\n            wait until <(Crystal) = [1]>\n        end\n    end\nend\n\n@Border\n\nwhen flag clicked\nswitch costume to (border v)\ngo to x: (0) y: (0)\ngo to [front v] layer\n\nwait (0) seconds\n\nbroadcast (Death v)\n\n@Fade\n\nwhen I receive [fade v]\ngo to x: (0) y: (0)\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (1) seconds\nset [musicid v] to [2]\nbroadcast (StopMusic v)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nhide\nwait (0.4) seconds\ngo to [front v] layer\n\nstop [all v]\n\nwhen flag clicked\nset [musicid v] to [1]\n\nwhen I receive [death v]\nset [brightness v] effect to (100)\nset [ghost v] effect to (50)\nshow\nrepeat (20)\n    change [ghost v] effect by (3)\nend\nclear graphic effects\nhide\n\n@Thumbnail\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\ngo to [front v] layer\nwait (0.1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nset [ghost v] effect to (100)\n\nhide\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\ngo to [front v] layer\n\n@Assets\n\nwhen flag clicked\nhide\n\n@MovingObjects\n\nwhen I receive [maptick v]\nset size to (4000) %\ngo to x: (((() - (MapX)) + ((CameraX) / (5))) + (ObjectX)) y: (((() - (MapY)) + ((CameraY) / (5))) + (ObjectY))\nset size to (800) %\n\nwhen flag clicked\nhide\nset [cloneid v] to [1]\ncreate clone of (_myself_ v)\nset [cloneid v] to [2]\ncreate clone of (_myself_ v)\nset [cloneid v] to [None]\n\nwhen I start as a clone\nif <(CloneID) = [1]> then\n    set [objectx v] to [510]\n    set [objecty v] to [-48]\n    show\n    forever\n        repeat until <(ObjectX) > [639]>\n            change [objectx v] by (2)\n            switch costume to (platform2 v)\n            if <touching (player v)?> then\n                change [mapx v] by (2)\n            end\n            switch costume to (platform v)\n        end\n        repeat until <(ObjectX) < [509]>\n            change [objectx v] by (-2)\n            switch costume to (platform2 v)\n            if <touching (player v)?> then\n                change [mapx v] by (-2)\n            end\n            switch costume to (platform v)\n        end\n    end\nend\n\nwhen I start as a clone\nif <(CloneID) = [2]> then\n    set [objectx v] to [765]\n    set [objecty v] to [-48]\n    show\n    switch costume to (platform v)\n    forever\n        repeat until <(ObjectY) > [100]>\n            change [objecty v] by (2)\n        end\n        repeat until <(ObjectY) < [-47]>\n            change [objecty v] by (-2)\n            switch costume to (platform v)\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(_DEBUG?) = [1]> then\n        say (join (round (ObjectX)) (join [:] (round (ObjectY))))\n    end\nend\n\n
                             INSTRUCTIONS\n[ WADS Keys ] - Move left right or up.\n[ Collect Coins ] - You get a new high score !\n[ Take a checkpoint ] - You can respawn there ! \n[ Jump on an Enemy's Head ] - You can defeat it !\n[ Collect Keys ] - You can open locked doors !\n[ Stand on Moving Platforms ] - You can auto move !\n[ Run through a squasher ] - Avoid getting squash !\n[ Jump through some platforms ] - it will help you beat the scene !\n[ Get to Scene 24 ] - Beat the Game !\n\n[ Get boosts ] - Buy things from the shop.\n\n[ Play Part 2 ] - It continues...\n\n                                   ENJOY !