abstract class Prism::Engine

Overview

The main engine to run the game. You can implement your game engine by inheriting this class and adding your logic.

Direct Known Subclasses

Defined in:

prism/engine.cr

Instance Method Summary

Instance Method Detail

def add_entity(entity : Crash::Entity) #

Adds an entity to the entity engine


[View source]
def add_system(system : Crash::System, priority : Int32) #

Adds a system to the entity engine


[View source]
def flush #

Flush the GL buffers and resize the viewport to match the window size


[View source]
def get_open_gl_version #

[View source]
abstract def init #

Games should implement this to start their game logic

TODO this init should be defined in the game engine abstract class


[View source]
def render #

Renders the game


[View source]
def startup #

Starts up the engine.

TODO we don't need to define this here. Let the implementations do it.


[View source]
def tick(tick : RenderLoop::Tick, input : RenderLoop::Input) #

Process inputs This will pass time and input to the engine systems.


[View source]