paddle

package
v0.0.0-...-abd3492 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const PaddleHeight float64 = 150.0
View Source
const PaddleMoveSpeed float64 = 400.0 // pixels per second
View Source
const PaddleWidth float64 = 35.0

Variables

This section is empty.

Functions

func HandlePaddleKey

func HandlePaddleKey(paddle *Paddle, key PaddleKey, keyState PaddleKeyState)

func RenderPaddle

func RenderPaddle(paddle *Paddle, surface *sdl.Surface)

func UpdatePaddle

func UpdatePaddle(paddle *Paddle, timeDelta uint32, screenHeight float64)

Types

type Paddle

type Paddle struct {
	// contains filtered or unexported fields
}

func MakePaddle

func MakePaddle(posX float64, posY float64, color uint32) *Paddle

type PaddleKey

type PaddleKey uint8
const (
	PaddleKeyNone PaddleKey = iota
	PaddleKeyUp
	PaddleKeyDown
)

type PaddleKeyState

type PaddleKeyState uint8
const (
	PaddleKeyReleased PaddleKeyState = iota
	PaddleKeyPressed
)

func GetKeyState

func GetKeyState(eventType uint32) PaddleKeyState

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL