Vector (platformer) 

Instructions: AWD or arrow keys to run and jump, don`t touch the red stuff and get from one portal to the other one to move on to the next level.

@Stage\n\nwhen flag clicked\nforever\n    play sound [DOOMROAR - Sagittarius \(feat v] until done\nend\n\n@hit box\n\nwhen flag clicked\nset [level v] to [1]\nset size to (90) %\nshow\nset [ghost v] effect to (100)\ngo to x: (-209) y: (-110)\nset [x v] to [0]\nset [y v] to [0]\nforever\n    plat. [-0.7] [6] [0.7] [0.75] [5]\n    if <touching (sprite1 v)?> then\n        change [level v] by (1)\n        go to x: (-209) y: (-110)\n    end\n    if <touching color (#ff0000)?> then\n        go to x: (-209) y: (-110)\n    end\n    if <key (r v) pressed?> then\n        go to x: (-209) y: (-110)\n    end\nend\n\ndefine plat. (gravity) (jump) (speed) (friction) (slope)\nchange y by (y)\nchange [y v] by (gravity)\nif <touching color (#000000)?> then\n    repeat until <not <touching color (#000000)?>>\n        change y by ((([abs v] of (y) ) / (y)) * (-1))\n    end\n    set [y v] to (<<<key (w v) pressed?> or <key (up arrow v) pressed?>> and <(([abs v] of (y) ) / (y)) = [-1]>> * (jump))\nend\nset [x v] to (((x) + ((<<key (left arrow v) pressed?> or <key (a v) pressed?>> * ((speed) * (-1))) + (<<key (right arrow v) pressed?> or <key (d v) pressed?>> * (speed)))) * (friction))\nchange x by (x)\nset [slope v] to [0]\nrepeat until <<(slope) = ((slope) * (-1))> or <not <touching color (#000000)?>>>\n    change [slope v] by (-1)\n    change y by (1)\nend\nif <touching color (#000000)?> then\n    change y by (slope)\n    repeat until <not <touching color (#000000)?>>\n        change x by ((([abs v] of (x) ) / (x)) * (-1))\n    end\nend\n\ndefine test \nchange [y v] by (-1)\nchange y by (y)\nif <touching color (#000000)?> then\n    repeat until <not <touching color (#000000)?>>\n        change y by ((([abs v] of (y) ) / (y)) * (-1))\n    end\n    set [y v] to [0]\n    if <key (up arrow v) pressed?> then\n        set [y v] to [10]\n    end\nend\n\ntest \n\n@groud\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\nforever\n    switch costume to (level)\nend\n\n@vector\n\nwhen flag clicked\npoint in direction (90)\nset size to (90) %\nforever\n    set rotation style [left-right v]\n    broadcast (tick v)\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        point in direction (90)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        point in direction (-90)\n    end\nend\n\nwhen I receive [tick v]\ngo to (hit box v)\n\nwhen flag clicked\nforever\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n        wait (0.07) seconds\n        next costume\n        if <(costume [number v]) = [1]> then\n            switch costume to (costume2 v)\n        end\n        if <(costume [number v]) = [5]> then\n            switch costume to (costume2 v)\n        end\n    else\n        switch costume to (costume1 v)\n    end\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        switch costume to (costume5 v)\n        wait (0.3) seconds\n    end\nend\n\n@Sprite1\n\nwhen flag clicked\nshow\nset size to (75) %\ngo to x: (209) y: (-135.6)\nforever\n    wait (0.1) seconds\n    next costume\n    if <(level) = [8]> then\n        hide\n    end\nend\n\n@Sprite2\n\nwhen flag clicked\nshow\nset size to (75) %\ngo to x: (-209) y: (-135.6)\nforever\n    wait (0.1) seconds\n    next costume\nend\n\n@thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nforever\n    go to [front v] layer\n    reset timer\nend\n\nwhen [timer v] > (0.01)\nshow\n\n