scrolling platformer engine!
@Stage\n\nwhen flag clicked\nswitch backdrop to (descarga2 v)\n\nwhen I receive [level 6 v]\nswitch backdrop to (descarga3 v)\n\nwhen I receive [level 7 v]\nswitch backdrop to (descarga2 v)\n\nwhen flag clicked\nforever\n    set volume to (40) %\n    play sound [Waterflame-Electroman-Adventures-V3 v] until done\nend\n\n@player\n\ndefine plataform gravity: (gravity) jump heigh: (jump heigh) side movement speed: (side movement) friction (friction) slope: (slope)\nchange [y velocity v] by (gravity)\nchange y by (y velocity)\nif <<touching (plataforma v)?> or <touching (bloqueo v)?>> then\n    repeat until <not <<touching (plataforma v)?> or <touching (bloqueo 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 heigh))\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 (plataforma v)?> or <touching (bloqueo v)?>>>>\n    change y by (1)\n    change [slope v] by (-1)\nend\nif <<touching (plataforma v)?> or <touching (bloqueo v)?>> then\n    change y by (slope)\n    repeat until <not <<touching (plataforma v)?> or <touching (bloqueo v)?>>>\n        change x by ((([abs v] of (x velocity) ) / (x velocity)) * (-1))\n    end\nend\n\nwhen flag clicked\nset drag mode [not draggable v]\ngo to x: (0) y: (100)\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nforever\n    plataform gravity: [-1] jump heigh: [15] side movement speed: [3] friction [0.7] slope: [8]\nend\n\nset [y velocity v] to [-4]\n\nwhen flag clicked\nshow\nforever\n    set rotation style [left-right v]\n    if <key (right arrow v) pressed?> then\n        point in direction (-90)\n    end\n    if <key (left arrow v) pressed?> then\n        point in direction (90)\n    end\nend\n\nwhen I receive [level1 v]\npoint in direction (-90)\ngo to x: (-210) y: (0)\n\nwhen I receive [level 2 v]\npoint in direction (-90)\ngo to x: (-51) y: (-80)\n\nwhen I receive [level3 v]\npoint in direction (-90)\ngo to x: (-197) y: (-60)\n\nwhen I receive [jump v]\nstart sound [Boing v]\nrepeat (40)\n    change y by (10)\nend\n\nwhen I receive [dead v]\nstart sound [Bonk v]\ngo to x: (-197) y: (-60)\n\nwhen I receive [level 4 v]\npoint in direction (-90)\ngo to x: (-190) y: (-60)\n\nwhen I receive [level 5 v]\npoint in direction (-90)\ngo to x: (-200) y: (-60)\n\nwhen flag clicked\nswitch costume to (player v)\nshow\nforever\n    if <touching (flag v)?> then\n        start sound [woohoo v]\n        broadcast (level 2 v)\n    end\nend\n\nwhen I receive [level 2 v]\nforever\n    if <touching (flag v)?> then\n        start sound [woohoo v]\n        broadcast (level3 v)\n    end\nend\n\nwhen I receive [level3 v]\nforever\n    if <touching (flag v)?> then\n        start sound [woohoo v]\n        broadcast (level 4 v)\n    end\nend\n\nwhen I receive [level 4 v]\nforever\n    if <touching (flag v)?> then\n        start sound [woohoo v]\n        broadcast (level 5 v)\n    end\nend\n\nwhen I receive [level 5 v]\nforever\n    if <touching (flag v)?> then\n        start sound [woohoo v]\n        broadcast (level 6 v)\n    end\nend\n\nwhen I receive [level 6 v]\nforever\n    if <touching (flag v)?> then\n        start sound [woohoo v]\n        broadcast (level 7 v)\n    end\nend\n\nwhen I receive [level 6 v]\npoint in direction (-90)\ngo to x: (-22) y: (-153)\nforever\n    if <touching (elevator v)?> then\n        broadcast (subir v)\n        glide (1) secs to x: (-93) y: (-152)\n        hide\n        point in direction (90)\n        glide (2) secs to x: (-103) y: (39)\n        show\n        point in direction (90)\n        glide (1) secs to x: (-36) y: (39)\n        point in direction (90)\n    end\nend\n\nwhen I receive [level 7 v]\nforever\n    if <touching (flag v)?> then\n        play sound [Video Game 1 v] until done\n        broadcast (end v)\n    end\nend\n\nwhen I receive [level 7 v]\npoint in direction (-90)\ngo to x: (-203) y: (-153)\nforever\n    if <touching (elevator2 v)?> then\n        broadcast (subir v)\n        glide (1) secs to x: (39) y: (5)\n        hide\n        point in direction (90)\n        glide (2) secs to x: (39) y: (130)\n        show\n        point in direction (90)\n        glide (1) secs to x: (120) y: (130)\n        point in direction (90)\n    end\nend\n\nwhen I receive [end v]\nhide\n\nwhen flag clicked\nwait until <(level) = [8]>\nbroadcast (level 8 v)\n\nwhen I receive [egg v]\nset drag mode [draggable v]\n\nwhen flag clicked\nwait until <(level) = [9]>\nbroadcast (LEVEL 9 v)\n\nwhen flag clicked\nwait until <(level) = [10]>\nbroadcast (level 11 v)\n\nwhen flag clicked\nwait until <(level) = [11]>\nbroadcast (level 12 v)\n\nwhen flag clicked\nwait until <(level) = [12]>\nbroadcast (level 13 v)\n\nwhen flag clicked\npoint in direction (-90)\ngo to x: (-203) y: (-153)\nforever\n    if <touching (elevator3 v)?> then\n        broadcast (subir v)\n        glide (1) secs to x: (39) y: (5)\n        hide\n        point in direction (90)\n        glide (2) secs to x: (39) y: (130)\n        show\n        point in direction (90)\n        glide (1) secs to x: (120) y: (130)\n        point in direction (90)\n    end\nend\n\nwhen flag clicked\nwait until <(level) = [13]>\nbroadcast (end v)\n\n@plataforma\n\nwhen flag clicked\nset [level v] to [0]\nswitch costume to (level 1 v)\nchange [level v] by (1)\n\nwhen I receive [level 2 v]\nswitch costume to (level 2 v)\nchange [level v] by (1)\n\nwhen I receive [level3 v]\nswitch costume to (level 3 v)\n\nwhen I receive [level 4 v]\nswitch costume to (level 4 v)\n\nwhen I receive [level 5 v]\nswitch costume to (level 5 v)\n\nwhen I receive [level 6 v]\nswitch costume to (level 6 v)\n\nwhen I receive [level 7 v]\nswitch costume to (level 7 v)\n\nwhen I receive [end v]\nswitch costume to (level 1 v)\n\nwhen flag clicked\nwait until <(level) = [8]>\nswitch costume to (level 8 v)\n\nwhen flag clicked\nwait until <(level) = [9]>\nswitch costume to (level 9 v)\n\nwhen flag clicked\nwait until <(level) = [10]>\nswitch costume to (level 10 v)\n\nwhen flag clicked\nwait until <(level) = [11]>\nswitch costume to (level 11 v)\n\nwhen flag clicked\nwait until <(level) = [12]>\nswitch costume to (level 12 v)\n\n@flag\n\nwhen flag clicked\nbroadcast (level1 v)\nset rotation style [left-right v]\npoint in direction (-90)\nhide\ngo to x: (220) y: (-144)\nset [pixelate v] effect to (100)\nshow\nrepeat (50)\n    change [pixelate v] effect by (-2)\nend\n\nwhen I receive [level 2 v]\npoint in direction (90)\nhide\ngo to x: (-200) y: (-144)\nset [pixelate v] effect to (100)\nshow\nrepeat (50)\n    change [pixelate v] effect by (-2)\nend\n\nwhen I receive [level3 v]\npoint in direction (-90)\nhide\ngo to x: (212) y: (-144)\nset [pixelate v] effect to (100)\nshow\n\nwhen I receive [level 4 v]\npoint in direction (-90)\nhide\ngo to x: (212) y: (82)\nset [pixelate v] effect to (100)\nshow\n\nwhen I receive [level 5 v]\npoint in direction (-90)\nhide\ngo to x: (212) y: (-145)\nset [pixelate v] effect to (100)\nshow\n\nwhen I receive [level 6 v]\npoint in direction (-90)\nhide\ngo to x: (212) y: (-145)\nset [pixelate v] effect to (100)\nshow\n\nwhen I receive [level 7 v]\npoint in direction (-90)\nhide\ngo to x: (212) y: (-145)\nset [pixelate v] effect to (100)\nshow\n\nwhen I receive [level 8 v]\npoint in direction (-90)\nhide\ngo to x: (212) y: (-145)\nset [pixelate v] effect to (100)\nshow\n\nwhen I receive [end v]\nhide\n\n@bola\n\nwhen flag clicked\nswitch costume to (1 v)\nhide\n\nwhen I receive [level3 v]\nshow\nset size to (100) %\ngo to x: (-98) y: (-136)\nforever\n    if <touching (player v)?> then\n        broadcast (jump v)\n        repeat (4)\n            next costume\n            wait (0.05) seconds\n        end\n        switch costume to (4 v)\n        wait (0.03) seconds\n        switch costume to (3 v)\n        wait (0.03) seconds\n        switch costume to (2 v)\n        wait (0.03) seconds\n        switch costume to (1 v)\n    end\nend\n\nwhen I receive [level 4 v]\nhide\n\nwhen I receive [level 5 v]\nshow\nset size to (70) %\ngo to x: (-120) y: (-149)\n\nwhen I receive [level 6 v]\nhide\n\nwhen I receive [level 7 v]\nshow\nset size to (70) %\ngo to x: (-126) y: (-147)\n\nwhen flag clicked\nwait until <(level) = [8]>\nhide\n\nwhen I receive [end v]\nhide\n\nwhen flag clicked\nwait until <(level) = [8]>\nhide\n\nwhen flag clicked\nwait until <(level) = [9]>\nhide\n\nwhen flag clicked\nwait until <(level) = [10]>\nshow\ngo to x: (-154) y: (8)\n\nwhen flag clicked\nwait until <(level) = [11]>\nhide\n\nwhen flag clicked\nwait until <(level) = [12]>\nshow\ngo to x: (-145) y: (-150)\n\n@obstacles\n\nwhen flag clicked\nhide\n\nwhen I receive [level3 v]\nswitch costume to (spikes v)\nshow\ngo to x: (58) y: (-133)\n\nwhen I receive [level3 v]\nforever\n    if <touching (player v)?> then\n        broadcast (dead v)\n    end\nend\n\nwhen I receive [level 4 v]\nswitch costume to (spikes2 v)\ngo to x: (-16) y: (-44)\n\nwhen I receive [level 5 v]\nswitch costume to (spikes3 v)\ngo to x: (11) y: (-7)\n\nwhen I receive [level 6 v]\nhide\n\nwhen I receive [end v]\nhide\n\nwhen flag clicked\nwait until <(level) = [9]>\nswitch costume to (level9 v)\nshow\ngo to x: (11) y: (-7)\n\nwhen flag clicked\nwait until <(level) = [10]>\nswitch costume to (level9 v)\nshow\ngo to x: (11) y: (-7)\n\nwhen flag clicked\nwait until <(level) = [11]>\nhide\n\nwhen flag clicked\nwait until <(level) = [12]>\nswitch costume to (level 12 v)\nshow\ngo to x: (-30) y: (-133)\n\n@elevator\n\nwhen flag clicked\nhide\n\nwhen I receive [level 6 v]\nshow\ngo to x: (-100) y: (-141)\n\nwhen I receive [subir v]\nswitch costume to (elevator v)\nwait (1) seconds\nswitch costume to (elevator2 v)\nglide (2) secs to x: (-101) y: (49)\nwait (1) seconds\nswitch costume to (elevator2 v)\nglide (2) secs to x: (-101) y: (-141)\nswitch costume to (elevator v)\n\nwhen I receive [level 7 v]\nhide\n\nwhen I receive [end v]\nhide\n\n@Objeto1\n\nwhen flag clicked\nhide\n\nwhen I receive [level 7 v]\nshow\ngo to x: (41) y: (96)\ngo to [back v] layer\n\nwhen I receive [level 8 v]\nhide\n\nwhen I receive [end v]\nhide\n\nwhen flag clicked\nwait until <(level) = [8]>\nhide\n\nwhen flag clicked\nwait until <(level) = [9]>\nhide\n\nwhen flag clicked\nwait until <(level) = [10]>\nhide\n\nwhen flag clicked\nwait until <(level) = [11]>\nhide\n\nwhen flag clicked\nwait until <(level) = [12]>\nhide\n\n@elevator2\n\nwhen flag clicked\nhide\n\nwhen I receive [subir v]\nswitch costume to (elevator v)\nwait (1) seconds\nswitch costume to (elevator2 v)\nglide (2) secs to x: (43) y: (140)\nwait (1) seconds\nswitch costume to (elevator2 v)\nglide (2) secs to x: (43) y: (18)\nswitch costume to (elevator v)\n\nwhen I receive [level 7 v]\nshow\ngo to x: (43) y: (18)\n\nwhen I receive [level 8 v]\nhide\n\nwhen flag clicked\nwait until <(level) = [8]>\nhide\n\nwhen I receive [end v]\nhide\n\nwhen flag clicked\nwait until <(level) = [9]>\nhide\n\nwhen flag clicked\nwait until <(level) = [10]>\nhide\n\nwhen flag clicked\nwait until <(level) = [11]>\nhide\n\nwhen flag clicked\nwait until <(level) = [12]>\nhide\n\n@truco\n\nwhen I receive [revelar truco v]\nhide\n\nwhen I receive [end v]\nshow\nswitch costume to (disfraz1 v)\ngo to [front v] layer\nwait (8) seconds\nbroadcast (change v)\n\nwhen flag clicked\nhide\n\nwhen I receive [change v]\nswitch costume to (disfraz2 v)\n\n@Objeto2\n\nwhen flag clicked\ngo to [back v] layer\ngo to x: (-172) y: (66)\nswitch costume to (level 1 v)\n\nwhen I receive [level 2 v]\nswitch costume to (level 2 v)\ngo to x: (46) y: (90)\n\nwhen I receive [level3 v]\nswitch costume to (level 3 v)\ngo to x: (-172) y: (66)\n\nwhen I receive [level 4 v]\nswitch costume to (level 4 v)\n\nwhen I receive [level 5 v]\nswitch costume to (level 5 v)\ngo to x: (200) y: (83)\n\nwhen I receive [level 6 v]\nswitch costume to (level 6 v)\ngo to x: (-172) y: (66)\n\nwhen I receive [level 7 v]\nswitch costume to (level 7 v)\n\nwhen I receive [level 8 v]\nswitch costume to (level 8 v)\n\nwhen I receive [level 9 v]\nswitch costume to (level 9 v)\n\nwhen flag clicked\nwait until <(level) = [10]>\nswitch costume to (level 10 v)\n\nwhen flag clicked\nwait until <(level) = [11]>\nswitch costume to (level 11 v)\ngo to x: (99) y: (24)\n\nwhen flag clicked\nwait until <(level) = [12]>\nswitch costume to (level 12 v)\ngo to x: (191) y: (84)\n\n@boton\n\nwhen flag clicked\nwait until <(level) = [8]>\nswitch costume to (disfraz1 v)\nshow\ngo to x: (-45) y: (-171)\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    switch costume to (disfraz1 v)\n    if <touching (player v)?> then\n        broadcast (revelar truco v)\n        switch costume to (disfraz2 v)\n        wait (1) seconds\n    end\nend\n\nwhen flag clicked\nwait until <(level) = [9]>\nswitch costume to (disfraz1 v)\nshow\ngo to x: (178) y: (28)\n\nwhen flag clicked\nwait until <(level) = [10]>\nswitch costume to (disfraz1 v)\nshow\ngo to x: (-219) y: (-16)\n\nwhen flag clicked\nwait until <(level) = [11]>\nhide\n\n@bloqueo\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nwait until <(level) = [8]>\nshow\n\nwhen I receive [revelar truco v]\nhide\n\nwhen flag clicked\nwait until <(level) = [9]>\nshow\n\nwhen flag clicked\nwait until <(level) = [10]>\nshow\n\nwhen flag clicked\nwait until <(level) = [11]>\nhide\n\n
Use arrow keys or WASD and it is mobile friendly\nLove and Fave and you will have a good chance getting a follow tomorrow. :D\nPlease Love, Fave, and Follow it would mean alot!\n1000 love : @FSAL-S-Inc21\nFree panzoid intro for you guys! https://scratch.mit.edu/projects/487536522/