Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicMenu ¶
BasicMenu will, given some options, allow selection with a * pointer.
func (*BasicMenu) Draw ¶
func (bm *BasicMenu) Draw(s tcell.Screen, camera Coordinates, _, _ float32)
func (*BasicMenu) ProcessKeyEvent ¶
func (bm *BasicMenu) ProcessKeyEvent(e *tcell.EventKey, camera Coordinates)
type BasicText ¶
BasicText writes bounded unscrollable text
func (*BasicText) Draw ¶
func (t *BasicText) Draw(s tcell.Screen, camera Coordinates, _, _ float32)
type EngineOpts ¶
type Entity ¶
type Entity interface {
Draw(s tcell.Screen, camera Coordinates, ratioX, ratioY float32)
}
Entity is the base of any game.
You will draw entities on your TUI to display your game. Any resize from the starting screen size will change the ratioX and ratioY variables.
type FlexChatBox ¶
type FlexChatBox struct { RectArea OriginalRect RectArea Style tcell.Style Content []string // contains filtered or unexported fields }
FlexChatBox writes bounded "scrollable" text when the Space key is pressed.
func (*FlexChatBox) Draw ¶
func (r *FlexChatBox) Draw(s tcell.Screen, camera Coordinates, ratioX, ratioY float32)
func (*FlexChatBox) ProcessKeyEvent ¶
func (r *FlexChatBox) ProcessKeyEvent(e *tcell.EventKey, camera Coordinates)
type FlexRectangle ¶
type FlexRectangle struct { RectArea OriginalRect RectArea BackgroundStyle, BorderStyle tcell.Style // contains filtered or unexported fields }
FlexRectangle is a basic drawing entitiy that adjusts with the resize
func (*FlexRectangle) Draw ¶
func (r *FlexRectangle) Draw(s tcell.Screen, camera Coordinates, ratioX, ratioY float32)
type InteractiveEntity ¶
type InteractiveEntity interface {
ProcessKeyEvent(e *tcell.EventKey, camera Coordinates)
}
InteractiveEntity is a special entitity that processes events.
These entities will attempt to process keyboard events if they are currently displayed on the screen. As a game developer you create entities that implement this interface and give them to a state.
type Overlay ¶
type Overlay interface {
Draw(s tcell.Screen)
}
Overlays are entities that are drawn at the end, regardless of camera position.
type RectArea ¶
type RectArea struct { Coordinates Width int Height int }
RectArea defines top left and dimensions of any rectangle area based entitiy.
type State ¶
type State interface { GetDrawables() []Entity GetInteractables() []InteractiveEntity GetTimers() []TimeEntity GetCamera() Coordinates NextState() StateKey }
State definition of the game state machine.
Any computing can be summarized by a state machine. A game, similarly so. This is the core definition of the states in the state machine. A state will be drawn (and interacted with), based on camera position theoretically infinite area the state spans (i.e., position of its entities).
type StrictRectangle ¶
type StrictRectangle struct { RectArea Style tcell.Style }
StrictRectangle is the basic drawing entitiy.
func (*StrictRectangle) Draw ¶
func (r *StrictRectangle) Draw(s tcell.Screen, camera Coordinates, _, _ float32)
type TimeEntity ¶
type TimeEntity interface {
ProcessFrameDuration(d time.Duration, camera Coordinates)
}
TimeEntity is a special entitity that processes the passage of time.
These entities will attempt to process the passage of time for each frame, an example for such usage would be for entities that have a speed associated with them.