func (p *Pong) Update(s Screen, keys Keys) {
	p.ball.x = p.ball.x + p.ball.speed*p.ball.xVel
	p.ball.y = p.ball.y + p.ball.speed*p.ball.yVel
	if (p.ball.y + p.ball.h) >= s.Height() {
		p.ball.yVel = -1
	}
	if p.ball.y <= 0 {
		p.ball.yVel = 1
	}
	if (p.ball.x+p.ball.w) >= p.computer.x &&
		(p.ball.y+p.ball.h/2) >= p.computer.y &&
		(p.ball.y) <= (p.computer.y+p.computer.h) {
		p.ball.xVel = -1
	}
	if p.ball.x <= (p.player.x+p.player.w) &&
		(p.ball.y+p.ball.h/2) >= p.player.y &&
		p.ball.y <= (p.player.y+p.player.h) {
		p.ball.xVel = 1
	}
	if p.ball.x > s.Width()/2 {
		if p.ball.y < (p.computer.y + p.ball.h) {
			if p.computer.y >= 0 {
				p.computer.Up()
			}
		} else {
			if p.computer.y <= s.Height()-p.computer.h {
				p.computer.Down()
			}
		}
	}
	if p.ball.x > p.computer.x {
		p.player.points++
		p.reset(s)
	}
	if p.ball.x <= 0 {
		p.computer.points++
		p.reset(s)
	}
	if keys.IsDown(keyUp) {
		if p.player.y >= 0 {
			p.player.Up()
		}
	}
	if keys.IsDown(keyDown) {
		if p.player.y <= s.Height()-p.player.h {
			p.player.Down()
		}
	}
}
Update, Check colisions and update the game state
package main
import "strconv"
type Paddle struct {
	x      int
	y      int
	w      int
	h      int
	vel    float32
	points int
}
func (p *Paddle) Up() {
	p.y -= 1
}
func (p *Paddle) Down() {
	p.y += 1
}
type Ball struct {
	x     int
	y     int
	w     int
	h     int
	xVel  int
	yVel  int
	speed int
}
type Pong struct {
	player   *Paddle
	computer *Paddle
	ball     *Ball
}
func (p *Pong) Load(s Screen) {
	p.player = &Paddle{
		x:      10,
		w:      10,
		h:      30,
		vel:    1,
		points: 0,
	}
	p.player.y = s.Height()/2 - p.player.h/2
	p.computer = &Paddle{
		x:      s.Width() - 20,
		w:      10,
		h:      30,
		vel:    1,
		points: 0,
	}
	p.computer.y = s.Height()/2 - p.computer.h/2
	p.ball = &Ball{
		w:     10,
		h:     10,
		xVel:  1,
		yVel:  -1,
		speed: 1,
	}
	p.reset(s)
}
func (p *Pong) reset(s Screen) {
	p.ball.x = s.Width()/2 - p.ball.w/2
	p.ball.y = s.Height()/2 - p.ball.h/2
}