Maze || A Platformer

Instructions: Hi ! Welcome to Maze...\nFind the exit!\nBut watch out for the trap!\nGood luck...\n\nFollow @Matji\nLove and fave this project for part 2 !\nAmazing intro by @kodiak77-77 !\n\n\n\n\n\n\n\n\n\n\n5 level 100 % possible but level is very hard\n\n\nNo skip level because they are just 5 levels\n\n\nPlayer disign by @ je ne me rappelle plus le nom xD, si vous le savez dites le moi\nRest by me !\n\n\n\n\n\n\n\n\n\n\n\n\n#fun #cool #matji #maze #platformer #a #game #games\n\n\n\n\n\n\n\n

@Stage\n\n@Player\n\ndefine Touch Ground <up?>\nchange [falling? v] by (1)\nrepeat until <not <touching (ground v)?>>\n    if <up?> then\n        change y by (-1)\n    else\n        change y by (1)\n        set [falling? v] to [0]\n    end\n    set [speed y v] to [0]\nend\n\ndefine Walk (direction) (speed)\npoint in direction (direction)\nchange x by (speed)\nset [slope v] to [0]\nrepeat until <<(slope) = [8]> or <not <touching (ground v)?>>>\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))\nend\nif <(speed) < [0]> then\n    change [frame v] by ((speed) / (-8))\nelse\n    change [frame v] by ((speed) / (8))\nend\n\nwhen flag clicked\nhide\n\nwhen flag clicked\n\nwhen flag clicked\n\nwhen I receive [end v]\ngo to [front v] layer\nswitch costume to (light v)\ngo to x: (0) y: (0)\nset rotation style [left-right v]\nshow\nset [speed y v] to [0]\nset [falling? v] to [10]\nforever\n    switch costume to (hitbox v)\n    change y by (speed y)\n    Touch Ground <(speed y) > [0]>\n    change [speed y v] by (-1.3)\n    set [speed x v] to ((speed x) * (0.8))\n    if <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        change [speed x v] by (-1)\n    end\n    if <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        change [speed x v] by (1)\n    end\n    if <(speed x) < [-0.5]> then\n        Walk (-90) (speed x)\n    else\n        if <(speed x) > [0.5]> then\n            Walk (90) (speed x)\n        else\n            set [frame v] to [0]\n        end\n    end\n    if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n        if <<(jump key) = [0]> and <(falling?) < [3]>> then\n            set [speed y v] to [14]\n            set [falling? v] to [6]\n            set [jump key v] to [1]\n        end\n    else\n        set [jump key v] to [0]\n    end\n    if <<(y position) < [-175]> or <<touching (spikes v)?> or <touching (lava v)?>>> then\n        go to x: (0) y: (0)\n        set [speed y v] to [0]\n        broadcast (Reset v)\n    end\n    if <touching (goal v)?> then\n        go to x: (0) y: (0)\n        set [speed y v] to [0]\n        change [ma variable v] by (1)\n        broadcast (Next Level v)\n    end\n    switch costume to (classic v)\nend\n\nwhen I receive [end v]\nthink [Where is Exit ?] for (2) seconds\n\nwhen I receive [end v]\nforever\n    play sound [Dark Cave Music - Trickster Imps2 v] until done\nend\n\n@Ground\n\nwhen flag clicked\nhide\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\n\nwhen I receive [end v]\nforever\n    if <(costume [number v]) = [1]> then\n        broadcast (1 v)\n    end\n    if <(costume [number v]) = [2]> then\n        broadcast (2 v)\n    end\n    if <(costume [number v]) = [3]> then\n        broadcast (3 v)\n    end\n    if <(costume [number v]) = [4]> then\n        broadcast (4 v)\n    end\n    if <(costume [number v]) = [5]> then\n        broadcast (5 v)\n    end\n    if <(costume [number v]) = [6]> then\n        broadcast (6 v)\n    end\nend\n\nwhen I receive [end v]\nshow\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\ngo to [front v] layer\n\n@spikes\n\nwhen flag clicked\nhide\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [6 v]\nhide\n\nwhen I receive [end v]\nshow\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\ngo to [front v] layer\n\n@Goal\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\nswitch costume to (costume2 v)\nforever\n    turn left (10) degrees\nend\n\nwhen I receive [2 v]\ngo to x: (1) y: (76)\n\nwhen I receive [4 v]\ngo to x: (-19) y: (77)\n\nwhen I receive [5 v]\ngo to x: (-224) y: (79)\n\nwhen I receive [6 v]\nhide\n\nwhen I receive [end v]\nshow\ngo to x: (20) y: (-102)\nswitch costume to (costume1 v)\ncreate clone of (_myself_ v)\nforever\n    turn right (10) degrees\nend\n\n@Sprite1\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nset [ghost v] effect to (50)\nforever\n    go to (player v)\nend\n\nwhen flag clicked\n\nwhen I start as a clone\nset size to (75) %\nforever\n    repeat (10)\n        change size by (2)\n    end\n    repeat (10)\n        change size by (-2)\n    end\nend\n\nwhen I receive [end v]\nshow\nforever\n    repeat (10)\n        change size by (2)\n    end\n    repeat (10)\n        change size by (-2)\n    end\nend\n\nwhen I receive [end v]\nset size to (100) %\nset [ghost v] effect to (50)\ncreate clone of (_myself_ v)\nforever\n    go to (player v)\nend\n\n@cooltext-357154933712459\n\nwhen flag clicked\n\nshow\n\nwhen flag clicked\nhide\n\nwhen I receive [end v]\ngo to [front v] layer\nhide\n\n@Intro\n\ndefine Particles\nswitch costume to (particle v)\nrepeat (10)\n    create clone of (_myself_ v)\nend\n\ndefine Smooth Glide x: (x) y: (y) speed: (speed)\nrepeat until <<(round (x position)) = (round (x))> and <(round (y position)) = (round (y))>>\n    change x by (((round (x)) - (round (x position))) / (speed))\n    change y by (((round (y)) - (round (y position))) / (speed))\nend\ngo to x: (x) y: (y)\n\nwhen flag clicked\nset size to (100) %\nclear graphic effects\ngo to x: (0) y: (0)\nhide\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    set [ghost v] effect to (0)\n    go to [front v] layer\n    go to x: (0) y: (40)\n    show\n    set [i v] to [170]\n    repeat (50)\n        set [i v] to (((i) * (.7)) + (((100) - (size)) / (5)))\n        change size by (i)\n    end\n    point in direction (90)\n    repeat (57)\n        point in direction ((([tan v] of (turn) ) * (8)) + (0))\n        change [turn v] by (3)\n    end\n    point in direction (90)\n    go to [front v] layer\n    set [test1 v] to [1]\n    Smooth Glide x: (0) y: (0) speed: (5)\nelse\n    if <(costume [number v]) = [2]> then\n        wait (0.2) seconds\n        set [ghost v] effect to (100)\n        go to x: (0) y: (40)\n        show\n        set [i2 v] to [50]\n        repeat (50)\n            change [ghost v] effect by (-20)\n            set [i2 v] to (((i2) * (.7)) + (((100) - (size)) / (5)))\n            change size by (i2)\n        end\n        wait (0.5) seconds\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n    end\n    if <(costume [number v]) = [3]> then\n        set [ghost v] effect to (100)\n        wait (0.2) seconds\n        go to x: (1) y: (-50)\n        show\n        go to [front v] layer\n        set [i3 v] to [75]\n        repeat (50)\n            change [ghost v] effect by (-10)\n            set [i3 v] to (((i3) * (.7)) + (((100) - (size)) / (5)))\n            change size by (i3)\n        end\n        wait (1.75) seconds\n        Smooth Glide x: (0) y: (0) speed: (1.2)\n        switch costume to (4 v)\n        set size to (1) %\n        repeat (60)\n            point in direction ((90) - (([cos v] of ((timer) * (100)) ) * (4)))\n            change size by (((10) * (.7)) + (((100) - (size)) / (5)))\n        end\n        repeat (10)\n            point in direction ((90) - (([cos v] of ((timer) * (100)) ) * (4)))\n            change size by (((18) * (.7)) + (((100) - (size)) / (5)))\n        end\n        repeat (10)\n            point in direction ((90) - (([cos v] of ((timer) * (100)) ) * (4)))\n            change size by (((1) * (.7)) + (((1) - (size)) / (5)))\n        end\n        hide\n    end\n    if <(costume [number v]) = [5]> then\n        set [ghost v] effect to (100)\n        go to x: (0) y: (0)\n        go to [back v] layer\n        show\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n    end\n    if <(costume [number v]) = [4]> then\n        set [ghost v] effect to (85)\n        wait (0.2) seconds\n        go to x: (-3) y: (-55)\n        show\n        go to [back v] layer\n        go [forward v] (1) layers\n        set [i3 v] to [75]\n        repeat (50)\n            set [i3 v] to (((i3) * (.7)) + (((100) - (size)) / (5)))\n            change size by (i3)\n        end\n        glide (0.5) secs to x: (-3) y: (-53)\n        wait (0.5) seconds\n        repeat (15)\n            change [ghost v] effect by (1)\n        end\n    end\n    if <(costume [number v]) = [8]> then\n        wait (2.5) seconds\n        go to x: (-300) y: (0)\n        go to [front v] layer\n        show\n        Smooth Glide x: (300) y: (0) speed: (6)\n        broadcast (End v)\n    end\nend\n\nwhen I receive [intro v]\nplay sound [intro v] until done\n\nwhen I receive [intro v]\nswitch costume to (1 v)\ncreate clone of (_myself_ v)\nswitch costume to (2 v)\ncreate clone of (_myself_ v)\nswitch costume to (3 v)\ncreate clone of (_myself_ v)\nswitch costume to (4 v)\ncreate clone of (_myself_ v)\nswitch costume to (background v)\ncreate clone of (_myself_ v)\nswitch costume to (black mode v)\ncreate clone of (_myself_ v)\nswitch costume to (black mode 2 v)\ncreate clone of (_myself_ v)\nwait (3.75) seconds\nParticles\nswitch costume to (7 v)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nwait (0.1) seconds\nbroadcast (Intro v)\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    wait until <(test1) = [1]>\n    wait (0.1) seconds\n    repeat (10)\n        turn right (2) degrees\n        change [ghost v] effect by (10)\n        change size by (((250) - (size)) / (10))\n    end\nelse\n    if <(costume [name v]) = [Particle]> then\n        show\n        set size to (pick random (100) to (250)) %\n        set [ghost v] effect to (pick random (30) to (60))\n        set [particule 1 v] to (pick random (-10) to (10))\n        set [particule 2 v] to (pick random (10) to (20))\n        repeat until <touching (_edge_ v)?>\n            change [ghost v] effect by (1)\n            change x by (Particule 1)\n            change y by (Particule 2)\n            change [particule 2 v] by (-2)\n        end\n        delete this clone\n    end\nend\n\nwhen flag clicked\nset [test1 v] to [0]\n\nrepeat (10)\n\ngo [forward v] (1) layers\nset [i3 v] to [75]\nrepeat (50)\n    set [i3 v] to (((i3) * (.7)) + (((100) - (size)) / (5)))\n    change size by (i3)\nend\nglide (0.5) secs to x: (-3) y: (-53)\nwait (0.5) seconds\nrepeat (15)\n    change [ghost v] effect by (1)\nend\n\nwhen I receive [end v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nstop [other scripts in sprite v]\nstop [this script v]\n\n