Cube Heroes 2 // Platformer  (#art) (#games)

Instructions: JOIN THE INTROCONTEST https://scratch.mit.edu/projects/430385877/

@Stage\n\n@decorations\n\nwhen flag clicked\nshow\nforever\n    switch costume to (LEVEL)\nend\n\ngo [backward v] (3) layers\n\ngo to [front v] layer\n\n@ground\n\nwhen flag clicked\ngo [forward v] (2) layers\nforever\n    switch costume to (LEVEL)\nend\n\n@Sprite2\n\ndefine Platformer physics\nchange [yv v] by (-1)\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(x position) > (mouse x)>>> then\n    change [xv v] by (-1)\nend\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [xv v] by (1)\nend\nset [xv v] to ((Xv) * (0.9))\nchange x by (Xv)\nif <<touching (ground v)?> or <touching (moving platforms v)?>> then\n    change y by (1)\nend\nif <<touching (ground v)?> or <touching (moving platforms v)?>> then\n    change y by (1)\nend\nif <<touching (ground v)?> or <touching (moving platforms v)?>> then\n    change y by (1)\nend\nif <<touching (ground v)?> or <touching (moving platforms v)?>> then\n    change y by (1)\nend\nif <<touching (ground v)?> or <touching (moving platforms v)?>> then\n    change y by (-4)\n    change x by ((Xv) * (-1))\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n        set [yv v] to [15]\n        broadcast (jump_effect v)\n        if <(Xv) > [0]> then\n            set [xv v] to [-10]\n        else\n            set [xv v] to [10]\n        end\n    end\nend\nchange y by (Yv)\nif <<touching (ground v)?> or <touching (moving platforms v)?>> then\n    change y by ((Yv) * (-1))\n    set [yv v] to [0]\nend\nchange y by (-1)\nif <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> and <<touching (ground v)?> or <touching (moving platforms v)?>>> then\n    broadcast (jump_effect v)\n    set [yv v] to [15]\nend\nchange y by (1)\nif <touching (spikes v)?> then\n    go to x: (-180) y: (0)\n    broadcast (dead_sound v)\nend\nif <(y position) < [-180]> then\n    go to x: (-180) y: (0)\nend\nif <(x position) > [220]> then\n    change [level v] by (1)\n    go to x: (-180) y: (0)\nend\nif <touching (trampolins v)?> then\n    set [yv v] to [25]\nend\n\nwhen flag clicked\ngo to x: (-100) y: (-68)\nset [level v] to [4]\npoint in direction (-90)\nset rotation style [don't rotate v]\nforever\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        switch costume to (costume1 v)\n    end\n    if <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <(x position) > (mouse x)>>>> then\n        switch costume to (costume2 v)\n    end\nend\n\npoint in direction (90)\n\npoint in direction (-90)\n\nwhen flag clicked\n\nwhen I receive [start v]\nset [level v] to [1]\ngo to x: (-180) y: (0)\nforever\n    Platformer physics\nend\n\n@Spikes\n\nwhen flag clicked\nforever\n    if <(LEVEL) = [5]> then\n        go to x: (19) y: (-104)\n        turn right (9) degrees\n    else\n        if <(LEVEL) = [7]> then\n            go to x: (19) y: (-110)\n            turn right (9) degrees\n        else\n            go to x: (19) y: (-104)\n            point in direction (90)\n        end\n    end\nend\n\npoint in direction (90)\n\nwhen flag clicked\nforever\n    switch costume to (LEVEL)\nend\n\nrepeat (20)\n    change [turndegrees v] by (0.5)\nend\n\nrepeat (20)\n    change [turndegrees v] by (-5)\nend\n\n\n\nwhen flag clicked\nshow\n\nhide\n\nturn right (9) degrees\n\n@shadows\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    switch costume to (LEVEL)\n    set [ghost v] effect to (50)\nend\n\n@Button\n\nwhen flag clicked\nset size to (60) %\nwait (0.2) seconds\nforever\n    if <touching (mouse-pointer v)?> then\n        broadcast (start_idk v)\n        repeat until <not <touching (mouse-pointer v)?>>\n            switch costume to (kostüm2 v)\n            repeat until <(size) = [80]>\n                change size by (5)\n            end\n        end\n    else\n        repeat until <(size) = [60]>\n            change size by (-5)\n        end\n        set size to (60) %\n        switch costume to (kostüm1 v)\n    end\nend\n\nturn right (15) degrees\nwait (0.1) seconds\nturn left (15) degrees\nwait (0.3) seconds\n\nwhen flag clicked\npoint in direction (90)\nshow\ngo to [front v] layer\n\nwhen this sprite clicked\nbroadcast (start v)\nturn right (15) degrees\nrepeat (2)\n    turn right (15) degrees\n    change size by (-30)\n    change [ghost v] effect by (40)\nend\nhide\n\nwhen I receive [instructions v]\nhide\n\nwhen I receive [instructions_closed v]\nshow\n\n@trampolins\n\nwhen flag clicked\nforever\n    if <touching (sprite2 v)?> then\n        switch costume to (kostüm2 v)\n        wait (0.1) seconds\n    else\n        switch costume to (kostüm1 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(LEVEL) = [6]> then\n        go to x: (85) y: (-170)\n        show\n    else\n        if <(LEVEL) = [8]> then\n            go to x: (-35) y: (-73)\n            show\n        else\n            if <(LEVEL) = [9]> then\n                show\n                set x to (-70)\n            else\n                hide\n            end\n        end\n    end\nend\n\n@Sprite1\n\nwhen flag clicked\nshow\ngo to x: (0) y: (90)\nforever\n    point in direction ((([sin v] of ((timer) * (150)) ) * (3)) + (90))\nend\n\nwhen I receive [start v]\nhide\n\nforever\n    point in direction ((([sin v] of ((timer) * (150)) ) * (3)) + (90))\nend\n\n@Text\n\nwhen flag clicked\nhide\npoint in direction (90)\n\nwhen I receive [start v]\nshow\nforever\n    switch costume to (LEVEL)\n    go [backward v] (1) layers\nend\n\n@Music Sprite2\n\nwhen I receive [dead_sound v]\nstart sound [Slide Whistle v]\n\nwhen flag clicked\nset [ghost v] effect to (50)\nset volume to (100) %\nhide\nswitch costume to (costume1 v)\ngo to [front v] layer\ngo to x: (-212) y: (130)\nset [music? v] to [yes]\nshow\nforever\n    if <(music?) = [yes]> then\n        switch costume to (costume1 v)\n        if <touching (mouse-pointer v)?> then\n            if <mouse down?> then\n                set [music? v] to [no]\n                wait until <not <mouse down?>>\n            end\n        end\n    end\n    if <(music?) = [no]> then\n        switch costume to (costume2 v)\n        if <touching (mouse-pointer v)?> then\n            if <mouse down?> then\n                set [music? v] to [yes]\n                wait until <not <mouse down?>>\n            end\n        end\n    end\nend\n\ndefine Musicscript play\nforever\n    if <(music?) = [yes]> then\n        set volume to (100) %\n    end\n    if <(music?) = [no]> then\n        set volume to (0) %\n    end\nend\n\nwhen I receive [jump_effect v]\nstart sound [Jump2 v]\n\nwhen flag clicked\nforever\n    play sound [Alex Skrindo - Jumbo \[NCS Release\] v] until done\nend\n\nwhen flag clicked\nMusicscript play\n\n@Sprite3\n\nwhen flag clicked\nforever\n    show\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\n