The Gigachad Platformer v 1.2.1

Instructions: ◄ WELCOME TO THE GIGACHAD PLATFORMER ►\n• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • \nYou are a gigachad and you need to prove that you are a real gigachad to prevent all of your gigachad friends considering you a non-chad.\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\nInstructions:\nBeat all the levels to win, but watch out for the spikes.\nArrow keys or WASD to move.\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬Please like and fav to make my mom proud of me.\nBruh why is this getting so many views?\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\nUpdates:\nv 1.0 game released!\nv 1.1 added more levels\nv 1.2 "harded up" the levels and fixed chad movements\nv 1.2.1 edited final level\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\nCredits:\nDesign by me.\nPlatform game mechanics and scripts by @griffpatch\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\nMore games:\nhttps://scratch.mit.edu/projects/781662439/\nhttps://scratch.mit.edu/projects/760232179/\nhttps://scratch.mit.edu/projects/721381119/\n\nLast updated: 15/03/2024 - 14:41 (Italy)

@Stage\n\nwhen flag clicked\nforever\n    play sound [GIGACHAD Theme Song v] until done\nend\n\n@Gigachad\n\ndefine Collide X - Stop or Wall?\nCheck Can Wall Slide\nchange y by (1)\nCheck Touching solid\nif <(touching) > [0]> then\n    change y by (1)\n    Check Touching solid\n    if <(touching) > [0]> then\n        change y by (-2)\n        set x to (last value)\n        set [speed x v] to [0]\n        stop [this script v]\n    end\n    set [speed x v] to ((speed x) * (0.8))\nend\nset [speed x v] to ((speed x) * (0.95))\nSlip\n\ndefine Collide Y - Ceiling or Floor\nset y to (last value)\nif <(speed y) > [0]> then\n    set [speed y v] to [0]\n    stop [this script v]\nend\nif <(falling) > [0]> then\n    set [falling v] to [0]\n    Slip\nend\nset [speed y v] to ((speed y) * (0.8))\n\ndefine Slip\nchange y by (-2)\nchange x by (1)\nCheck Touching solid\nif <(touching) < [1]> then\n    set [falling v] to [9]\n    change [speed x v] by (1)\n    stop [this script v]\nend\nchange x by (-2)\nCheck Touching solid\nif <(touching) < [1]> then\n    set [falling v] to [9]\n    change [speed x v] by (-1)\n    stop [this script v]\nend\nchange y by (2)\nchange x by (1)\n\ndefine Check Can Wall Slide\nif <(falling) < [2]> then\n    set [wall slide v] to [0]\n    stop [this script v]\nend\nswitch costume to (hitbox wallslide v)\nset rotation style [left-right v]\nCheck Touching solid\nset [wall slide v] to (touching)\nswitch costume to (hitbox v)\nset rotation style [don't rotate v]\n\nwhen I receive [die v]\nstop [other scripts in sprite v]\nhide\nwait (0.01) seconds\nReset and Begin Level\n\ndefine Moved by moving platform\nchange x by (PLATFORM DX)\nchange y by (PLATFORM DY)\nCheck Touching solid\nif <(touching) > [0]> then\n    Find Closest Space to (x position) (y position) max [16]\n    if <(touching) > [0]> then\n        broadcast (Die v)\n    end\nend\n\ndefine Fix Collision in Direction (dir)\nset [temp v] to (direction)\nset [distance v] to [1]\npoint in direction (dir)\nrepeat (128)\n    Check Touching solid\n    if <(touching) < [1]> then\n        point in direction (temp)\n        stop [this script v]\n    end\n    move (distance) steps\n    turn right (180) degrees\n    change [distance v] by (1)\nend\n\ndefine Find Closest Space to (x) (y) max (max)\nset [temp v] to (direction)\nset [distance v] to [1]\npoint in direction (0)\nrepeat (max)\n    repeat (16)\n        go to x: (x) y: (y)\n        move (distance) steps\n        Check Touching solid\n        if <(touching) < [1]> then\n            point in direction (temp)\n            stop [this script v]\n        end\n        turn right (22.5) degrees\n    end\n    change [distance v] by (1)\nend\ngo to x: (x) y: (y)\npoint in direction (temp)\n\ndefine Controls - Left and right\nif <(long jump) > [0]> then\n    change [long jump v] by (-1)\n    stop [this script v]\nend\nset [key x v] to (<<key (right arrow v) pressed?> or <key (d v) pressed?>> - <<key (left arrow v) pressed?> or <key (a v) pressed?>>)\nif <(KEY X) = [0]> then\n    if <<(falling) > [2]> and <(wall slide) < [1]>> then\n        set [speed x v] to ((speed x) * (0.98))\n        stop [this script v]\n    end\n    if <([abs v] of (speed x) ) < [1]> then\n        set [frame v] to [0]\n        set [speed x v] to [0]\n    else\n        change [frame v] by (0.25)\n    end\nelse\n    change [speed x v] by ((KEY X) * (ACCELERATION))\n    point in direction ((KEY X) * (90))\n    change [frame v] by (0.5)\nend\nset [speed x v] to ((speed x) * (RESISTANCE))\n\ndefine Reset and Begin Level\nshow\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [falling v] to [99]\nset [wall slide v] to [0]\nset [jumping v] to [0]\nset [long jump v] to [0]\npoint in direction (90)\nBegin Scene # (Scene #) go to x, y: [-200] (Respawn y)\n\nwhen I receive [tick - last v]\nif <(x position) > [235]> then\n    broadcast (Change scene v)\n    Begin Scene # ((Scene #) + (1)) go to x, y: [-235] (y position)\n    set [respawn y v] to (y position)\nend\nif <touching (spikes v)?> then\n    broadcast (Die v)\nend\nif <touching (toxic liquid v)?> then\n    broadcast (Die v)\nend\n\ndefine Begin Scene # (scene #) go to x, y: (x) (y)\nset [scene # v] to (scene #)\nset x to (x)\nset y to (y)\nstop [other scripts in sprite v]\nwait (0) seconds\nswitch costume to (hitbox v)\nset rotation style [don't rotate v]\nFix collision in Direction [0]\nSet costume\nbroadcast (Game loop v)\n\nwhen I receive [tick - first v]\nswitch costume to (hitbox v)\nset rotation style [don't rotate v]\nset [platform dx v] to []\nset [platform dy v] to []\n\nwhen I receive [game loop v]\nforever\n    broadcast (Tick - First v)\n    broadcast (Tick - Platform v)\n    broadcast (Tick - Player v)\n    broadcast (Tick - last v)\nend\n\ndefine Controls - Up and down\nif <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n    if <<(wall slide) > [0]> and <(jumping) = [0]>> then\n        set [jumping v] to [1]\n        set [falling v] to [3]\n        set [wall slide v] to [0]\n        turn left (180) degrees\n        set [speed x v] to (((direction) / (90)) * (7))\n        set [long jump v] to [12]\n    end\n    if <<(falling) < [3]> and <(jumping) = [0]>> then\n        set [jumping v] to [1]\n        set [falling v] to [3]\n    end\n    if <<(jumping) > [0]> and <(jumping) < (JUMP DURATION)>> then\n        change [jumping v] by (1)\n        set [speed y v] to (JUMP FORCE)\n    end\nelse\n    set [jumping v] to [0]\nend\nchange [speed y v] by (GRAVITY)\nif <(wall slide) > [0]> then\n    Check Can Wall Slide\n    if <(speed y) < [0]> then\n        set [speed y v] to ((speed y) * (0.6))\n    end\nend\n\ndefine Check Touching solid\nif <<touching (platforms v)?> or <touching (moving platforms v)?>> then\n    set [touching v] to [1]\nelse\n    set [touching v] to [0]\nend\n\nwhen I receive [start intro v]\nset y to (y)\nset [gravity v] to [-1.5]\nset [jump force v] to [12]\nset [jump duration v] to [6]\nset [acceleration v] to [1.75]\nset [resistance v] to [0.8]\nset [wall slide v] to [0]\nset [jumping v] to [0]\nset [long jump v] to [0]\nset [respawn y v] to [-30]\nReset and Begin Level\n\ndefine Move - in steps (steps)\nchange [falling v] by (1)\nrepeat (steps)\n    set [last value v] to (x position)\n    change x by ((speed x) / (steps))\n    Check Touching solid\n    if <(touching) > [0]> then\n        Collide X - Stop or Wall?\n    end\n    set [last value v] to (y position)\n    change y by ((speed y) / (steps))\n    Check Touching solid\n    if <(touching) > [0]> then\n        Collide Y - Ceiling or Floor\n    end\nend\n\nwhen flag clicked\nhide\n\ndefine Set costume\nset rotation style [left-right v]\nif <(wall slide) > [0]> then\n    switch costume to (hangon01 v)\n    stop [this script v]\nend\nif <(falling) > [1]> then\n    if <(speed y) > [0]> then\n        switch costume to (jump1 v)\n    else\n        switch costume to (jump2 v)\n    end\n    stop [this script v]\nend\nif <(frame) > [0]> then\n    switch costume to ((1) + ([floor v] of ((frame) mod (4)) ))\nelse\n    switch costume to (stand v)\nend\n\nwhen I receive [tick - player v]\nMoved by moving platform\nControls - Up and down\nControls - Left and right\nMove - in steps (([abs v] of (speed x) ) + ([abs v] of (speed y) ))\nSet costume\n\n@Bright effect\n\nwhen flag clicked\nhide\n\nwhen I receive [start intro v]\nshow\nforever\n    go to (gigachad v)\nend\n\ngo to [front v] layer\n\ngo [backward v] (1) layers\n\n@Platforms\n\nwhen I receive [start intro v]\nshow\ngo to [front v] layer\ngo [backward v] (2) layers\nset [scene # v] to [1]\ngo to x: (0) y: (0)\nswitch costume to (join [Scene] (Scene #))\n\nwhen I receive [change scene v]\nswitch costume to (join [Scene] (Scene #))\n\nset [scene # v] to [6]\n\nwhen flag clicked\nhide\n\n@Spikes\n\nwhen I receive [start intro v]\nshow\ngo to [front v] layer\ngo [backward v] (5) layers\ngo to x: (0) y: (0)\nswitch costume to (join [Scene] (Scene #))\n\nwhen I receive [change scene v]\ngo to x: (0) y: (0)\nswitch costume to (blank v)\nswitch costume to (join [Scene] (Scene #))\n\nwhen flag clicked\nhide\n\n@Toxic liquid\n\nwhen I receive [run project v]\nshow\ngo to [front v] layer\ngo [backward v] (3) layers\ngo to x: (0) y: (0)\n\nwhen I receive [change scene v]\ngo to x: (0) y: (0)\nswitch costume to (blank v)\nswitch costume to (join [Scene] (Scene #))\nforever\n    set y to ((3) * ([sin v] of ((timer) * (180)) ))\nend\n\n@Backdrops\n\nwhen flag clicked\nswitch costume to (1 v)\nset [mosaic v] effect to (30)\ngo to [back v] layer\n\nwhen I receive [change scene v]\nset [mosaic v] effect to (30)\nnext costume\n\n@Thumbnail\n\nwhen flag clicked\ngo to [front v] layer\nshow\nset [idxglowing v] to [0]\nrepeat (30)\n    change [ghost v] effect by (IDXGlowing)\n    change [idxglowing v] by (0.5)\nend\nhide\nbroadcast (Start Intro v)\nhide\n\nwhen flag clicked\nforever\n    set [afterstopanimationidx v] to (timer)\nend\n\nwhen [timer v] > (AfterStopAnimationIdx)\ngo to [front v] layer\nset [ghost v] effect to (100)\nset [idxglowing v] to [5]\nshow\nrepeat (30)\n    change [ghost v] effect by ((0) - (IDXGlowing))\n    change [idxglowing v] by (-0.1)\n    wait (0.01) seconds\nend\n\n