Realistic | A Platformer #All #Games #Animations #Music #Art #Stories

Instructions: new!: https://scratch.mit.edu/projects/643438568/\n\n~Instructions~\n\n- Use ⬆⬅➡, w,d,a, or mobile friendly.\n- 100% possible levels.\n- Avoid spikes, lava and saws.\nMaybe ❤️ and ⭐️ and follow me for more cool games?

@Stage\n\nwhen flag clicked\nforever\n    play sound [Moosic v] until done\nend\n\n@Player\n\nwhen I receive [run platformer v]\nforever\n    if <<[240] < (x position)> and <(dead?) = [0]>> then\n        broadcast (NAXT LEVEL v)\n        change [level v] by (1)\n        Reset - Setup\n    end\nend\n\nwhen flag clicked\nhide variable [xv v]\nhide variable [dead? v]\nhide variable [level v]\nhide variable [yv v]\nbroadcast (Run Platformer v)\nhide\n\nwhen I receive [run platformer v]\ngo to [front v] layer\nset [dead? v] to [0]\nset [level v] to [0]\nset size to (60) %\nReset - Setup\nforever\n    if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> and <(dead?) = [0]>> then\n        switch costume to (1 v)\n        change [xv v] by (1)\n    end\n    if <<<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> and <(dead?) = [0]>> then\n        switch costume to (2 v)\n        change [xv v] by (-1)\n    end\n    set [xv v] to ((Xv) * (.9))\n    change x by (Xv)\n    if <touching (ground v)?> then\n        change y by (2)\n        if <touching (ground v)?> then\n            change y by (2)\n        end\n        if <touching (ground v)?> then\n            change y by (2)\n            if <touching (ground v)?> then\n                change y by (2)\n                if <touching (ground v)?> then\n                    change y by (2)\n                    if <touching (ground v)?> then\n                        change x by ((Xv) * (-2))\n                        change y by (-5)\n                        if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (10))>>>> then\n                            if <(Xv) > [0]> then\n                                set [xv v] to [-5]\n                            else\n                                set [xv v] to [5]\n                            end\n                            set [yv v] to [13]\n                        else\n                            set [xv v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-0.8)\n    change y by (Yv)\n    if <<touching (ground v)?> or <touching (bridgetest v)?>> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <<touching (ground v)?> or <touching (bridgetest v)?>> then\n        if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (10))>>>> then\n            set [yv v] to [12]\n        end\n    end\n    change y by (1)\n    if <<touching (spikes v)?> or <touching (saw v)?>> then\n        set [deadtype v] to [Spike]\n        Death\n    end\n    if <touching (lava v)?> then\n        set [deadtype v] to [Lava]\n        Death\n    end\nend\n\nwhen I receive [run platformer v]\nset [level v] to [1]\nforever\n    create clone of (_myself_ v)\nend\n\ndefine Reset - Setup\nset [dead? v] to [0]\nset [xv v] to [0]\nset [yv v] to [0]\npoint in direction (90)\ngo to x: (-201) y: (30)\nclear graphic effects\nswitch costume to (1 v)\nset size to (60) %\nshow\n\ndefine Death\nset [dead? v] to [1]\nif <(deadType) = [Lava]> then\n    set [deady v] to [0]\n    repeat until <(y position) < [-175]>\n        change [deady v] by (-1)\n        change y by (DeadY)\n        change [ghost v] effect by (4)\n    end\n    Reset - Setup\nend\nif <(deadType) = [Spike]> then\n    set [deady v] to [0]\n    repeat (5)\n        turn right (1) degrees\n        change [deady v] by (1)\n        change y by (DeadY)\n        change [ghost v] effect by (4)\n    end\n    repeat until <(y position) < [-175]>\n        turn right (1) degrees\n        change [deady v] by (-1)\n        change y by (DeadY)\n        change [ghost v] effect by (4)\n    end\n    Reset - Setup\nend\n\nwhen I start as a clone\nswitch costume to (clone v)\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-1.5)\nend\ndelete this clone\n\ngo [backward v] (2) layers\n\n@ground\n\nwhen I receive [run platformer v]\nshow\nforever\n    set [ghost v] effect to (100)\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\n\n@Lava\n\nwhen flag clicked\nhide\n\nwhen I receive [run platformer v]\nshow\ngo to [back v] layer\nforever\n    go to [back v] layer\n    switch costume to (Level)\nend\n\nwhen I receive [run platformer v]\nforever\n    set y to (([cos v] of ((timer) * (150)) ) * (7))\nend\n\n@Spikes\n\nwhen flag clicked\nhide\n\nwhen I receive [run platformer v]\nshow\ngo to [back v] layer\nforever\n    switch costume to (Level)\nend\n\n@Visible\n\nwhen I receive [run platformer v]\nshow\nforever\n    go to [back v] layer\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\n\n@BridgeTest\n\ndefine Create Bridge At X: (x) Y: (y)\ngo to x: (x) y: (y)\nset [cloneid v] to [1]\ncreate clone of (_myself_ v)\nchange x by (23)\nchange y by (-5)\nchange [cloneid v] by (1)\ncreate clone of (_myself_ v)\nchange x by (23)\nchange y by (-5)\nchange [cloneid v] by (1)\ncreate clone of (_myself_ v)\nchange x by (23)\ncreate clone of (_myself_ v)\nchange x by (23)\ncreate clone of (_myself_ v)\nchange x by (23)\nchange y by (5)\nchange [cloneid v] by (-1)\ncreate clone of (_myself_ v)\nchange x by (23)\nchange y by (5)\nchange [cloneid v] by (-1)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\nset [level v] to [0]\nforever\n    if <(Level) = [1]> then\n        hide\n    end\n    if <(Level) = [2]> then\n        Create Bridge At X: [-45] Y: [-80]\n        wait until <not <(Level) = [2]>>\n    end\n    if <(Level) = [3]> then\n        hide\n    end\n    if <(Level) = [4]> then\n        hide\n    end\n    if <(Level) = [5]> then\n        hide\n    end\n    if <(Level) = [6]> then\n        hide\n    end\n    if <(Level) = [7]> then\n        hide\n    end\n    if <(Level) = [8]> then\n        hide\n    end\nend\n\nwhen I start as a clone\nset [x v] to (x position)\nset [y v] to (y position)\nset [oldlevel v] to (Level)\nshow\nforever\n    if <(distance to [player v]) < [32]> then\n        if <not <(y position) < ((y) - ((5) * (CloneID)))>> then\n            change y by (-1)\n        end\n    else\n        repeat until <(y position) = (y)>\n            change y by (1)\n        end\n    end\n    if <not <(Level) = (oldLevel)>> then\n        delete this clone\n    end\nend\n\n@GrassTest\n\nwhen flag clicked\nset [level v] to [0]\nhide\nforever\n    if <(Level) = [1]> then\n        Create Grass At X: [-240] Y: [-80] Grass: [44]\n        wait until <not <(Level) = [1]>>\n    end\n    if <(Level) = [2]> then\n        Create Grass At X: [-220] Y: [-83] Grass: [14]\n        Create Grass At X: [117] Y: [-80] Grass: [10]\n        wait until <not <(Level) = [2]>>\n    end\n    if <(Level) = [3]> then\n        Create Grass At X: [-220] Y: [-83] Grass: [14]\n        Create Grass At X: [117] Y: [-80] Grass: [10]\n        wait until <not <(Level) = [3]>>\n    end\n    if <(Level) = [4]> then\n        Create Grass At X: [-240] Y: [-80] Grass: [44]\n        wait until <not <(Level) = [4]>>\n    end\n    if <(Level) = [5]> then\n        Create Grass At X: [-230] Y: [-83] Grass: [18]\n        Create Grass At X: [-40] Y: [-8] Grass: [9]\n        wait until <not <(Level) = [5]>>\n    end\n    if <(Level) = [6]> then\n        Create Grass At X: [-230] Y: [-83] Grass: [47]\n        wait until <not <(Level) = [6]>>\n    end\n    if <(Level) = [7]> then\n        Create Grass At X: [170] Y: [-83] Grass: [10]\n        Create Grass At X: [15] Y: [3] Grass: [2]\n        Create Grass At X: [-245] Y: [-83] Grass: [4]\n        wait until <not <(Level) = [7]>>\n    end\n    if <(Level) = [8]> then\n        Create Grass At X: [-240] Y: [-80] Grass: [42]\n        wait until <not <(Level) = [8]>>\n    end\nend\n\nwhen I start as a clone\nchange x by ((CloneID) * (10))\nset [oldlevel v] to (Level)\nset [x v] to (x position)\nset [y v] to (y position)\nshow\nforever\n    go to [front v] layer\n    if <(distance to [player v]) < [32]> then\n        if <(Xv) > [0]> then\n            if <not <[130] < (direction)>> then\n                turn right (5) degrees\n            end\n        end\n        if <[0] > (Xv)> then\n            if <not <(direction) < [50]>> then\n                turn right (-5) degrees\n            end\n        end\n    else\n        if <[90] < (direction)> then\n            repeat until <(direction) = [90]>\n                turn left (5) degrees\n            end\n        end\n        if <(direction) < [90]> then\n            repeat until <(direction) = [90]>\n                turn left (-5) degrees\n            end\n        end\n    end\n    if <not <(Level) = (OldLevel)>> then\n        delete this clone\n    end\nend\n\ndefine Create Grass At X: (x) Y: (y) Grass: (grass)\nset [cloneid v] to [0]\nrepeat (grass)\n    switch costume to (pick random (1) to (2))\n    go to x: (x) y: (y)\n    change [cloneid v] by (1)\n    create clone of (_myself_ v)\nend\n\ndefine Create Bridge At X: (x) Y: (y)\n\nwhen [m v] key pressed\nset [mousex v] to (mouse x)\nset [mousey v] to (mouse y)\nshow variable [mousex v]\nshow variable [mousey v]\n\nwhen [h v] key pressed\nhide variable [mousex v]\nhide variable [mousey v]\n\n@Saw\n\nwhen flag clicked\nhide\n\nwhen I receive [run platformer v]\nshow\ngo to [back v] layer\nforever\n    go to [back v] layer\n    switch costume to (Level)\n    if <(Level) = [6]> then\n        go to x: (0) y: (-80)\n        set size to (50) %\n        show\n    else\n        if <(Level) = [7]> then\n            go to x: (150) y: (-80)\n            set size to (50) %\n            show\n        else\n            hide\n        end\n    end\nend\n\nwhen I receive [run platformer v]\nforever\n    turn right (7) degrees\nend\n\n@Thumbnail\n\nwhen flag clicked\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\n