platformer

package
v0.0.0-...-942270a Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScreenWidth  = 672
	ScreenHeight = 400
)
View Source
const (
	DT          = 0.1
	WINDOWSIZE  = 256
	WINDOWSCALE = 3
	TILESIZE    = 16
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Game

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

func (*Game) Draw

func (g *Game) Draw(screen *ebiten.Image)

func (*Game) Layout

func (g *Game) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int)

func (*Game) Update

func (g *Game) Update() error

type GameScene

type GameScene struct {
	CurrentLevel *level.GameLevel
}

func NewGameScene

func NewGameScene(startingLevelId string) *GameScene

func (*GameScene) Draw

func (s *GameScene) Draw(screen *ebiten.Image)

func (*GameScene) Update

func (s *GameScene) Update(state *GameState) error

type GameState

type GameState struct {
	SceneManager *SceneManager
	Input        *Input
}

type GamepadScene

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

func (*GamepadScene) Draw

func (s *GamepadScene) Draw(screen *ebiten.Image)

func (*GamepadScene) Update

func (s *GamepadScene) Update(state *GameState) error

type Input

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

Input manages the input state including gamepads and keyboards.

func (*Input) GamepadIDButtonPressed

func (i *Input) GamepadIDButtonPressed() ebiten.GamepadID

GamepadIDButtonPressed returns a gamepad ID where at least one button is pressed. If no button is pressed, GamepadIDButtonPressed returns -1.

func (*Input) IsRotateLeftJustPressed

func (i *Input) IsRotateLeftJustPressed() bool

func (*Input) IsRotateRightJustPressed

func (i *Input) IsRotateRightJustPressed() bool

func (*Input) StateForDown

func (i *Input) StateForDown() int

func (*Input) StateForLeft

func (i *Input) StateForLeft() int

func (*Input) StateForRight

func (i *Input) StateForRight() int

func (*Input) Update

func (i *Input) Update()

type Scene

type Scene interface {
	Update(state *GameState) error
	Draw(screen *ebiten.Image)
}

type SceneManager

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

func (*SceneManager) Draw

func (s *SceneManager) Draw(r *ebiten.Image)

func (*SceneManager) GoTo

func (s *SceneManager) GoTo(scene Scene)

func (*SceneManager) Update

func (s *SceneManager) Update(input *Input) error

type TitleScene

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

func (*TitleScene) Draw

func (s *TitleScene) Draw(r *ebiten.Image)

func (*TitleScene) Update

func (s *TitleScene) Update(state *GameState) error

Directories

Path Synopsis
Package ldtkgo is a loader for LDtk projects, written in Golang.
Package ldtkgo is a loader for LDtk projects, written in Golang.
resources

Jump to

Keyboard shortcuts

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