Red: The Platformer

Instructions: CHECK OUT THE SEQUEL \nhttps://scratch.mit.edu/projects/356556802\n\nWelcome to Red! In this game you"ll control a red cube shaped block and try to complete each level by reaching the portal. \nSpikes- Reset you to beginning of the level\nTrampoline(blue)- Make you bounce \n\nPLEASE FOLLOW\n

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop3 v)\n\nwhen I receive [portal 6 v]\nswitch backdrop to (backdrop2 v)\n\nwhen I receive [portal 7 v]\nswitch backdrop to (backdrop3 v)\n\nwhen I receive [portal 8 v]\nswitch backdrop to (backdrop1 v)\n\n@Red\n\nwhen flag clicked\nset [color v] effect to (0)\nswitch costume to (costume1 v)\nhide\nset size to (80) %\ngo to x: (-210) y: (-109)\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nwait (1.18) seconds\nshow\nforever\n    Platform Gravity: [-1] Jump Height: [10] Side Movement Speed [3] Friction [0.7] Slope: [8]\nend\n\nwhen flag clicked\nforever\n    if <<touching (spikes v)?> or <touching (laserbeam  v)?>> then\n        start sound [Oops v]\n        go to (spawn v)\n    end\nend\n\nwhen I receive [next level v]\nstart sound [Teleport2 v]\ngo to (spawn v)\n\ngo to x: (-208) y: (-98)\n\nwhen flag clicked\nforever\n    play sound [Dance Snare Beat v] until done\nend\n\nwhen flag clicked\nforever\n    if <touching (red portal v)?> then\n        broadcast (Next Level v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (bounce v)?> then\n        set [y velocity v] to [25]\n    end\n    if <touching (down bounce v)?> then\n        set [y velocity v] to [-25]\n    end\nend\n\nwhen I receive [end v]\nforever\n    change [color v] effect by (25)\nend\n\nhide\n\ndefine Platform Gravity: (gravity) Jump Height: (jump height) Side Movement Speed (side movement) Friction (friction) Slope: (slope)\nchange [y velocity v] by (gravity)\nchange y by (Y Velocity)\nif <<touching (level v)?> or <touching (moving platform lv 5 v)?>> then\n    repeat until <not <<touching (level v)?> or <touching (moving platform lv 5 v)?>>>\n        change y by ((([abs v] of (Y Velocity) ) / (Y Velocity)) * (-1))\n    end\n    set [y velocity v] to (<<key (up arrow v) pressed?> and <(([abs v] of (Y Velocity) ) / (Y Velocity)) = [-1]>> * (jump height))\nend\nset [x velocity v] to (((X Velocity) + ((<key (left arrow v) pressed?> * ((side movement) * (-1))) + (<key (right arrow v) pressed?> * (side movement)))) * (friction))\nchange x by (X Velocity)\nset [slope v] to [0]\nrepeat until <<(Slope) = ((slope) * (-1))> or <not <<touching (level v)?> or <touching (moving platform lv 5 v)?>>>>\n    change y by (1)\n    change [slope v] by (-1)\nend\nif <<touching (level v)?> or <touching (moving platform lv 5 v)?>> then\n    change y by (Slope)\n    repeat until <not <<touching (level v)?> or <touching (moving platform lv 5 v)?>>>\n        change x by ((([abs v] of (X Velocity) ) / (X Velocity)) * (-1))\n    end\nend\nif <key (left arrow v) pressed?> then\n    switch costume to (costume2 v)\nend\nif <key (right arrow v) pressed?> then\n    switch costume to (costume1 v)\nend\n\nmove (10) steps\n\n@Level\n\nwhen flag clicked\nset size to (110) %\nswitch costume to (1 v)\ngo to x: (16) y: (10)\n\nwhen I receive [next level v]\nnext costume\nwait (0.01) seconds\nforever\n    if <(costume [name v]) = [2]> then\n        broadcast (Portal 2 v)\n    end\n    if <(costume [name v]) = [3]> then\n        broadcast (Portal 3 v)\n    end\n    if <(costume [name v]) = [4]> then\n        broadcast (Portal 4 v)\n    end\n    if <(costume [name v]) = [5]> then\n        broadcast (Portal 5 v)\n    end\n    if <(costume [name v]) = [6]> then\n        broadcast (Portal 6 v)\n    end\n    if <(costume [name v]) = [7]> then\n        broadcast (Portal 7 v)\n    end\n    if <(costume [name v]) = [8]> then\n        broadcast (Portal 8 v)\n    end\n    if <(costume [name v]) = [9]> then\n        broadcast (End v)\n    end\nend\n\nmove (10) steps\n\n@Logo \n\nwhen flag clicked\nshow\ngo to x: (-10) y: (187)\nglide (0.5) secs to x: (-10) y: (85)\nwait (1.1) seconds\nchange [ghost v] effect by (25)\nwait (0.05) seconds\nchange [ghost v] effect by (25)\nwait (0.05) seconds\nchange [ghost v] effect by (25)\nwait (0.05) seconds\nchange [ghost v] effect by (25)\nhide\n\n@Down Bounce\n\nwhen flag clicked\nhide\n\nwhen I receive [portal 6 v]\nshow\ngo to x: (13) y: (205)\nswitch costume to (costume1 v)\nforever\n    if <touching (red v)?> then\n        switch costume to (costume2 v)\n        wait (0.01) seconds\n        switch costume to (costume1 v)\n    end\nend\n\nwhen I receive [portal 7 v]\nhide\n\n@Logo Part 2\n\nwhen flag clicked\ngo to x: (213) y: (15)\nhide\nwait (0.7) seconds\nshow\nglide (0.5) secs to x: (-10) y: (15)\nwait (0.01) seconds\nplay sound [Snap v] until done\nwait (0.1) seconds\nchange [ghost v] effect by (25)\nwait (0.01) seconds\nchange [ghost v] effect by (25)\nwait (0.01) seconds\nchange [ghost v] effect by (25)\nwait (0.01) seconds\nchange [ghost v] effect by (25)\nhide\n\n@Red Portal\n\nwhen flag clicked\nhide\ngo to x: (222) y: (-92)\nset size to (16) %\nwait (1.18) seconds\nshow\nforever\n    next costume\n    wait (0.01) seconds\nend\n\nwhen I receive [portal 2 v]\ngo to x: (223) y: (154)\n\nwhen I receive [portal 3 v]\ngo to x: (221) y: (120)\n\nwhen I receive [portal 4 v]\ngo to x: (203) y: (1)\n\nwhen I receive [portal 5 v]\ngo to x: (168) y: (-38)\n\nwhen I receive [portal 7 v]\ngo to x: (-216) y: (34)\n\nwhen I receive [portal 8 v]\ngo to x: (-210) y: (10)\n\nwhen I receive [end v]\nhide\n\nset size to (500) %\ngo to [back v] layer\n\n@Spikes\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\nwhen I receive [portal 2 v]\ngo to x: (8) y: (13)\nswitch costume to (costume1 v)\nshow\n\nwhen I receive [portal 3 v]\nswitch costume to (costume2 v)\n\nwhen I receive [portal 4 v]\nswitch costume to (costume3 v)\n\nwhen I receive [portal 6 v]\nhide\n\nwhen I receive [portal 8 v]\nswitch costume to (costume4 v)\nshow\n\nwhen I receive [end v]\nhide\n\nwhen I receive [portal 7 v]\nhide\n\n@Moving Platform Lv 5\n\nwhen flag clicked\ngo to x: (27) y: (-38)\nhide\nforever\n    glide (1) secs to x: (214) y: (-38)\n    glide (1) secs to x: (27) y: (-38)\nend\n\nwhen I receive [portal 5 v]\nshow\n\nwhen I receive [portal 6 v]\nhide\n\nwhen I receive [portal 7 v]\nhide\n\n@Laserbeam \n\nwhen flag clicked\nhide\ngo to [back v] layer\ngo to x: (-21) y: (64)\nforever\n    switch costume to (costume1 v)\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    switch costume to (costume6 v)\n    wait (0.6) seconds\nend\n\nwhen I receive [portal 7 v]\nshow\n\nwhen I receive [portal 8 v]\nhide\n\n@Purple Portal\n\nwhen flag clicked\ngo to x: (-106) y: (6)\nhide\nset size to (16) %\nforever\n    next costume\n    wait (0.01) seconds\nend\n\n@Bounce\n\nwhen I receive [portal 3 v]\nshow\ngo to x: (58) y: (-56)\nswitch costume to (costume1 v)\nforever\n    if <touching (red v)?> then\n        switch costume to (costume2 v)\n        wait (0.1) seconds\n        switch costume to (costume1 v)\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [portal 4 v]\nshow\ngo to x: (-150) y: (-56)\nswitch costume to (costume1 v)\nforever\n    if <touching (red v)?> then\n        switch costume to (costume2 v)\n        wait (0.1) seconds\n        switch costume to (costume1 v)\n    end\nend\n\nwhen I receive [portal 5 v]\nhide\n\nwhen I receive [portal 6 v]\nshow\ngo to x: (13) y: (-52)\nswitch costume to (costume3 v)\nforever\n    if <touching (red v)?> then\n        switch costume to (costume4 v)\n        wait (0.01) seconds\n        switch costume to (costume3 v)\n    end\nend\n\nwhen I receive [portal 7 v]\nhide\n\nwhen I receive [portal 8 v]\nshow\ngo to x: (-73) y: (47)\nswitch costume to (costume1 v)\nforever\n    if <touching (red v)?> then\n        switch costume to (costume2 v)\n        wait (0.1) seconds\n        switch costume to (costume1 v)\n    end\nend\n\nwhen I receive [end v]\nhide\n\n@Sprite1\n\nwhen flag clicked\nhide\nset size to (80) %\n\nshow\n\nshow\n\n@Spawn\n\nwhen flag clicked\nhide\ngo to x: (-197) y: (-98)\n\nwhen flag clicked\nhide variable [time v]\nwait (1.6) seconds\nshow variable [time v]\nset [time v] to [0]\nforever\n    wait (1) seconds\n    change [time v] by (1)\nend\n\nwhen I receive [end v]\nset [☁ high score v] to (Time)\nstop [all v]\n\n@End \n\nwhen flag clicked\nhide\ngo to x: (2) y: (29)\nforever\n    change [color v] effect by (25)\nend\n\nwhen I receive [end v]\nshow\n\n