Classic Platformer: Griffpatch e5
@Stage\n\n@Player\n\nwhen flag clicked\nset [gravity v] to [-1.5]\nset [jumpforce v] to [12]\nset [jumpduration v] to [6]\nset [acceleration v] to [1.5]\nset [resistance v] to [0.8]\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 - Slope 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\ndefine Check Touching Solid\nif <touching (level v)?> then\n    set [touching v] to [1]\nelse\n    set [touching v] to [0]\nend\n\nwhen I receive [player - tick v]\nsay [Wrong message] for (2) seconds\n\nwhen I receive [tick - player v]\nswitch backdrop to <touching (level v)?>\nControls - up and down\nControls - left and right\nMove - in steps (([abs v] of (speed x) ) + ([abs v] of (speed y) ))\nSet costume\n\ndefine Controls - up and down\nif <key (up arrow 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 right (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) < (JumpDuration)>> then\n        change [jumping v] by (1)\n        set [speed y v] to (JumpForce)\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 Controls - left and right\nif <(long jump) > [0]> then\n    change [long jump v] by (-1)\n    stop [this script v]\nend\nset [keyx v] to (<key (right arrow v) pressed?> - <key (left arrow v) pressed?>)\nif <(KeyX) = [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.5)\n    end\nelse\n    change [speed x v] by ((KeyX) * (Acceleration))\n    point in direction ((KeyX) * (90))\n    change [frame v] by (1)\nend\nset [speed x v] to ((speed x) * (Resistance))\n\ndefine Reset and Begin Level\nset [scene# v] to [1]\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]\ngo to x: (-150) y: (50)\nbroadcast (Change Scene v)\nbroadcast (Game Loop v)\n\nwhen I receive [game loop v]\nforever\n    broadcast (Tick - First v)\n    broadcast (Tick - player v)\n    broadcast (Tick - last v)\nend\n\nwhen I receive [tick - last v]\nif <(x position) > [235]> then\n    Begin Scene # ((Scene#) + (1)) Go to x: [-235]\nend\nif <(x position) < [-235]> then\n    Begin Scene # ((Scene#) + (-1)) Go to x: [235]\nend\n\ndefine Begin Scene # (scene) Go to x: (x)\nset [scene# v] to (scene)\nset x to (x)\nbroadcast (Change Scene v)\nstop [other scripts in sprite v]\nwait (0) seconds\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\nFix collision in direction [0]\nSet costume\nbroadcast (Game Loop v)\n\ndefine Fix collision in direction (dir)\nset [temp v] to (direction)\nset [distance v] to [1]\npoint in direction (dir)\nrepeat (400)\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\nwhen I receive [tick - first v]\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\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 (jump01 v)\n    else\n        switch costume to (run_j2 v)\n    end\n    stop [this script v]\nend\nif <(frame) > [0]> then\n    switch costume to ((1) + ([floor v] of ((frame) mod (16)) ))\nelse\n    switch costume to (hit angle 0 v)\n    repeat (5)\n        Check Touching Solid\n        if <(touching) < [1]> then\n            switch costume to ((costume [number v]) + (5))\n            stop [this script v]\n        end\n        next costume\n    end\n    switch costume to (stand v)\nend\n\ndefine Collide X - Slope 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))\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 v2 v)\nset rotation style [don't rotate v]\n\n@Level\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\n\nwhen I receive [change scene v]\nswitch costume to (join [scene] (Scene#))\n\n
Like this project as much as me? Please love and fave if you enjoyed! And maybe a follow as well for more helpful assets?\n\nPress arrow keys\n\nBackstory: The year is 3050 and Scratch Cat has been assigned a 'suit-less' spacewalk; that's how far fetched humans were, dreaming of being in space without a space suit. Anyways, Scratchy gets out of the spaceship, and witnesses the crashing of two satellites. This creates an 'astronomical electric disaster' which gives birth to a black hole. Since the number of satellites were abundant compared to now, electricity related phenomena was very common. The only choice is for Scratch Cat to get back to the spaceship before the electricity turns black