1.1k Platformer Engine!!              #All #Games #Art #Music #Animations
@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop2 v)\n\nwhen I receive [-intro done  v]\nforever\n    play sound (pick random (1) to (5)) until done\nend\n\n@Blank\n\n@Intro\n\ndefine Icon Code\ngo to x: (([sin v] of (((timer) * (50)) + (((60) * ((2) - (1))) + (120))) ) * (75)) y: (([cos v] of (((timer) * (50)) + (((60) * ((2) - (1))) + (120))) ) * (50))\nset size to ((100) + (([cos v] of (((timer) * (50)) + (((60) * ((2) - (1))) + (120))) ) * (-25))) %\n\ndefine Smooth Glide: (x) (y) (smoothness)\nrepeat until <<(round (x position)) = (x)> and <(round (y position)) = (y)>>\n    change x by (((x) - (x position)) / (smoothness))\n    change y by (((y) - (y position)) / (smoothness))\nend\n\nwhen flag clicked\nhide\n\ndefine Clone (id)\nset [clone id v] to (id)\ncreate clone of (_myself_ v)\nwait (0.01) seconds\n\nwhen I start as a clone\nshow\nclear graphic effects\ngo to [front v] layer\npoint in direction (90)\n\nwhen I start as a clone\nif <(clone ID) = [1]> then\n    switch costume to (costume1 v)\n    go to x: (0) y: (-400)\n    wait (.1) seconds\n    Smooth Glide: [0] [0] [7]\n    wait (4) seconds\n    Clone [Press Start]\n    forever\n        go to [back v] layer\n    end\nend\n\nwhen I start as a clone\nif <(clone ID) = [Press Start]> then\n    forever\n        change y by (yv)\n    end\nend\n\nwhen I start as a clone\nif <(clone ID) = [Press Start]> then\n    set size to (100) %\n    go to x: (0) y: (-400)\n    switch costume to (press start v)\n    set [yv v] to [40]\n    broadcast (Intro time v)\n    repeat ((yv) + (5))\n        change [yv v] by (-2)\n    end\n    \nend\n\ndefine Wait Until (beat)\nwait until <(beat) < (timer)>\n\nwhen I start as a clone\nif <(clone ID) = [Chevron]> then\n    if <(a) = [.]> then\n        go to x: (0) y: (0)\n        switch costume to (chevron v)\n        set size to (100) %\n        show\n        repeat (5)\n            switch costume to (size hack v)\n            change size by (10)\n            switch costume to (chevron v)\n        end\n        wait (0) seconds\n        repeat (45)\n            switch costume to (size hack v)\n            change size by (10)\n            switch costume to (chevron v)\n        end\n    else\n        go to [back v] layer\n    end\nend\n\nwhen I receive [intro time v]\nwait (1) seconds\nforever\n    if <(a) = [.]> then\n        Clone [Chevron]\n        wait (.7) seconds\n    end\nend\n\ndefine Shake (effect) (power)\nset size to (effect) %\ngo to x: (0) y: (-100)\nrepeat (26)\n    change size by (((100) - (size)) / (10))\n    go to x: (([sin v] of ((timer) * (1000)) ) * (((size) - (100)) * (0.1))) y: (([sin v] of ((timer) * (800)) ) * (((size) - (100)) * (power)))\n    if <(a) = [.]> then\n        go to [front v] layer\n    else\n        go to [back v] layer\n    end\nend\n\nwhen I receive [intro time v]\nwait (1.5) seconds\nClone [Name]\nClone [Logo]\nwait (.356) seconds\nClone [Lineshock1]\nClone [Lineshock2]\n\nwhen I start as a clone\nif <(clone ID) = [Name]> then\n    go to x: (0) y: (-100)\n    switch costume to (name v)\n    set size to (100) %\n    show\n    forever\n        Shake [200] [1.5]\n    end\nend\n\ndefine Dance (basedirection) (smoothnessvariant) (speed) (multiplier) (calculatingbase) (momentum) (costume)\nswitch costume to (costume)\npoint in direction ((([sin v] of (((calculatingbase) + (smoothnessvariant)) * (speed)) ) * (multiplier)) + (basedirection))\nset x to (([sin v] of ((calculatingbase) * (speed)) ) * (momentum))\n\nwhen I start as a clone\nif <(clone ID) = [Logo]> then\n    go to x: (0) y: (0)\n    switch costume to (costume2 v)\n    set size to (100) %\n    forever\n        Shake [50] [2]\n    end\nend\n\nwhen I start as a clone\nif <(clone ID) = [Logo]> then\n    go to x: (0) y: (0)\n    switch costume to (costume2 v)\n    set size to (100) %\n    forever\n        Dance [90] [-20] [300] [15] (timer) [40] []\n    end\nend\n\nwhen I start as a clone\nif <(clone ID) = [Lineshock1]> then\n    hide\n    wait (0.01) seconds\n    show\n    go to x: (120) y: (0)\n    set size to (50) %\n    repeat (10)\n        broadcast (Sparkle v)\n        switch costume to (lineshock1 v)\n        repeat (18)\n            next costume\n        end\n        switch costume to (lineshock19 v)\n        wait (1) seconds\n    end\nend\n\nwhen I start as a clone\nif <(clone ID) = [Lineshock2]> then\n    show\n    go to x: (-120) y: (0)\n    set size to (50) %\n    repeat (10)\n        broadcast (Sparkle v)\n        switch costume to (lineshock1 v)\n        repeat (18)\n            next costume\n        end\n        switch costume to (lineshock19 v)\n        wait (1) seconds\n    end\nend\n\nwhen I start as a clone\nif <(clone ID) = [Sparkle]> then\n    set size to (pick random (30) to (50)) %\n    go to (random position v)\n    switch costume to (sparkle v)\n    set [brightness v] effect to (100)\n    repeat (4)\n        change size by (25)\n    end\n    wait (.1) seconds\n    repeat (4)\n        change size by (-25)\n    end\n    delete this clone\nend\n\nwhen I receive [sparkle v]\nClone [Sparkle]\n\nwhen I start as a clone\nif <(clone ID) = [Bar1]> then\n    go to x: (-400) y: (120)\n    set size to (100) %\n    switch costume to (costume3 v)\n    Smooth Glide: [0] [120] [8.5]\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nend\n\nwhen I start as a clone\nif <(clone ID) = [Bar2]> then\n    go to x: (-400) y: (0)\n    set size to (100) %\n    switch costume to (costume3 v)\n    Smooth Glide: [0] [0] [8.5]\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nend\n\nwhen I start as a clone\nif <(clone ID) = [Bar3]> then\n    go to x: (-400) y: (-120)\n    set size to (100) %\n    switch costume to (costume3 v)\n    Smooth Glide: [0] [-120] [8.5]\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    broadcast (-intro done  v)\nend\n\nwhen I start as a clone\nif <(clone ID) = [Bar1]> then\n    forever\n        go to [front v] layer\n    end\nend\n\nwhen I start as a clone\nif <(clone ID) = [Bar2]> then\n    forever\n        go to [front v] layer\n    end\nend\n\nwhen I start as a clone\nif <(clone ID) = [Bar3]> then\n    forever\n        go to [front v] layer\n    end\nend\n\nwhen I receive [-intro done  v]\nhide\nstop all sounds\nclear sound effects\ndelete this clone\n\nwhen I receive [b v]\nhide\nClone [1]\nset [yv v] to [0]\nset [a v] to [.]\nplay sound [MDK- Press Start v] until done\nset [a v] to [.-.]\nClone [Bar1]\nwait (.5) seconds\nClone [Bar2]\nwait (.5) seconds\nClone [Bar3]\n\nwhen I receive [start v]\nbroadcast (b v)\n\nset [color v] effect to (70)\n\nchange [color v] effect by (25)\n\nchange [color v] effect by (25)\n\nset [color v] effect to (70)\n\n@Player\n\nwhen flag clicked\nforever\n    if <key (r v) pressed?> then\n        wait until <not <key (r v) pressed?>>\n        go to x: (-190) y: (0)\n        set [playerx v] to [0]\n        set [playery v] to [0]\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (s v) pressed?> then\n        wait until <not <key (s v) pressed?>>\n        change [level v] by (1)\n        go to x: (-190) y: (0)\n        set [playerx v] to [0]\n        set [playery v] to [0]\n    end\n    if <(Level) = [7]> then\n        stop [this script v]\n    end\nend\n\ndefine Player Physics\ngo to [front v] layer\ngo [backward v] (9) layers\nif <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>>> then\n    change [playerx v] by (1.5)\n    switch costume to (player - right v)\nend\nif <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>>> then\n    change [playerx v] by (-1.5)\n    switch costume to (player - left v)\nend\nif <<<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>>> and <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>>> then\n    switch costume to (player - upright v)\nend\nif <<<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>>> and <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>>> then\n    switch costume to (player - upleft v)\nend\nif <not <<key (right arrow v) pressed?> or <<key (left arrow v) pressed?> or <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<key (a v) pressed?> or <<key (d v) pressed?> or <<<mouse down?> and <(mouse x) > (x position)>> or <<mouse down?> and <(mouse x) < (x position)>>>>>>>>>> then\n    switch costume to (player - normal v)\nend\nif <<key (down arrow v) pressed?> or <<key (s v) pressed?> or <<mouse down?> and <(mouse y) < (y position)>>>> then\n    switch costume to (player - bent v)\nend\nif <touching (water v)?> then\n    change [playery v] by (-0.5)\nend\nchange x by (PlayerX)\nif <touching (platforms v)?> then\n    change x by ((PlayerX) * (-1))\n    if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n        if <(PlayerX) > [0]> then\n            set [playerx v] to [-15]\n            set [playery v] to [10]\n        else\n            set [playerx v] to [15]\n            set [playery v] to [10]\n        end\n    else\n        set [playerx v] to [0]\n    end\nelse\n    set [playerx v] to ((PlayerX) * (0.8))\nend\nchange y by (PlayerY)\nif <touching (platforms v)?> then\n    change y by ((PlayerY) * (-1))\n    set [playery v] to [0]\n    if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n        switch costume to (player - up v)\n        if <(Jumping?) = [yes]> then\n            set [playery v] to [12]\n            set [jumping? v] to [no]\n        end\n    end\nelse\n    change [playery v] by (-1)\n    set [jumping? v] to [yes]\nend\nif <(x position) > [239]> then\n    change [level v] by (1)\n    go to x: (-190) y: (20)\n    set [playerx v] to [0]\n    set [playery v] to [0]\nend\nif <touching (bouncy v)?> then\n    if <(Jumping?) = [yes]> then\n        set [playery v] to [16]\n        set [jumping? v] to [no]\n    end\nend\nif <<<touching (danger v)?> or <(y position) < [-178]>> or <<touching (saws v)?> or <touching (lava v)?>>> then\n    go to x: (-190) y: (50)\n    set [playerx v] to [0]\n    set [playery v] to [0]\n    change [death v] by (1)\nend\n\nwhen I receive [-intro done  v]\nshow\npoint in direction (90)\ngo to x: (-190) y: (20)\nset [playerx v] to [0]\nset [playery v] to [0]\nforever\n    Player Physics\nend\n\nwhen flag clicked\nhide\nset [level v] to [1]\nset [death v] to [0]\nset [signal v] to [disactivated]\nhide variable [death v]\n\n@Platforms\n\nwhen I receive [-intro done  v]\nshow\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [intro time v]\nhide\n\n@Danger\n\nwhen I receive [-intro done  v]\nshow\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\n\n@Saws\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\nforever\n    if <(Level) = [4]> then\n        show\n        go to [back v] layer\n    end\n    if <(Level) = [5]> then\n        hide\n    end\n    turn right (5) degrees\nend\n\nwhen I receive [end v]\nhide\n\n@Bouncy\n\nwhen flag clicked\nhide\nset [ghost v] effect to (100)\nswitch costume to (costume1 v)\nforever\n    if <(Level) = [6]> then\n        show\n        set [ghost v] effect to (0)\n        go to x: (-130) y: (-50)\n    else\n        hide\n        set [ghost v] effect to (100)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        repeat (7)\n            next costume\n        end\n    end\nend\n\nwhen I receive [end v]\nhide\n\n@Thumbnail\n\nwhen flag clicked\nshow\ngo to [front v] layer\nset [ghost v] effect to (0)\nwait (3) seconds\nrepeat (30)\n    change [ghost v] effect by (5)\nend\nbroadcast (Start v)\n\n@Text\n\nwhen flag clicked\nhide\n\nwhen I receive [end v]\nhide\n\nwhen I receive [-intro done  v]\nshow\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\nend\n\n@Lava\n\nwhen flag clicked\nshow\nforever\n    switch costume to (Level)\nend\n\nwhen I receive [end v]\nhide\n\nwhen flag clicked\ngo to x: (87) y: (-50)\nforever\n    repeat (30)\n        change y by (-0.4)\n    end\n    repeat (30)\n        change y by (0.4)\n    end\nend\n\n@Water\n\nwhen flag clicked\nshow\nforever\n    switch costume to (Level)\nend\n\nwhen I receive [end v]\nhide\n\n@Clouds\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (60)\ngo to x: (-240) y: (pick random (180) to (0))\nrepeat until <(x position) = [362]>\n    change x by (2)\nend\ndelete this clone\n\nwhen I receive [-intro done  v]\ngo to [back v] layer\nforever\n    switch costume to (pick random (1) to (3))\n    wait (pick random (3) to (5)) seconds\n    create clone of (_myself_ v)\nend\n\n@Textboards\n\nwhen flag clicked\nhide\nforever\n    if <(Level) = [6]> then\n        show\n        go to x: (70) y: (48)\n        switch costume to (costume1 v)\n        if <touching (player v)?> then\n            switch costume to (costume2 v)\n        end\n    else\n        hide\n    end\nend\n\n@Assests\n\nwhen flag clicked\nhide\n\n
-----------------------1.1k platformer engine--------------------\n\nHello and welcome to this platformer engine!!\n\n11k views, 600+ loves and 500+ favs and 50+ remixes?! THANKS A LOT!!!\n\nREAD EVERYTHING:\n❗❗❗ YOU CAN ADVERTISE THE PROJECTS MADE BY YOU USING THIS ENGINE IN THE COMMENTS. BUT OTHER ADS WILL BE REPORTED OR DELETED!!! ❗❗❗\n\n★ About this engine ★\nSo, I spent about 2 weeks in total and over 65+ hours in making this! I made this for my 1.1k followers :)\nFeatures:\n✔ Player\n✔ Platform\n✔ Spikes\n✔ Saws\n✔ Lava\n✔ Water\n✔ Trampoline\n✔ Clouds\n✔ Textboards\n✔ Crouch\n✔ Skip\n✔ Restart\n\n★ Why I made this ★\nWell, so I hear that many people want to make platformers but don't know the code, on how to make it. Also, a lot of people asked me to make a platformer engine.\nControls:\n<^>, WASD or mobile to move\nS to skip a level\nR to restart a level\nDown arrow to crouch\n\n★ How do I use it? ★\nWell, there are 2 ways: 1) By remixing this project and making you're own game. 2) Go to File > Save to your computer > Open a new Scratch Editor > File > Load from your computer > Select\n\nPlease propose it to be featured:\nhttps://scratch.mit.edu/studios/28715018/\n\n\nScrolling platformer engine coming soon =)\n\nQ & A:\n\nQ: Where did you get the font from?\nA: Search up 'Google Drawings' and click on the first link. And then select your own font! I usually use 'Fredoka One', 'Righteous' or 'Rubik Mono One' fonts!\nQ: What about the font of the title?!\nA: I got it from maketext.io, and the font is 'BalooBhaiaan'\n___________________________________________\n\nWell, so I added a free tutorial and an assets sprite inside! You can change the art from the assets sprite :D\nCan we please get it on trending? I'd be very happy if you all do! Also, I want lots of people to see this, so that they can make their own platformers!\n--------------------------------Credits-------------------------------\n@theCharpy for the amazing intro ( Recolored by me )\n@-xaf, @InfinityCloud and @pranavhaha for the music.\n100% art by me\n100% code by me\n------------------------Famous ❤️ and ⭐----------------------\n@Indian-Programmer ❤️!!\n@cesa23 ❤️!!\n@jas6kaur6 ❤️!!\n@FinityCode ❤️!!