Workshop › Pong › Step 12 of 26
The ball gets a velocity: vx pixels to the right and vy pixels down every frame. update adds them to its position.
```js
let ball = { x: 295, y: 195, vx: 4, vy: 3 }
ball.x += ball.vx
ball.y += ball.vy
```vx and vy are the ball's speed in pixels per frame. A negative vx would go left, a negative vy up.vx: 4, vy: 3 to ball.update, leave an empty line and write the two ball lines.Skills: Velocity and gravity
← The ball Bounce off the top and bottom →