Skip to content

go-rogue/scenes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scenes

GoDoc Software License

This package provides a Scene interface and Scene Director struct for use in game dev. The stack it uses is thread safe.

Usage

The Scene Director operates on structs implementing IScene however this interface intentionally doesn't provide an update or draw methods. That is up to you to implement in your extension to IScene.

For example, you might have your own Scene interface such as:

type Scene interface {
    scenes.IScene
    Draw()
    HandleEvent(ev tcell.Event) bool
}

You would then cast the return of PeekState() to your required interface like so:

scene := director.PeekState().(Scene)
scene.Draw()

A full working demonstration can be found at https://github.com/go-rogue/scenes-demo