Giant Maze || A scrolling Platformer                                        #all #games

Instructions: Hey ! Welcome to Giant Maze !\nThis is a scrolling platformer\nThe arrows indicate the exit ...\nKey arrow for move\nMobile friendly !

@Stage\n\n@Player\n\ndefine Controls - Left and Right\nset [speed x v] to ((speed x) * (0.7))\nif <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [speed x v] by (1.5)\nend\nif <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [speed x v] by (-1.5)\nend\n\ndefine Walk (direction) (speed) max step (step)\npoint in direction (direction)\nchange x by (speed)\nchange [frame v] by (([abs v] of (speed) ) / (8))\nset [slope v] to [0]\nGet Touching <(in platforrm) = [1]>\nrepeat until <<(slope) = (step)> or <(touch) = [0]>>\n    change y by (1)\n    change [slope v] by (1)\n    Get Touching <(in platforrm) = [1]>\nend\nif <(slope) = (step)> then\n    change x by ((0) - (speed))\n    change y by ((0) - (slope))\n    if <<(touch) = [1]> and <(in platforrm) = [1]>> then\n        set [in platforrm v] to [2]\n        Walk (direction) (speed) max step (step)\n        if <(speed x) = [0]> then\n            set [in platforrm v] to [1]\n        end\n    else\n        if <<<<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> and <([abs v] of (speed) ) > [3.5]>> and <(touch) > [1]>> then\n            set [speed x v] to ((-1.2) * (speed))\n            set [speed y v] to [11]\n            set [falling? v] to [6]\n            set [wall jump v] to [15]\n        else\n            set [speed x v] to [0]\n        end\n    end\nend\n\ndefine Controls - Jump, Crouch\nif <<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\nelse\n    set [jump key v] to [0]\nend\nif <key (down arrow v) pressed?> then\n    set [in platforrm v] to [2]\nend\n\ndefine Gravity\nif <<(speed y) < [4]> or <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n    change [speed y v] by (-1)\nelse\n    change [speed y v] by (-2)\nend\nchange y by (speed y)\nchange [falling? v] by (1)\n\ndefine Check Hit Ceiling / Floor <up?>\nGet Touching \nif <(touch) = [0]> then\n    set [in platforrm v] to [1]\nelse\n    if <<up?> and <(touch) = [1]>> then\n        set [in platforrm v] to [2]\n    end\nend\nrepeat until <(touch) < (in platforrm)>\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    Get Touching <not <up?>>\n    set [speed y v] to [0]\nend\n\ndefine Get Touching <check platform?>\nif <touching (ground v)?> then\n    set [touch v] to [9]\nelse\n    if <<check platform?> and <touching (platforms v)?>> then\n        set [touch v] to [1]\n    else\n        set [touch v] to [0]\n    end\nend\n\ndefine Set Costume\nif <(falling?) < [6]> then\n    if <(frame) = [0]> then\n        switch costume to (stand_1 v)\n    else\n        switch costume to ([floor v] of ((4) + ((frame) mod (8))) )\n    end\nelse\n    if <(speed y) > [0]> then\n        switch costume to (jump_1 v)\n    else\n        switch costume to (fall_1 v)\n    end\nend\n\nwhen flag clicked\n\ndefine Reset Level\nset size to (25) %\nset rotation style [left-right v]\ngo to x: (0) y: (0)\nreset timer\nshow\nset [scrollx v] to [700]\nset [scrolly v] to [550]\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [falling? v] to [10]\nset [in platforrm v] to [1]\nset [frame v] to [0]\nset [wall jump v] to [0]\n\nif <(y position) < [-189]> then\n    Reset Level\nend\n\nwhen flag clicked\n\nwhen I receive [end v]\nforever\n    play sound [Dark Cave Music - Trickster Imps2 v] until done\nend\n\nwhen I receive [end v]\nReset Level\nforever\n    switch costume to (hitbox v)\n    Controls - Jump, Crouch\n    Gravity\n    Check Hit Ceiling / Floor <(speed y) > [0]>\n    if <(wall jump) > [0]> then\n        change [wall jump v] by (-1)\n    else\n        Controls - Left and Right\n    end\n    if <(speed x) < [-0.5]> then\n        Walk (-90) (speed x) max step (([ceiling v] of ([abs v] of ((speed x) * (1.3)) ) ) + (1))\n    else\n        if <(speed x) > [0.5]> then\n            Walk (90) (speed x) max step (([ceiling v] of ([abs v] of ((speed x) * (1.3)) ) ) + (1))\n        else\n            set [frame v] to [0]\n        end\n    end\n    change [scrollx v] by (() - (round ((x position) / (10))))\n    change x by ((0) - (round ((x position) / (10))))\n    change [scrolly v] by (() - (round ((y position) / (10))))\n    change y by ((0) - (round ((y position) / (10))))\n    Set Costume\n    broadcast (tick v) and wait\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [end v]\nshow\n\n@Ground\n\nwhen flag clicked\n\ndefine Hack Zoom to (percent)\nif <(percent) > [100]> then\n    set [#costume v] to (costume [number v])\n    switch costume to (dot v)\n    set size to (percent) %\n    switch costume to (#costume)\nelse\n    set size to (percent) %\nend\n\nwhen I receive [end v]\nswitch costume to (costume1 v)\nshow\ngo [forward v] (100) layers\nHack Zoom to (400)\ngo to x: (700) y: (550)\nforever\n    go to x: (ScrollX) y: (ScrollY)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [end v]\nshow\n\n@Sprite1\n\nwhen I start as a clone\nset [ghost v] effect to (50)\nforever\n    go to (player v)\nend\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]\ngo to [back v] layer\nset size to (100) %\nset [ghost v] effect to (50)\ncreate clone of (_myself_ v)\nforever\n    go to (player v)\nend\n\nwhen flag clicked\n\nwhen flag clicked\nhide\n\n@Sprite2\n\nwhen flag clicked\n\nwhen I start as a clone\nset [ghost v] effect to (50)\n\nwhen flag clicked\n\nwhen I start as a clone\ngo to (random position v)\nset size to (10) %\nforever\n    repeat (10)\n        change y by (2)\n        change size by (2)\n    end\n    repeat (10)\n        change y by (2)\n        change size by (-2)\n    end\nend\n\nwhen I receive [end v]\nshow\nforever\n    repeat (10)\n        change y by (2)\n        change size by (2)\n    end\n    repeat (10)\n        change y by (2)\n        change size by (-2)\n    end\nend\n\nwhen I receive [end v]\ngo to [back v] layer\nset size to (100) %\nset [ghost v] effect to (50)\nforever\n    wait (0.5) seconds\n    create clone of (_myself_ v)\nend\n\nhide\n\nwhen flag clicked\n\nwhen I start as a clone\ngo to [front v] layer\nforever\n    if <<touching (_edge_ v)?> or <touching (cart v)?>> then\n        delete this clone\n    end\nend\n\nwait (1) seconds\n\nwhen flag clicked\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@Thumbail\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\n