Documentation ¶
Overview ¶
VoV game
VoV game ¶
VoV game ¶
VoV game ¶
VoV game ¶
VoV game ¶
VoV game ¶
VoV game ¶
VoV game ¶
VoV game ¶
VoV game ¶
VoV game
Index ¶
- Constants
- type Button
- type Credit
- type Credits
- type Direction
- type Dot
- type Dots
- type Dust
- type DustMote
- type Fog
- type Game
- func (g *Game) Draw()
- func (g *Game) DrawFPS()
- func (g *Game) DrawLives()
- func (g *Game) DrawScore()
- func (g *Game) DrawState()
- func (g *Game) HandleEvent(event sdl.Event)
- func (g *Game) HandleEvents()
- func (g *Game) OnInit() bool
- func (g *Game) OnQuit() bool
- func (g *Game) String() string
- func (g *Game) TogglePause()
- func (g *Game) Update()
- func (g *Game) UpdateState()
- type Menu
- type Options
- type Powups
- type Rocks
- type Score
- type Scores
- func (s *Scores) Default()
- func (s *Scores) Draw()
- func (s *Scores) Exists() bool
- func (s *Scores) Format()
- func (s *Scores) HandleEvent(event sdl.Event)
- func (s *Scores) HandleEvents()
- func (s *Scores) HighScore() bool
- func (s *Scores) Insert()
- func (s *Scores) Load()
- func (s *Scores) OnInit() bool
- func (s *Scores) OnQuit() bool
- func (s *Scores) Rank() int
- func (s *Scores) Save()
- func (s *Scores) String() string
- func (s *Scores) Update()
- func (s *Scores) UpdateState()
- type Ship
- type Sprite
- func (s *Sprite) Bounce(b *Sprite)
- func (s *Sprite) Collide(b *Sprite) bool
- func (s *Sprite) Collides() bool
- func (s *Sprite) Draw()
- func (s *Sprite) Explode()
- func (s *Sprite) Kill()
- func (s *Sprite) Mass() (m float64)
- func (s *Sprite) Quad() int
- func (s *Sprite) Query()
- func (s *Sprite) Rect() *sdl.Rect
- func (s *Sprite) Update()
Constants ¶
View Source
const ( BANGDOT = iota ENGINEDOT )
Dot types
View Source
const ( GamePlay = iota GameOver GamePause GameQuit DeadPause )
Game states
View Source
const ( LEFT = iota RIGHT UP DOWN )
Directions
View Source
const ( PLAIN = iota INVINCIBLE ENGINEBLAST SHIELDS ATTACK SLOWDOWN )
Ship states
View Source
const ( BASE = iota SHIP ROCK POWUP )
Sprite types
View Source
const ( MOVE = 1 DRAW = 2 COLLIDE = 4 )
Sprite flags
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Button ¶
type Button struct { Image *Sprite Highlight *Sprite Active bool Hovered bool Clicked bool Selected bool State engine.State }
Menu button
type Credits ¶
type Credits struct { Engine *engine.Engine Resource *engine.Resource Fog *Fog Dust *Dust ScrollSpeed float64 Credits []*Credit }
Credits structure
func NewCredits ¶
Returns new credits
type Direction ¶
Input directions
func (*Direction) StateEnabled ¶
Checks if any of direction states is enabled
type Dot ¶
type Dot struct { Game *Game X float64 Y float64 DX float64 DY float64 Mass float64 Decay float64 // Rate at which to reduce mass Type int Active bool }
Dot structure
type Dots ¶
type Dots struct { Game *Game Cfg *engine.Config Bd int S [4]float64 // Slice of heat colors HeatColors []sdl.Color ShipDots []*Dot BangDots []*Dot ShipDotsColors []sdl.Color BangDotsColors []sdl.Color ShipDotsPoints map[int][]sdl.Point BangDotsPoints map[int][]sdl.Point }
Dots structure
type Dust ¶
type Dust struct { Engine *engine.Engine Cfg *engine.Config // Dust motes Motes map[sdl.Color][]*DustMote // Motes points MotesPoints map[sdl.Color][]sdl.Point }
Dust structure
type Fog ¶
type Fog struct { Sprite Engine *engine.Engine Resource *engine.Resource ScrollOffset float64 Backgrounds map[int]*sdl.Texture }
Fog structure
type Game ¶
type Game struct { Engine *engine.Engine Cfg *engine.Config Resource *engine.Resource Life *Sprite FpsText *Sprite TimeText *Sprite ShieldsText *Sprite AttackText *Sprite InvincibleText *Sprite EngineBlastText *Sprite SlowdownText *Sprite PausedText *Sprite GameOverText *Sprite Fog *Fog Dust *Dust Dots *Dots Ship *Ship Rocks *Rocks Powups *Powups State int LastState int StateTimeout float64 Direction *Direction Score int }
Game structure
type Menu ¶
type Menu struct { Engine *engine.Engine Resource *engine.Resource Fog *Fog Dust *Dust Buttons []*Button ButtonActive int TitleText *Sprite FadeTimer float64 }
Menu structure
type Options ¶
type Options struct { Engine *engine.Engine Resource *engine.Resource Fog *Fog Dust *Dust Buttons []*Button ButtonActive int YesText *Sprite NoText *Sprite FadeTimer float64 }
Options structure
func NewOptions ¶
Returns new options
type Powups ¶
type Powups struct { Game *Game Engine *engine.Engine Powups []*Sprite Glow *Sprite Timeout int SpeedMin [4]float64 SpeedMax [4]float64 }
Powups structure
type Rocks ¶
type Rocks struct { Engine *engine.Engine Cfg *engine.Config Resource *engine.Resource Rocks []*Sprite Prototypes []*Sprite Nrocks int InitialRocks int FinalRocks int NrocksTimer float64 NrocksIncTicks float64 CurrentRock int Ti [4]float64 Rtimers [4]float64 SpeedMin [4]float64 SpeedMax [4]float64 }
Rocks structure
type Score ¶
type Score struct { Name string Time int X float64 Y float64 Width float64 Height float64 Formatted string }
Score structure
type Scores ¶
type Scores struct { Engine *engine.Engine Resource *engine.Resource Fog *Fog Dust *Dust // Current score Current int // String from input TextInput string // Is passed score highscore IsHighScore bool // Continue to menu state after timeout if true Continue bool // If scores are loaded Loaded bool // New hiscore text HiScoreText *Sprite HiScoreEnterText *Sprite // Loading text LoadingText *Sprite // List of scores Scores []Score // Timers FadeTimer float64 StateTimer float64 }
Scores structure
type Ship ¶
type Ship struct { Sprite Game *Game Cfg *engine.Config Glow *Sprite Moving bool Transparent bool StateTimeout float64 TranspTimeout float64 LifePowText *Sprite ShieldsPowText *Sprite AttackPowText *Sprite InvinciblePowText *Sprite EngineBlastPowText *Sprite SlowdownPowText *Sprite PowupTextScale float64 PowupTextTimeout float64 PowupCurrent int PowupTextActive bool }
Ship structure
type Sprite ¶
type Sprite struct { Engine *engine.Engine Type int Flags int X float64 Y float64 DX float64 DY float64 Width float64 Height float64 Frame uint32 Active bool Texture *sdl.Texture Surface *sdl.Surface // Explosion Exp1 *Sprite Exp2 *Sprite ExpActive bool ExpFrame int // Rock extras Life int Direction int // Ship extras Lives int Jets int State int }
Sprite structure
Click to show internal directories.
Click to hide internal directories.