xtownrider

package
v0.0.0-...-d263fa9 Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WindowTitle is a constant that stores the name of the window.
	WindowTitle = "Xtownrider"
	// WindowWidth is a constant that stores the width of the window.
	WindowWidth = 800
	// WindowHeight is a constant that stores the height of the window.
	WindowHeight = 600
)

Variables

This section is empty.

Functions

func MainGameLoop

func MainGameLoop(gameState *GameState, resourceManager *libxtownrider.ResourceManager, entityManager *libxtownrider.EntityManager)

MainGameLoop is the main game loop of the game. It mainly does three things: 1. Updates the game state. 2. Renders to screen. 3. Handles input.

Types

type GameState

type GameState struct {
	ShouldQuit bool
	Window     *sdl.Window
	Renderer   *sdl.Renderer
}

GameState is a struct that stores current state of the game.

func Init

Init runs some initialization functions.

func NewGameState

func NewGameState() GameState

NewGameState makes a new instance of GameState struct.

func (*GameState) Drop

func (gameState *GameState) Drop()

Drop invokes Destroy on every SDL component.

Jump to

Keyboard shortcuts

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