# pong game

I am making a pong game using the inbuilt physics engine but having trouble with the bats. would I use the KINEMATIC body type and if so how?

@Coder You could always look at the Brickout example. That’s similar to pong. All your answers could be in there.

@coder theres an example built in codea, maybe look at it? LOL

@Paul123 @dave1707 already mentioned the example.

@Coder Heres a small example:

``````function setup()
--setup walls
displayMode(FULLSCREEN)
bottom = physics.body(EDGE,vec2(1,1),vec2(WIDTH,1))
bottom.restitution = 1
bottom.friction = 0
right = physics.body(EDGE,vec2(WIDTH,1),vec2(WIDTH,HEIGHT))
right.restitution = 1
right.friction = 0
top = physics.body(EDGE,vec2(1,HEIGHT),vec2(WIDTH,HEIGHT))
top.restitution = 1
top.friction = 0
left = physics.body(EDGE,vec2(1,1),vec2(1,HEIGHT))
left.restitution = 1
left.friction = 0

--setup Ball
ball = physics.body(CIRCLE,25)
ball.restitution = 1
ball.x = WIDTH/2
ball.y = HEIGHT/2
ball.linearVelocity = vec2(200,600)
end

function draw()
background(255, 255, 255, 255)
physics.gravity(vec2(0,0))
--draw ball
pushMatrix()
translate(ball.x,ball.y)
rotate(ball.angle)
fill(0, 81, 255, 255)
sprite("Planet Cute:Character Boy",0,0)
popMatrix()

pushMatrix()
fill(0, 0, 0, 255)
rect(0,0,100,25)

popMatrix()
end

function touched(t)
if t.state == MOVING then