helicoptergame

package
v0.0.0-...-9f99101 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gameover

func Gameover(score int)

func RandomInsideArena

func RandomInsideArena(iMax int, iMin int) int

func StartGame

func StartGame()

Types

type Coordinates

type Coordinates struct {
	X int
	Y int
}

type GameScreen

type GameScreen struct {
	tl.Level
	LandscapeEntity *Landscape
	PlayerEntity    *Player
	Obstacles       []*Obstacle

	FPS                 float64
	ObstacleCoordinates map[Coordinates]int
	// contains filtered or unexported fields
}

func NewGamescreen

func NewGamescreen(score int) *GameScreen

type Gameoverscreen

type Gameoverscreen struct {
	tl.Level
	OptionsText []*tl.Text
}

func (*Gameoverscreen) Tick

func (ts *Gameoverscreen) Tick(event tl.Event)

type Landscape

type Landscape struct {
	*tl.Entity
	BackgroundRectange *tl.Rectangle
	Width              int
	Height             int
	LandscapeBorder    map[Coordinates]int
	DeadArea           map[Coordinates]int
	SuccessArea        map[Coordinates]int
	LandscapeGround    *tl.Rectangle
}

func NewLandscape

func NewLandscape(w, h int) *Landscape

func (*Landscape) Contains

func (landscape *Landscape) Contains(c Coordinates) bool

func (*Landscape) Draw

func (landscape *Landscape) Draw(screen *tl.Screen)

func (*Landscape) SuccessContains

func (landscape *Landscape) SuccessContains(c Coordinates) bool

type Obstacle

type Obstacle struct {
	*tl.Rectangle
	Position Coordinates
}

func NewObstacle

func NewObstacle() *Obstacle

type Player

type Player struct {
	*tl.Entity
	X         int
	Y         int
	Direction direction
}

func NewPlayer

func NewPlayer() *Player

func (*Player) BorderCollision

func (player *Player) BorderCollision() bool

func (*Player) Draw

func (player *Player) Draw(screen *tl.Screen)

func (*Player) ObstacleCollision

func (player *Player) ObstacleCollision() bool

func (*Player) SuccessCollision

func (player *Player) SuccessCollision() bool

func (*Player) Tick

func (player *Player) Tick(event tl.Event)

type TitleScreen

type TitleScreen struct {
	tl.Level
	OptionsText []*tl.Text
}

func NewTitleScreen

func NewTitleScreen() *TitleScreen

func (*TitleScreen) Tick

func (ts *TitleScreen) Tick(event tl.Event)

Jump to

Keyboard shortcuts

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