《✴︎Platformer✴︎》

Instructions: Welcome to my largest ever scratch project, a platformer where you get to play as various Avengers from the MCU (Marvel Cinematic Universe).\nIt contains:\n30 levels\n3 mini boss fights\n1 final boss fight (THANOS)\n6 different heroes with assorted powers\nAll the instructions for how to move are in the project.\nPress p while you are in a level to skip it.\nPress r to restart the level\nThe Button to access the final boss appears in the level select area, it takes a second to load in.\nPosting save codes in the comments literally will not work so please add them here: https://scratch.mit.edu/discuss/topic/368042/?page=1#post-3682429\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nAlso, I have the code for some other heroes, so if you want me to make a sequel please tell me.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nAnd I know it's inaccurate, so please don't comment on how both Vision and Thanos have a Mind Stone.\n\n#game #games #isthishowtagswork? #avengers #marvel #thor #ironman #captainamerica #platformer #thanos

@Stage\n\nwhen I receive [intro done v]\nforever\n    play sound [bensound-deepblue v] until done\nend\n\n@Rover (mars-rover-svgrepo-com)\n\ndefine touch ground\nrepeat until <not <<touching (ground hitbox v)?> or <<touching (rocks v)?> or <touching (platforms v)?>>>>\n    change y by (1)\n    set [speed y v] to [0]\nend\n\ndefine move in direction (dir) speed (spd)\npoint in direction (dir)\nchange x by (spd)\nset [slope v] to [0]\nrepeat until <<(slope) = [6]> or <not <<touching (ground hitbox v)?> or <<touching (rocks v)?> or <touching (platforms v)?>>>>>\n    change y by (1)\n    change [slope v] by (1)\nend\nif <(slope) = [6]> then\n    change x by ((0) - (spd))\n    change y by ((0) - (slope))\nend\n\nwhen I receive [reset level v]\ngo to [front v] layer\npoint in direction (90)\nset rotation style [left-right v]\ngo to x: (-150) y: (-25)\nset [speed y v] to [0]\nforever\n    broadcast (Game Loop v)\nend\n\nwhen I receive [game loop v]\nswitch costume to (hit v)\nchange [speed y v] by (-0.4)\nchange y by (speed y)\nswitch costume to (hit wheels v)\ntouch ground\nswitch costume to (hit v)\nset [moving v] to [0]\nset [speed x v] to ((speed x) * (0.8))\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [speed x v] by (-0.45)\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [speed x v] by (0.45)\nend\nif <(speed x) < [-0.5]> then\n    move in direction [-90] speed (speed x)\n    set [moving v] to [1]\nelse\n    if <(speed x) > [0.5]> then\n        move in direction [90] speed (speed x)\n        set [moving v] to [1]\n    end\nend\nswitch costume to (mars-rover-svgrepo-com v)\nif <<(x position) > [235]> or <touching (lava v)?>> then\n    if <(x position) > [235]> then\n        change [level v] by (1)\n    end\n    broadcast (Reset Level v)\n    stop [this script v]\nend\n\nwhen I receive [intro done v]\nshow variable [level v]\nset [level v] to [1]\nbroadcast (Reset Level v)\n\n@Ground visible\n\nwhen I receive [reset level v]\nswitch costume to (join [Level] (LEVEL))\n\n@Ground hitbox\n\nwhen I receive [reset level v]\nswitch costume to (join [Level] (LEVEL))\n\n@WheelFront\n\nwhen I start as a clone\nset [clone? v] to [true]\nwait (0) seconds\nwait (0) seconds\ngo to [back v] layer\nforever\n    switch costume to (big v)\n    go to (rover \(mars-rover-svgrepo-com\) v)\n    point in direction ([direction v] of [rover \(mars-rover-svgrepo-com\) v])\n    switch costume to (suspension v)\nend\n\ndefine Wheel - Turn and Move\nswitch costume to (big v)\ngo to (rover \(mars-rover-svgrepo-com\) v)\npoint in direction ([direction v] of [rover \(mars-rover-svgrepo-com\) v])\nif <(MOVING) = [1]> then\n    switch costume to (join [Wheel-anim-] (((frame) mod (4)) + (1)))\nelse\n    switch costume to (wheel v)\nend\nchange [frame v] by (1)\ntouch ground\n\ndefine touch ground\nrepeat until <not <<touching (ground hitbox v)?> or <<touching (rocks v)?> or <touching (platforms v)?>>>>\n    change y by (1)\nend\n\nwhen I receive [reset level v]\nwait (0) seconds\nif <(clone?) = [false]> then\n    go to [front v] layer\nend\n\nwhen I receive [intro done v]\nset [frame v] to [0]\nset rotation style [left-right v]\ncreate clone of (_myself_ v)\nset [clone? v] to [false]\nforever\n    Wheel - Turn and Move\nend\n\n@WheelCenter\n\ndefine Wheel - Turn and Move\nswitch costume to (big v)\ngo to (rover \(mars-rover-svgrepo-com\) v)\npoint in direction ([direction v] of [rover \(mars-rover-svgrepo-com\) v])\nif <(MOVING) = [1]> then\n    switch costume to (join [Wheel-anim-] (((frame) mod (4)) + (1)))\nelse\n    switch costume to (wheel v)\nend\nchange [frame v] by (1)\ntouch ground\n\nwhen I start as a clone\nset [clone? v] to [true]\nwait (0) seconds\nwait (0) seconds\ngo to [back v] layer\nforever\n    switch costume to (big v)\n    go to (rover \(mars-rover-svgrepo-com\) v)\n    point in direction ([direction v] of [rover \(mars-rover-svgrepo-com\) v])\n    switch costume to (suspension v)\nend\n\ndefine touch ground\nrepeat until <not <<touching (ground hitbox v)?> or <<touching (rocks v)?> or <touching (platforms v)?>>>>\n    change y by (1)\nend\n\nwhen I receive [reset level v]\nwait (0) seconds\nif <(clone?) = [false]> then\n    go to [front v] layer\nend\n\nwhen I receive [intro done v]\nset [frame v] to [0]\nset rotation style [left-right v]\ncreate clone of (_myself_ v)\nset [clone? v] to [false]\nforever\n    Wheel - Turn and Move\nend\n\n@WheelRear\n\ndefine Wheel - Turn and Move\nswitch costume to (big v)\ngo to (rover \(mars-rover-svgrepo-com\) v)\npoint in direction ([direction v] of [rover \(mars-rover-svgrepo-com\) v])\nif <(MOVING) = [1]> then\n    switch costume to (join [Wheel-anim-] (((frame) mod (4)) + (1)))\nelse\n    switch costume to (wheel v)\nend\nchange [frame v] by (1)\ntouch ground\n\nwhen I start as a clone\nset [clone? v] to [true]\nwait (0) seconds\nwait (0) seconds\ngo to [back v] layer\nforever\n    switch costume to (big v)\n    go to (rover \(mars-rover-svgrepo-com\) v)\n    point in direction ([direction v] of [rover \(mars-rover-svgrepo-com\) v])\n    switch costume to (suspension v)\nend\n\ndefine touch ground\nrepeat until <not <<touching (ground hitbox v)?> or <<touching (rocks v)?> or <touching (platforms v)?>>>>\n    change y by (1)\nend\n\nwhen I receive [reset level v]\nwait (0) seconds\nif <(clone?) = [false]> then\n    go to [front v] layer\nend\n\nwhen I receive [intro done v]\nset [frame v] to [0]\nset rotation style [left-right v]\ncreate clone of (_myself_ v)\nset [clone? v] to [false]\nforever\n    Wheel - Turn and Move\nend\n\n@Sat1 (satellite-svgrepo-com)\n\nwhen I start as a clone\ngo to [front v] layer\nswitch costume to (atmo-haze v)\nforever\n    go to (sat1 \(satellite-svgrepo-com\) v)\n    if <touching (_edge_ v)?> then\n        delete this clone\n    end\nend\n\nwhen I receive [intro done v]\nswitch costume to (satellite-svgrepo-com v)\nforever\n    hide\n    wait (pick random (50) to (75)) seconds\n    show\n    set [ghost v] effect to (50)\n    create clone of (_myself_ v)\n    go to x: (-240) y: (115)\n    glide (8) secs to x: (0) y: (160)\n    glide (8) secs to x: (240) y: (115)\n    hide\nend\n\n@Sat2 (satellite-svgrepo-com)\n\nwhen I start as a clone\ngo to [front v] layer\nswitch costume to (atmo-haze v)\nforever\n    go to (sat2 \(satellite-svgrepo-com\) v)\n    if <touching (_edge_ v)?> then\n        delete this clone\n    end\nend\n\nwhen I receive [intro done v]\nswitch costume to (satellite-svgrepo-com v)\nforever\n    hide\n    wait (pick random (80) to (105)) seconds\n    show\n    set [ghost v] effect to (50)\n    create clone of (_myself_ v)\n    go to x: (-240) y: (115)\n    glide (8) secs to x: (0) y: (160)\n    glide (8) secs to x: (240) y: (115)\n    hide\nend\n\n@Phobos (asteroid-svgrepo-com)\n\nwhen I start as a clone\ngo to [front v] layer\nswitch costume to (atmo-haze v)\nforever\n    go to (phobos \(asteroid-svgrepo-com\) v)\n    if <touching (_edge_ v)?> then\n        delete this clone\n    end\nend\n\nwhen I receive [intro done v]\nswitch costume to (asteroid-svgrepo-com v)\nforever\n    hide\n    wait (pick random (15) to (30)) seconds\n    show\n    set [ghost v] effect to (50)\n    create clone of (_myself_ v)\n    go to x: (-240) y: (115)\n    glide (8) secs to x: (0) y: (160)\n    glide (8) secs to x: (240) y: (115)\n    hide\nend\n\n@Deimos (asteroid-svgrepo-com)\n\nwhen I start as a clone\ngo to [front v] layer\nswitch costume to (atmo-haze v)\nforever\n    go to (deimos \(asteroid-svgrepo-com\) v)\n    if <touching (_edge_ v)?> then\n        delete this clone\n    end\nend\n\nwhen I receive [intro done v]\nswitch costume to (asteroid-svgrepo-com v)\nforever\n    hide\n    wait (pick random (25) to (45)) seconds\n    show\n    set [ghost v] effect to (50)\n    create clone of (_myself_ v)\n    go to x: (-240) y: (50)\n    glide (8) secs to x: (0) y: (75)\n    glide (8) secs to x: (240) y: (50)\n    hide\nend\n\n@Spaceship (spaceship-svgrepo-com)\n\nwhen I receive [reset level v]\nset [speed y v] to [0]\nif <(LEVEL) < [9]> then\n    hide\nelse\n    show\n    go to x: (109) y: (-38)\n    forever\n        if <touching (rover \(mars-rover-svgrepo-com\) v)?> then\n            broadcast (You Win v)\n            repeat (30)\n                change [speed y v] by (1)\n                change y by (speed y)\n            end\n        end\n    end\nend\n\n@Laser Cam\n\ndefine Main Loop\nswitch costume to (big v)\ngo to x: (([x position v] of [rover \(mars-rover-svgrepo-com\) v]) + ((32) * (([direction v] of [rover \(mars-rover-svgrepo-com\) v]) / (90)))) y: (([y position v] of [rover \(mars-rover-svgrepo-com\) v]) + (23))\nif <([direction v] of [rover \(mars-rover-svgrepo-com\) v]) = [90]> then\n    switch costume to (cam v)\nelse\n    switch costume to (camflip v)\nend\npoint towards (mouse-pointer v)\nif <([direction v] of [rover \(mars-rover-svgrepo-com\) v]) = [90]> then\n    if <(direction) < [60]> then\n        point in direction (60)\n        stop [this script v]\n    end\n    if <(direction) > [120]> then\n        point in direction (120)\n        stop [this script v]\n    end\nelse\n    turn right (180) degrees\n    if <(direction) < [60]> then\n        point in direction (60)\n        stop [this script v]\n    end\n    if <(direction) > [120]> then\n        point in direction (120)\n        stop [this script v]\n    end\nend\n\nwhen I receive [reset level v]\nwait (0.000000000000001) seconds\ngo to [front v] layer\nforever\n    Main Loop\nend\n\n@Mouse guide\n\nwhen I receive [reset level v]\nwait (0.00000000000001) seconds\ngo to [front v] layer\nforever\n    go to (mouse-pointer v)\nend\n\n@Laser\n\ndefine Find Solid Ground\npen down\nrepeat until <<touching (ground hitbox v)?> or <<touching (rocks v)?> or <<touching (platforms v)?> or <touching (_edge_ v)?>>>>\n    move (1) steps\nend\npen up\n\nwhen I receive [intro done v]\nset volume to (70) %\nset pen color to (#ff0000)\nforever\n    if <([direction v] of [rover \(mars-rover-svgrepo-com\) v]) = [-90]> then\n        point in direction (([direction v] of [laser cam v]) + (180))\n    else\n        point in direction ([direction v] of [laser cam v])\n    end\n    go to (laser cam v)\n    erase all\n    if <mouse down?> then\n        Find Solid Ground\n        start sound [Pew v]\n    end\nend\n\n@Rocks\n\nwhen I receive [reset level v]\nswitch costume to (blank v)\nswitch costume to (join [Level] (LEVEL))\nif <(LEVEL) = [7]> then\n    switch costume to (level7-3 v)\n    create clone of (_myself_ v)\n    switch costume to (level7-2 v)\n    create clone of (_myself_ v)\n    switch costume to (level7-1 v)\nend\nif <(LEVEL) = [8]> then\n    switch costume to (level8-2 v)\n    create clone of (_myself_ v)\n    switch costume to (level8-1 v)\nend\n\nwhen I receive [reset level v]\nshow\nset [damage v] to [0]\nforever\n    if <touching (laser v)?> then\n        change [damage v] by (1)\n    end\n    if <(damage) > [99]> then\n        hide\n    end\nend\n\nwhen I start as a clone\nshow\nset [damage v] to [0]\nforever\n    if <touching (laser v)?> then\n        change [damage v] by (1)\n    end\n    if <(damage) > [99]> then\n        delete this clone\n    end\nend\n\n@Text\n\nwhen I receive [reset level v]\nswitch costume to (join [Level] (LEVEL))\n\n@Lava\n\nwhen I receive [reset level v]\ngo to [back v] layer\nswitch costume to (blank v)\nswitch costume to (join [Level] (LEVEL))\n\n@Platforms\n\nwhen I receive [reset level v]\ngo to x: (0) y: (0)\nset [speed y v] to [0]\ngo to [back v] layer\nswitch costume to (blank v)\nswitch costume to (join [Level] (LEVEL))\nif <(LEVEL) = [8]> then\n    switch costume to (level8-2 v)\n    create clone of (_myself_ v)\n    switch costume to (level8-1 v)\nend\nif <(LEVEL) < [8]> then\n    delete this clone\nend\nforever\n    change [speed y v] by (-0.4)\n    change y by (speed y)\n    touch ground\nend\n\ndefine touch ground\nrepeat until <not <<touching (ground hitbox v)?> or <<touching (rocks v)?> or <touching (platforms v)?>>>>\n    change y by (1)\n    set [speed y v] to [0]\nend\n\nwhen I start as a clone\nforever\n    change [speed y v] by (-0.4)\n    change y by (speed y)\n    touch ground\nend\n\nwhen I receive [reset level v]\ndelete this clone\n\n@Win\n\nwhen I receive [you win v]\nstart sound [Win v]\nset size to (100) %\ngo to [front v] layer\nshow\nrepeat (30)\n    go to (spaceship \(spaceship-svgrepo-com\) v)\n    change y by (-100)\nend\nrepeat (12)\n    change size by (15)\nend\nglide (0.5) secs to x: (0) y: (0)\nstop [all v]\n\nwhen flag clicked\nhide\n\n@Sound Effects\n\ndefine sound\nrepeat (20)\n    if <(MOVING) = [1]> then\n        play sound [Space Noise v] until done\n    end\nend\n\nwhen I receive [intro done v]\nset volume to (55) %\nforever\n    sound\nend\n\n@Thumbnail\n\nwhen I receive [game loop v]\nset [ghost v] effect to (100)\ngo to [front v] layer\n\n@Intro\n\nwhen I receive [intro start v]\ngo to [front v] layer\nswitch costume to (orange v)\nsetup\nset [ghost v] effect to (100)\nrepeat ([floor v] of ((100) / (3)) )\n    change [ghost v] effect by (-3)\nend\nset [ghost v] effect to (0)\nwait (1) seconds\nbroadcast (Fade out v)\n\nwhen flag clicked\nhide variable [level v]\nbroadcast (Intro Start v)\n\nwhen I receive [fade out v]\nif <not <(costume [number v]) = [1]>> then\n    repeat ([floor v] of ((100) / (3)) )\n        change [ghost v] effect by (3)\n    end\n    set [ghost v] effect to (100)\n    wait (0.5) seconds\n    broadcast (delete all clones v)\n    broadcast (Intro Done v)\nend\n\ndefine setup\nrepeat (2)\n    create clone of (_myself_ v)\n    next costume\nend\n\nwhen I receive [delete all clones v]\ndelete this clone\n\n