The Platformer

Instructions: Many codes @GriffPatch\n\nGame in griffpatch Video!

@Stage\n\n@Player\n\nwhen flag clicked\nset [jump duration v] to [6]\nset [gravity v] to [-1.5]\nset [jump force v] to [12]\nset [acceleration v] to [1.6]\nset [resistance v] to [0.8]\nReset and Begin level\nText [Ahh where I am?] Timing []\nwait (0.6) seconds\nText [I must go to my house.Please Help me!] Timing []\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 - celling or floor?\n    end\nend\n\ndefine Check Touching Solid\nif <<touching (level v)?> or <touching (moveable part v)?>> then\n    set [touching v] to [1]\nelse\n    set [touching v] to [0]\nend\n\nwhen I receive [tick - player v]\nControls - Up and Down\nControls - Left and Right\nMove - in steps (([abs v] of (speed y) ) + ([abs v] of (speed x) ))\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) < (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 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?> - <key (left arrow 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.5)\n    end\nelse\n    change [speed x v] by ((KEY X) * (ACCELERATION))\n    point in direction ((KEY X) * (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 y v] to [0]\nset [speed x 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: (55)\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 (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\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 (6)\n        Check Touching Solid\n        if <(touching) < [1]> then\n            switch costume to ((costume [number v]) + (6))\n            stop [this script v]\n        end\n        next costume\n    end\n    switch costume to (stand v)\nend\n\nwhen flag clicked\nforever\n\nwhen I receive [tick - player v]\nforever\n    if <<touching color (#0061bd)?> or <<touching color (#ff0000)?> or <<touching color (#55bd00)?> or <touching (the lava layer v)?>>>> then\n        Reset\n        switch costume to (ouch v)\n    end\nend\n\ndefine Reset\nchange [hearts v] by (-1)\nset [speed y v] to [0]\nset [speed x v] to [0]\nset [falling v] to [99]\nset [gravity v] to [-1.5]\nset [jump force v] to [12]\nset [acceleration v] to [1.6]\nset [resistance v] to [0.8]\ngo to x: (-150) y: (55)\nbroadcast (Change Scene v)\nbroadcast (Game Loop v)\nswitch backdrop to (false v)\n\nwhen flag clicked\nshow\n\nwhen I receive [tick - first v]\nforever\n    if <(y position) = [-183]> then\n        Reset\n    end\nend\n\ndefine Text (text) Timing (time)\nset [sayı v] to [0]\nset [söylenen v] to []\nset [söylenecek v] to (text)\nrepeat ((length of (söylenecek)) + (1))\n    change [sayı v] by (1)\n    set [söylenen v] to (join (söylenen) (letter (sayı) of (text)))\n    say (söylenen)\n    start sound [pop v]\n    wait (time) seconds\nend\nwait (2) seconds\nsay []\n\nText [OUCH!] Timing []\n\nset [scene # v] to [20]\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))\nSllip\n\ndefine Collide Y - celling 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    Sllip\nend\nset [speed y v] to ((speed y) * (0.8))\n\ndefine Sllip\nchange y by (-2)\nchange x by (1)\nCheck Touching Solid\nif <(touching) < [1]> then\n    set [falling v] to [9]\n    set [speed x v] to [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    set [speed x v] to [-1]\n    stop [this script v]\nend\nchange y by (2)\nchange x by (1)\n\nshow variable [part v]\n\n\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\nset [hearts v] to [-1]\nhide variable [hearts v]\nask [Do you want the health bar in the game? \(Y/N\)] and wait\nif < (answer) contains [Y]?> then\n    set [hearts v] to [3]\n    show variable [hearts v]\n    wait until <(Hearts) = [0]>\n    broadcast (die animate v)\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\nswitch backdrop to (dekor 2 v)\nwait until <(costume [number v]) = [3]>\nswitch backdrop to (dekor 1 v)\n\nwhen I receive [change scene v]\nswitch costume to (join [Scene] (SCENE #))\n\nwhen flag clicked\nwait until <(costume [number v]) = [5]>\nbroadcast (moveable part - 5 v)\n\nwhen flag clicked\nwait until <(costume [number v]) = [6]>\nwait (0.05) seconds\nbroadcast (moveable part - 6 v)\n\nwhen I receive [change scene v]\nswitch costume to (join [Scene] (SCENE #))\n\nwhen flag clicked\nwait until <(costume [number v]) = [8]>\nswitch backdrop to (dekor 2 v)\n\nwhen flag clicked\nforever\n    set [part v] to (SCENE #)\nend\n\nwhen flag clicked\nwait until <(costume [number v]) = [10]>\nswitch backdrop to (dekor 3 v)\n\nwhen flag clicked\nwait until <(costume [number v]) = [14]>\nswitch backdrop to (dekor 4 v)\n\nwhen flag clicked\nwait until <(costume [number v]) = [18]>\nswitch backdrop to (dekor 5 v)\n\nset [scene # v] to [30]\n\n@moveable part\n\nwhen flag clicked\nset [move ending scene v] to [0]\nhide\ngo to x: (-64) y: (-117)\n\nwhen I receive [moveable part - 5 v]\nset [move ending scene v] to [6]\nshow\nrepeat until <(SCENE #) = [6]>\n    show\n    glide (1) secs to x: (-64) y: (-117)\n    glide (1) secs to x: (75) y: (-117)\nend\nbroadcast (move end v)\ngo to x: (-64) y: (-117)\nhide\n\nwhen I receive [moveable part - 6 v]\nset [move ending scene v] to [7]\nshow\nrepeat until <(SCENE #) = [7]>\n    glide (2) secs to x: (-64) y: (-117)\n    glide (2) secs to x: (195) y: (-116)\nend\nbroadcast (move end v)\ngo to x: (-64) y: (-117)\nhide\n\nwhen flag clicked\nforever\n    if <<<(move ending scene) = (SCENE #)> or <(SCENE #) > (move ending scene)>> or <(move ending scene) = [0]>> then\n        hide\n    else\n        show\n    end\nend\n\n\n\n@not touching p. back\n\nwhen I receive [change scene v]\ngo to [back v] layer\nswitch costume to (join [Scene] (SCENE #))\n\nwhen I receive [change scene v]\ngo to [back v] layer\nswitch costume to (join [Scene] (SCENE #))\n\n@not touching front\n\nwhen I receive [change scene v]\ngo to [front v] layer\nswitch costume to (join [Scene] (SCENE #))\n\n@animation\n\nwhen flag clicked\nhide\nswitch costume to (kostüm 1 v)\nwait until <(SCENE #) = [35]>\ngo to [front v] layer\nhide variable [hearts v]\nhide variable [part v]\nshow\nrepeat (8)\n    next costume\n    wait (0.4) seconds\nend\nstart sound [Tada v]\n\n@animation2\n\nwhen flag clicked\nhide\nswitch costume to (kostüm 2 v)\n\nwhen I receive [die animate v]\ngo to [front v] layer\nhide variable [hearts v]\nhide variable [part v]\nshow\nrepeat (10)\n    next costume\n    wait (0.4) seconds\nend\nforever\n    play sound [bad-ending-theme-extended-five-nights-at-freddys-3 v] until done\nend\n\nstop [other scripts in sprite v]\n\n@Kukla 1\n\nwhen flag clicked\nhide\nforever\n    set [timer v] to (timer)\nend\n\nwhen [timer v] > (Timer)\ngo to [front v] layer\nshow\nforever\n    switch costume to (3 v)\n    wait (0.1) seconds\n    repeat until <(costume [name v]) = [7]>\n        next costume\n        wait (0.1) seconds\n    end\n    repeat until <(costume [name v]) = [3]>\n        wait (0.1) seconds\n        switch costume to ((costume [number v]) - (1))\n        wait (0.1) seconds\n    end\nend\n\nforever\nend\n\n@The Lava Layer\n\nwhen flag clicked\ngo to x: (-10) y: (-32)\ngo to [back v] layer\nforever\n    glide (2) secs to x: (-8) y: (-70)\n    glide (2) secs to x: (-10) y: (-90)\nend\n\n