Documentation ¶
Index ¶
- Constants
- Variables
- func CreateCanvas(fileContent []byte) tl.Canvas
- func SetPositionAndRenderAliens(aliens [][]*Alien, level *tl.BaseLevel, arena *Arena)
- func ShowGameOverScreen(invaders *Invaders)
- func ShowTitleScreen(invaders *Invaders)
- type Alien
- type AlienCluster
- type AlienType
- type Arena
- type GameOverZone
- type Hero
- type Hud
- type Invaders
- type Laser
Constants ¶
View Source
const ( ArenaMaxWidth = 100 ArenaMaxHeight = 37 )
Variables ¶
View Source
var ( Basic = AlienType{Source: alienBasicBytes, Points: 10} Medium = AlienType{Source: alienMediumBytes, Points: 20} Strong = AlienType{Source: alienStrongBytes, Points: 30} )
Functions ¶
func CreateCanvas ¶
func ShowGameOverScreen ¶
func ShowGameOverScreen(invaders *Invaders)
func ShowTitleScreen ¶
func ShowTitleScreen(invaders *Invaders)
Types ¶
type Alien ¶
func CreateAliensLine ¶
type AlienCluster ¶
type AlienCluster struct { Aliens [][]*Alien Lasers []*Laser TimeToMove float64 WaitingTime float64 WaitingTimeToMoveNextRow float64 CurrentRowMoving int Direction int MoveSize int IsMoving bool IsMovingDown bool IsAllDead bool ReachedEndArena bool }
func NewAlienCluster ¶
func NewAlienCluster() *AlienCluster
func (*AlienCluster) IsAllAliensDead ¶
func (alienCluster *AlienCluster) IsAllAliensDead() bool
func (*AlienCluster) RemoveDeadAliensAndGetPoints ¶
func (alienCluster *AlienCluster) RemoveDeadAliensAndGetPoints(level *tl.BaseLevel) int
func (*AlienCluster) Shoot ¶
func (alienCluster *AlienCluster) Shoot()
func (*AlienCluster) UpdateAliensPositions ¶
func (alienCluster *AlienCluster) UpdateAliensPositions(timeDelta float64, arena *Arena)
type GameOverZone ¶
func CreateGameOverZone ¶
func CreateGameOverZone(arena *Arena, hero *Hero) *GameOverZone
func (*GameOverZone) Collide ¶
func (gameOverZone *GameOverZone) Collide(collision tl.Physical)
type Hud ¶
func (*Hud) UpdateScore ¶
type Invaders ¶
type Invaders struct { *tl.Entity Game *tl.Game Level *tl.BaseLevel Arena *Arena GameOverZone *GameOverZone Hud *Hud Hero *Hero AlienCluster *AlienCluster AlienLaserVelocity float64 TimeDelta float64 RefreshSpeed time.Duration Score int Started bool ScreenSizeNotOK bool }
func (*Invaders) RemoveDeadAliensAndIncrementScore ¶
func (invaders *Invaders) RemoveDeadAliensAndIncrementScore()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.