Documentation
¶
Index ¶
- type Color
- type Control
- type ControllerAxisEventHandler
- type ControllerButtonDownEventHandler
- type ControllerButtonEventHandler
- type ControllerButtonUpEventHandler
- type ControllerDeviceAddedEventHandler
- type ControllerDeviceEventHandler
- type ControllerDeviceMappedEventHandler
- type ControllerDeviceRemovedEventHandler
- type GameController
- type KeyboardMouse
- type Tank
- func (tnk *Tank) Color() Color
- func (tnk *Tank) Draw(canvas *sdlkit.Canvas)
- func (tnk *Tank) GetX() float64
- func (tnk *Tank) GetY() float64
- func (tnk *Tank) Heading() float64
- func (tnk *Tank) RegisterEvents(em *event.Manager)
- func (tnk *Tank) SetHeading(heading float64)
- func (tnk *Tank) SetTurretRotation(radians float64)
- func (tnk *Tank) SetX(x float64)
- func (tnk *Tank) SetY(y float64)
- func (tnk *Tank) TurretPosition() *geom.Vector
- func (tnk *Tank) Update(dt float64)
- type Turret
- type UserInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Color ¶
type Color uint8
func (Color) BarrelTextureClip ¶
func (c Color) BarrelTextureClip(atlas *sdlkit.TextureAtlas) (sdlkit.TextureClip, error)
func (Color) BodyTextureClip ¶
func (c Color) BodyTextureClip(atlas *sdlkit.TextureAtlas) (sdlkit.TextureClip, error)
type ControllerAxisEventHandler ¶
type ControllerAxisEventHandler interface {
HandleControllerAxisEvent(*sdl.ControllerAxisEvent) error
}
type ControllerButtonDownEventHandler ¶
type ControllerButtonDownEventHandler interface {
HandleControllerButtonDownEvent(*sdl.ControllerButtonEvent) error
}
type ControllerButtonEventHandler ¶
type ControllerButtonEventHandler interface {
HandleControllerButtonEvent(*sdl.ControllerButtonEvent) error
}
type ControllerButtonUpEventHandler ¶
type ControllerButtonUpEventHandler interface {
HandleControllerButtonUpEvent(*sdl.ControllerButtonEvent) error
}
type ControllerDeviceAddedEventHandler ¶
type ControllerDeviceAddedEventHandler interface {
HandleControllerDeviceAddedEvent(*sdl.ControllerDeviceEvent) error
}
type ControllerDeviceEventHandler ¶
type ControllerDeviceEventHandler interface {
HandleControllerDeviceEvent(*sdl.ControllerDeviceEvent) error
}
type ControllerDeviceMappedEventHandler ¶
type ControllerDeviceMappedEventHandler interface {
HandleControllerDeviceMappedEvent(*sdl.ControllerDeviceEvent) error
}
type ControllerDeviceRemovedEventHandler ¶
type ControllerDeviceRemovedEventHandler interface {
HandleControllerDeviceRemovedEvent(*sdl.ControllerDeviceEvent) error
}
type GameController ¶
type GameController struct { Device *sdl.GameController // contains filtered or unexported fields }
func (*GameController) Input ¶
func (gc *GameController) Input() UserInput
type KeyboardMouse ¶
type KeyboardMouse struct {
// contains filtered or unexported fields
}
func (*KeyboardMouse) HandleKeyboardEvent ¶
func (kc *KeyboardMouse) HandleKeyboardEvent(e *sdl.KeyboardEvent) error
func (*KeyboardMouse) Input ¶
func (kc *KeyboardMouse) Input() UserInput
type Tank ¶
http://engineeringdotnet.blogspot.com/2010/04/simple-2d-car-physics-in-games.html
func (*Tank) RegisterEvents ¶
func (*Tank) SetHeading ¶
func (*Tank) SetTurretRotation ¶
func (*Tank) TurretPosition ¶
TurretPosition is the absolute center point of the turret's dome on top of the Tank.
type Turret ¶
type Turret struct {
// contains filtered or unexported fields
}
func NewTurretSmall ¶
func NewTurretSmall(atlas *sdlkit.TextureAtlas, tank *Tank) Turret
Click to show internal directories.
Click to hide internal directories.