game

package
v0.0.0-...-a793aa1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2021 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateEntityComponent

func CreateEntityComponent(pLvlConfig *LevelJSONConfig) *orderedmap.OrderedMap

func CreateLvlsEntityAndComponents

func CreateLvlsEntityAndComponents(Game *Game, EntCmpMap *orderedmap.OrderedMap)

func InitializeLevel

func InitializeLevel(g *Game)

func LoadAssetDescriptions

func LoadAssetDescriptions(Game *Game)

func LoadImagesAndTextures

func LoadImagesAndTextures(Game *Game)

func LoadLvlConfig

func LoadLvlConfig(Game *Game, path string)

func TransformSystemSetInitialVals

func TransformSystemSetInitialVals(g *Game)

Types

type AssetJSONConfig

type AssetJSONConfig struct {
	AnimatedByDefault        bool                   `json:"AnimatedByDefault"`
	ImagesBasePath           string                 `json:"ImagesBasePath"`
	Image                    string                 `json:"Image"`
	DefaultAnimationDuration uint8                  `json:"DefaultAnimationDuration"`
	Animations               *map[string]*animation `json:"Animations"`
	FontSize                 uint8                  `json:"FontSize"`
	Text                     string                 `json:"Text"`
}

type EntityJSONConfig

type EntityJSONConfig struct {
	Reference   string   `json:"Reference"`
	Components  []uint16 `json:"Components"`
	InitialPosX int32    `json:"InitialPosX"`
	InitialPosY int32    `json:"InitialPosY"`
	SpreadAlong string   `json:"SpreadAlong"`
}

type Game

type Game struct {
	Window            *sdl.Window
	Surface           *sdl.Surface
	Renderer          *sdl.Renderer
	Keyboard          *input.Keyboard
	ECSManager        *ecs.ECSManager
	AssetDescriptions *map[string]*AssetJSONConfig
	LvlDescription    *LevelJSONConfig
	StateMachine      *statemachine.StateMachine
}

func (*Game) InitializeSDL

func (g *Game) InitializeSDL()

func (*Game) LoadFirstLevel

func (g *Game) LoadFirstLevel()

func (*Game) LoadWelcomeScreen

func (g *Game) LoadWelcomeScreen()

func (*Game) PrepareBasicGameData

func (g *Game) PrepareBasicGameData()

func (*Game) Run

func (g *Game) Run()

func (*Game) RunSystems

func (g *Game) RunSystems(delta float64)

func (*Game) RunWelcomeScreen

func (g *Game) RunWelcomeScreen()

type LevelJSONConfig

type LevelJSONConfig struct {
	LevelPhysics                LevelPhysics                  `json:"LevelPhysics"`
	EntitiesDescriptions        *map[string]*EntityJSONConfig `json:"Entities"`
	EntitiesDescriptionsOrdered orderedmap.OrderedMap
}

func (*LevelJSONConfig) GetEntityDescription

func (l *LevelJSONConfig) GetEntityDescription(entityID uint64) *EntityJSONConfig

func (*LevelJSONConfig) GetFirstEntityIDFromRange

func (l *LevelJSONConfig) GetFirstEntityIDFromRange(entityID uint64) int

type LevelPhysics

type LevelPhysics struct {
	Gravity float64 `json:"Gravity"`
}

Jump to

Keyboard shortcuts

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