+91 9591117915 info@pixtell.net

## Character movement with vectors- Vector scaling

Pixtell Labs gamedev, Tutorials Character movement with vectors- Vector scaling

# Character movement with vectors- Vector scaling

Posted By Kirti P

In this tutorial we are going to learn how to scale vectors. A scalar has magnitude (size) only. A vector has both magnitude and direction.

Consider the previous example of Pacman(P). Let us assume that the Pacman is moving along the right with a velocity $\vec V$.

If we want to double the velocity of Pacman, we should multiply with 2 i.e 2*$\vec V$ . In terms of x and y componets, 2 $\vec V$ = ( 2* $\vec Vx$ , 2*$\vec Vy$).

We can also half the velocity, in which case  $\vec V$ /2 = (  $\vec Vx$ /2 , $\vec Vy$ /2).

Tagged