GameA1

package
v0.0.0-...-11048c4 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildBidimensionalElementArray

func BuildBidimensionalElementArray(size *Size, wrap bool)

Types

type Drawer

type Drawer struct {
	Size     *Vector2
	Manager  *Manager
	Renderer *sdl.Renderer
	Display  *sdl.Texture
	MustDraw bool
}

func NewDrawer

func NewDrawer(manager *Manager, size *Vector2, renderer *sdl.Renderer, texture *sdl.Texture) *Drawer

func (*Drawer) Clear

func (drawer *Drawer) Clear()

func (*Drawer) Color

func (drawer *Drawer) Color(theColor *color.RGBA)

func (*Drawer) Draw

func (drawer *Drawer) Draw()

func (*Drawer) Rectangle

func (drawer *Drawer) Rectangle(rectangle *Rectangle)

func (*Drawer) Texture

func (drawer *Drawer) Texture(rectangle *Rectangle, name string)

type Element

type Element struct {
	Neighbors map[string]*Element
	Position  *Vector2
	Special   interface{}
}

type Manager

type Manager struct {
	Visuals        *Visuals
	TextureManager *TextureManager
	Drawer         *Drawer
	TileSize       *Vector2
	LogicalSize    *Vector2
	Window         *sdl.Window
	DrawEvent      *sdl.UserEvent
	Running        bool
}

func NewManager

func NewManager() *Manager

func (*Manager) CreateDrawer

func (manager *Manager) CreateDrawer()

func (*Manager) CreateWindow

func (manager *Manager) CreateWindow()

func (*Manager) Draw

func (manager *Manager) Draw()

func (*Manager) InitializeSDL

func (manager *Manager) InitializeSDL()

func (*Manager) Main

func (manager *Manager) Main()

func (*Manager) RequestDraw

func (manager *Manager) RequestDraw()

type Rectangle

type Rectangle struct {
	Position *Vector2
	Size     *Vector2
}

func NewRectangle

func NewRectangle(position, size *Vector2) *Rectangle

func (*Rectangle) ToSDL

func (rectangle *Rectangle) ToSDL() *sdl.Rect

type TextureManager

type TextureManager struct {
	Manager  *Manager
	Textures map[string]*sdl.Texture
}

func NewTextureManager

func NewTextureManager(manager *Manager) *TextureManager

func (*TextureManager) Load

func (textureManager *TextureManager) Load(name string)

type Vector2

type Vector2 struct {
	X int
	Y int
}

func NewVector2

func NewVector2(x, y int) *Vector2

type Visual

type Visual interface {
	Draw(drawer Drawer) string
}

type VisualColor

type VisualColor struct {
	Color *color.RGBA
}

func (*VisualColor) Draw

func (visualColor *VisualColor) Draw(drawer *Drawer)

type Visuals

type Visuals struct {
	Array [][]Element
	Size  *Vector2
}

func NewVisuals

func NewVisuals(size *Vector2) *Visuals

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳