core

package
v0.0.0-...-1c1542d Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Game

type Game struct {
	Renderer   *renderer.Renderer
	Systems    *ecs.SystemManager
	Entities   *ecs.EntityManager
	Components *ecs.ComponentManager

	// Load calls once when the game starts, useful for loading resources.
	Load func()

	// Update is called every frame.
	// It receives the current frame time in seconds. (AKA 'delta time')
	Update func(dt float32)

	// Draw is called every frame, but after Update and after drawing is started, so it can be used for drawing game graphics.
	Draw func()
}

Game represents the core engine structure.

func NewGame

func NewGame(gameWidth, gameHeight int, title string) *Game

NewGame initializes a new PUZZ game instance.

func (*Game) Close

func (game *Game) Close()

Close cleans up resources and closes the game window.

func (*Game) Run

func (game *Game) Run()

Run starts the main game loop.

Jump to

Keyboard shortcuts

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