Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GameObject ¶
type GameObject struct { Position geometry2d.Vector2D Rotation float64 Active bool Components []Component }
GameObject is a generic type all elements in the game should inherit
func (*GameObject) AddComponent ¶
func (g *GameObject) AddComponent(newComponent Component)
AddComponent adds a new component to the game object
func (*GameObject) Draw ¶
func (g *GameObject) Draw(screen *ebiten.Image) error
Draw draws all components to screen
func (*GameObject) GetComponent ¶
func (g *GameObject) GetComponent(withType Component) Component
GetComponent gets a component of the speciied type
func (*GameObject) Update ¶
func (g *GameObject) Update(delta int64) error
Update updates all conmponents
type Gameloop ¶
type Gameloop struct { }
Gameloop implements ebiten.Gameloop interface.
func (*Gameloop) Draw ¶
Draw draws the game screen. Draw is called every frame (typically 1/60[s] for 60Hz display).
type Scene ¶
type Scene struct {
SceneElements []*GameObject
}
Scene contains all elements on screen
func (*Scene) AddChild ¶
func (s *Scene) AddChild(child *GameObject)
AddChild adds new child to scene
func (*Scene) RemoveChild ¶
func (s *Scene) RemoveChild(child *GameObject)
RemoveChild removes a given child from the scene
Directories ¶
Path | Synopsis |
---|---|
assets
Package assets generated by go-bindata.// sources: resources/player/Minigun_Large_png_processed.png resources/player/PlayerRed_Frame_01_png_processed.png resources/anim/explosion/Explosion02_Frame_01_png_processed.png resources/anim/explosion/Explosion02_Frame_02_png_processed.png resources/anim/explosion/Explosion02_Frame_03_png_processed.png resources/anim/explosion/Explosion02_Frame_04_png_processed.png resources/anim/explosion/Explosion02_Frame_05_png_processed.png resources/anim/explosion/Explosion02_Frame_06_png_processed.png resources/anim/explosion/Explosion02_Frame_07_png_processed.png resources/anim/explosion/Explosion02_Frame_08_png_processed.png resources/anim/explosion/Explosion02_Frame_09_png_processed.png resources/background/PixelBackgroundSeamless.png resources/enemy/Asteroid 01_png_processed.png resources/enemy/Asteroid 02_png_processed.png resources/enemy/Asteroid 03_png_processed.png resources/enemy/Asteroid 04_png_processed.png
|
Package assets generated by go-bindata.// sources: resources/player/Minigun_Large_png_processed.png resources/player/PlayerRed_Frame_01_png_processed.png resources/anim/explosion/Explosion02_Frame_01_png_processed.png resources/anim/explosion/Explosion02_Frame_02_png_processed.png resources/anim/explosion/Explosion02_Frame_03_png_processed.png resources/anim/explosion/Explosion02_Frame_04_png_processed.png resources/anim/explosion/Explosion02_Frame_05_png_processed.png resources/anim/explosion/Explosion02_Frame_06_png_processed.png resources/anim/explosion/Explosion02_Frame_07_png_processed.png resources/anim/explosion/Explosion02_Frame_08_png_processed.png resources/anim/explosion/Explosion02_Frame_09_png_processed.png resources/background/PixelBackgroundSeamless.png resources/enemy/Asteroid 01_png_processed.png resources/enemy/Asteroid 02_png_processed.png resources/enemy/Asteroid 03_png_processed.png resources/enemy/Asteroid 04_png_processed.png |
Click to show internal directories.
Click to hide internal directories.