magnet

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScreenWidth  = 1920
	ScreenHeight = 1080
)
View Source
const (
	SceneTitle = iota
	SceneHowTo
	SceneBattle
	SceneGameOver
)

Variables

View Source
var (
	Font font.Face
)

Functions

This section is empty.

Types

type Battle

type Battle struct {
}

func (*Battle) Draw

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

func (*Battle) Update

func (s *Battle) Update(g *Game)

type Game

type Game struct {
	SceneType
	Title
	HowTo
	Battle
	GameOver
}

func NewGame

func NewGame() (*Game, error)

func (*Game) Draw

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

func (*Game) Layout

func (g *Game) Layout(width, height int) (int, int)

func (*Game) Update

func (g *Game) Update() error

type GameOver

type GameOver struct {
}

func (*GameOver) Draw

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

func (*GameOver) Update

func (s *GameOver) Update(g *Game)

type HowTo

type HowTo struct {
}

func (*HowTo) Draw

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

func (*HowTo) Update

func (s *HowTo) Update(m *Game)

type Map

type Map struct {
	Objects []Object `json:"objects"`
}

type Maps

type Maps struct {
	Maps []Map `json:"maps"`
}

type Object

type Object struct {
	X float64 `json:"x"`
	Y float64

	ObjectType int `json:"object_type"`
	// contains filtered or unexported fields
}

type Player

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

type Point

type Point struct {
	X, Y float64
}

type Scene

type Scene interface {
	Update(g *Game) error
	Draw(screen *ebiten.Image)
}

type SceneType

type SceneType struct {
	Type int
}

type Title

type Title struct {
}

func (*Title) Draw

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

func (*Title) Update

func (s *Title) Update(m *Game)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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