input

package
v0.0.0-...-c33ef55 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Direction

type Direction int
const (
	Up Direction = iota
	UpRight
	UpLeft
	Right
	Down
	DownRight
	DownLeft
	Left
)

func (Direction) Move

func (d Direction) Move() (x, y int)

Move handles direction is pixels the world appears to move. The Player is fixed in the middle of the screen the world moves inverse to have the character appear to move in the down direction.

func (Direction) String

func (d Direction) String() string

type Input

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

func NewInput

func NewInput() *Input

func (*Input) Direction

func (i *Input) Direction() (Direction, bool)

func (*Input) MouseLocation

func (i *Input) MouseLocation() (x, y int)

func (*Input) MouseState

func (i *Input) MouseState() bool

func (*Input) MouseX

func (i *Input) MouseX() int

func (*Input) MouseY

func (i *Input) MouseY() int

func (*Input) Update

func (i *Input) Update()

type MouseState

type MouseState int

Jump to

Keyboard shortcuts

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