Vector: The platformer
@Stage\n\nwhen I receive [start v]\nrepeat until <(Level) = [18]>\n    switch backdrop to (Level)\nend\nswitch backdrop to (backdrop18 v)\nwait until <(Level) = [19]>\nforever\n    switch backdrop to (Level)\nend\n\nwhen I receive [death v]\nswitch backdrop to (backdrop17 v)\nset [level v] to [17]\nwait until <(Level) = [18]>\nswitch backdrop to (backdrop18 v)\n\nwhen I receive [start v]\nset volume to (100) %\nwait until <(Level) = [8]>\nstop all sounds\nwait until <(Level) = [9]>\nbroadcast (sound1 v)\nwait until <(Level) = [13]>\nrepeat (20)\n    change volume by (-5)\nend\nstop all sounds\nset volume to (100) %\nwait until <(Level) = [14]>\nbroadcast (sound2 v)\nwait until <(Level) = [17]>\nrepeat (20)\n    change volume by (-5)\nend\nstop all sounds\nset volume to (100) %\nwait until <(Level) = [18]>\nbroadcast (sound3 v)\n\nwhen I receive [sound1 v]\nrepeat until <(Level) = [13]>\n    play sound [Ocean v] until done\nend\n\nwhen I receive [start v]\nrepeat until <(Level) = [8]>\n    play sound [Ground v] until done\nend\n\nwhen I receive [sound2 v]\nrepeat until <(Level) = [17]>\n    play sound [Lava v] until done\nend\n\nwhen I receive [boss battle v]\nrepeat until <not <(Level) = [18]>>\n    play sound [Boss Battle v] until done\nend\n\nwhen I receive [sound3 v]\nforever\n    wait until <not <(Level) = [18]>>\n    stop all sounds\n    if <(Level) = [19]> then\n        stop [this script v]\n    end\nend\n\nwhen I receive [end theme v]\nforever\n    play sound [Victory v] until done\nend\n\n@Vector\n\nwhen I receive [start v]\nclear graphic effects\ngo to x: (-205) y: (-95)\npoint in direction (90)\nset [x vel v] to [0]\nset [y vel v] to [0]\nset [jump v] to [0]\nset [angle v] to [0]\nforever\n    switch costume to (hitbox v)\n    point in direction (90)\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [x vel v] by (0.5)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [x vel v] by (-0.5)\n    end\n    change x by (X vel)\n    if <touching (background v)?> then\n        change x by ((X vel) * (-1))\n        set [x vel v] to ((X vel) * (-1))\n    end\n    set [x vel v] to ((X vel) * (0.9))\n    if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <key (space v) pressed?>>> then\n        if <<(Jump) = [0]> or <<(Level) < [13]> and <(Level) > [8]>>> then\n            if <<(Level) < [13]> and <(Level) > [8]>> then\n                set [y vel v] to (((Y vel) / (5)) + (2))\n                start sound [Swim v]\n            else\n                set [y vel v] to [10]\n                start sound [Jump v]\n            end\n            set [jump v] to [1]\n        end\n    end\n    change y by (Y vel)\n    if <touching (background v)?> then\n        change y by ((Y vel) * (-1))\n        if <(Y vel) < [0]> then\n            set [jump v] to [0]\n        end\n        set [y vel v] to [0]\n    else\n        if <<(Level) < [9]> or <(Level) > [12]>> then\n            set [y vel v] to ((Y vel) - (1))\n        else\n            set [y vel v] to ((Y vel) - (0.1))\n        end\n    end\n    change [angle v] by (X vel)\n    turn right ((Angle) * (4.8)) degrees\n    switch costume to (costume1 v)\nend\n\nwhen I receive [start v]\nforever\n    if <<<(y position) < [-179]> and <not <<(Level) = [7]> or <(Level) = [8]>>>> or <<touching color (#cccccc)?> or <touching color (#ff0000)?>>> then\n        set [ghost v] effect to (50)\n        glide (0.5) secs to x: (-225) y: (-85)\n        clear graphic effects\n        set [y vel v] to [0]\n        change [deaths v] by (1)\n        set [x vel v] to [0]\n    end\n    if <(Level) = [3]> then\n        if <touching color (#fff4f6)?> then\n            repeat until <(y position) > [175]>\n                set [x vel v] to [0]\n                set [y vel v] to [0]\n                change y by (3)\n                set x to (((-174) + (x position)) / (2))\n            end\n            go to x: (-170) y: (-95)\n            set [y vel v] to [0]\n            set [x vel v] to [0]\n            set [angle v] to [0]\n            change [level v] by (1)\n        end\n    else\n        if <(Level) = [7]> then\n            wait until <(y position) < [-179]>\n            set [level v] to [8]\n            set [x vel v] to [0]\n            set [angle v] to [0]\n            go to x: (0) y: (180)\n            wait until <touching color (#3b78ff)?>\n            set [x vel v] to [0]\n            set [y vel v] to [-5]\n            set [angle v] to [0]\n            set [level v] to [9]\n            go to x: (0) y: (180)\n        else\n            if <(Level) = [13]> then\n                set [x vel v] to [6]\n                set [y vel v] to [14]\n                set [angle v] to [0]\n                go to x: (-208) y: (-149)\n                wait until <(x position) > [230]>\n            end\n            if <(x position) > [230]> then\n                go to x: (-235) y: (-95)\n                set [angle v] to [0]\n                change [level v] by (1)\n            end\n        end\n    end\nend\n\nwhen flag clicked\nset [level v] to [1]\nwait until <(Level) = [18]>\nwait until <(Button) = [3]>\nwait until <touching color (#f1f1f1)?>\nbroadcast (end animation v)\nwait (3) seconds\nset [x vel v] to [0]\nset [y vel v] to [0]\nset [angle v] to [0]\ngo to x: (-235) y: (-95)\n\nwhen I receive [death v]\ngo to x: (0) y: (-95)\nchange [deaths v] by (1)\nset [angle v] to [0]\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nrepeat until <<touching (mouse-pointer v)?> and <mouse down?>>\n    go to [front v] layer\n    switch costume to (hitbox v)\n    if <not <touching (mouse-pointer v)?>> then\n        switch costume to (costume1 v)\n    end\nend\nbroadcast (skip cutscene v)\nhide\n\nwhen I receive [start v]\nhide\n\nhide\n\n@Cutscenes\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nset [brightness v] effect to (100)\nswitch costume to (costume1 v)\ngo to [front v] layer\nrepeat (6)\n    repeat (10)\n        change [brightness v] effect by (-10)\n    end\n    wait (3) seconds\n    repeat (10)\n        change [brightness v] effect by (10)\n    end\n    next costume\nend\nhide\nbroadcast (start v)\n\nwhen I receive [end animation v]\nchange [level v] by (1)\nshow\ngo to [front v] layer\nclear graphic effects\nswitch costume to (costume11 v)\nrepeat (4)\n    wait (0.01) seconds\n    next costume\nend\nwait (1) seconds\nrepeat (7)\n    next costume\n    change [brightness v] effect by (14.5)\n    wait (0.01) seconds\nend\nswitch costume to (costume19 v)\nwait (2) seconds\nbroadcast (end theme v)\nrepeat (7)\n    change [brightness v] effect by (-14.5)\n    wait (0.01) seconds\nend\nhide\n\nwhen I receive [skip cutscene v]\nstop [other scripts in sprite v]\nhide\nbroadcast (start v)\n\n@Buttons\n\nwhen flag clicked\nset [button v] to [0]\nset [level v] to [1]\nhide\nswitch costume to (costume1 v)\nwait until <(Level) = [18]>\ngo to x: (-100) y: (-112)\ncreate clone of (_myself_ v)\ngo to x: (0) y: (-112)\ncreate clone of (_myself_ v)\ngo to x: (100) y: (-112)\ncreate clone of (_myself_ v)\n\nwhen I receive [end animation v]\ndelete this clone\n\nwhen I receive [death v]\ndelete this clone\n\nwhen I start as a clone\nshow\nwait until <<touching (missile v)?> and <touching color (#f6f6f6)?>>\nnext costume\nchange [button v] by (1)\nbroadcast (Button v)\n\nwhen I receive [death v]\nset [level v] to [17]\nset [button v] to [0]\nwait until <(Level) = [18]>\ngo to x: (-100) y: (-112)\ncreate clone of (_myself_ v)\ngo to x: (0) y: (-112)\ncreate clone of (_myself_ v)\ngo to x: (100) y: (-112)\ncreate clone of (_myself_ v)\n\n@Missile\n\nwhen I receive [button v]\nif <(Button) = [3]> then\n    stop [other scripts in sprite v]\nend\nrepeat (4)\n    next costume\nend\ndelete this clone\n\nwhen I receive [boss battle v]\ngo [backward v] (20) layers\nset [missile v] to (pick random (1) to (2))\npoint in direction (180)\nforever\n    if <(Missile) = [1]> then\n        go to x: (-140) y: (86)\n        change [missile v] by (1)\n        create clone of (_myself_ v)\n    else\n        go to x: (141) y: (86)\n        change [missile v] by (-1)\n        create clone of (_myself_ v)\n    end\n    repeat (((Button) * (-4)) + (20))\n        wait (0) seconds\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nswitch costume to (costume1 v)\nshow\nrepeat (10)\n    change y by (-2)\nend\nrepeat (10)\nend\nrepeat (30)\n    move (3) steps\n    point towards (vector v)\nend\nforever\n    move (3) steps\n    if <touching (vector v)?> then\n        broadcast (Death v)\n    end\n    if <<touching color (#f6f6f6)?> or <touching (background v)?>> then\n        repeat (4)\n            next costume\n        end\n        delete this clone\n    end\nend\n\nwhen I receive [death v]\nstop [other scripts in sprite v]\ndelete this clone\n\n@Shadow\n\nwhen flag clicked\nhide\nswitch costume to (costume2 v)\nset size to (200) %\nclear graphic effects\n\nwhen I receive [death v]\nhide\nclear graphic effects\n\nwhen backdrop switches to [backdrop18 v]\nshow\nswitch costume to (costume1 v)\nrepeat until <([x position v] of [vector v]) > [0]>\n    go to [front v] layer\n    go to (vector v)\nend\nrepeat (20)\n    go to [front v] layer\n    go to (vector v)\nend\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\nswitch costume to (costume2 v)\nrepeat (10)\nend\nbroadcast (Boss Battle v)\n\n@background\n\nwhen flag clicked\nset [level v] to [1]\nset [deaths v] to [0]\nhide variable [deaths v]\nhide variable [time v]\n\nwhen I receive [start v]\nreset timer\ngo to x: (0) y: (0)\nrepeat until <(Level) = [18]>\n    switch costume to (Level)\nend\nswitch costume to (costume18 v)\nwait until <(Level) = [19]>\nforever\n    switch costume to (Level)\nend\n\nwhen I receive [death v]\nswitch costume to (costume17 v)\nset [level v] to [17]\nwait until <(Level) = [18]>\nswitch costume to (costume18 v)\n\nwhen flag clicked\nwait until <(Level) = [20]>\nchange [deaths v] by (-1)\nset [time v] to ([floor v] of ((timer) / (60)) )\nif <((round (((timer) mod (60)) * (100))) / (100)) < [10]> then\n    set [time v] to (join (Time) (join [:0] ((round (((timer) mod (60)) * (100))) / (100))))\nelse\n    set [time v] to (join (Time) (join [:] ((round (((timer) mod (60)) * (100))) / (100))))\nend\nshow variable [deaths v]\nshow variable [time v]\n\nset [button v] to [0]\n\n@instructions\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nswitch costume to (costume4 v)\nwait (1) seconds\nwait until <(Level) = [21]>\nshow\nswitch costume to (1 v)\ncreate clone of (_myself_ v)\nswitch costume to (2 v)\ncreate clone of (_myself_ v)\nswitch costume to (3 v)\n\n@BitMatt\n\nwhen I receive [button v]\nif <(Button) = [3]> then\n    next costume\n    repeat (6)\n    next costume\n    repeat (20)\n        change y by (-10)\n    end\n    next costume\nelse\n    next costume\n    repeat (6)\n    next costume\n    repeat (6)\n    next costume\nend\n\nwhen I receive [death v]\nswitch costume to (costume1 v)\nhide\nset [level v] to [17]\nwait until <(Level) = [18]>\nshow\n\nwhen I receive [end animation v]\nhide\n\nwhen I receive [boss battle v]\nswitch costume to (costume1 v)\nshow\n\nwhen flag clicked\nset [level v] to [1]\nhide\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nwait until <(Level) = [18]>\nshow\n\n@Thumbnail\n\nwhen flag clicked\ngo to [front v] layer\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\n\n
Use the arrow buttons<^> or WAD keys with space bar to move Vector.\nMay be laggy for some computers in full-screen.\nMake sure to love and favorite, so I know to make more of these projects.\nGuys, I finally made a complete platformer game!\n\nV1.3: Balanced some levels, added time and death counters.\nV1.2: Fixed a boss battle glitch.\nV1.1: Added the space bar as a substitute for jumping.\nV1.0: Published online.