Sprite
and App::update
Client programs should implement App::update
to execute game logic and
add instances of Sprite
to App::sprites
and App::ui_sprites
.
At each frame, all sprites are drawn to the screen.
This system relies on two cameras App::world_camera
and App::ui_camera
.
App::world_camera
applies a perspective effect to draw the game world.
This camera is designed to be moved around to see the world as well as to
zoom in and out. It is used to position the sprites in App::sprites
.
App::ui_camera
is a simple orthogonal camera to display UI objects.
This camera should mostly be still, it can still move for chock effects
and the like. It can be used to standardize the size of the UI across
devices. It is used to position the sprites in App::ui_sprites
.
See the sample game at contrib/asteronits/
and the basic project template
at lib/gamnit/examples/template/
.
Serializable::inspect
to show more useful information
more_collections :: more_collections
Highly specific, but useful, collections-related classes.performance_analysis :: performance_analysis
Services to gather information on the performance of events by categoriesserialization :: serialization_core
Abstract services to serialize Nit objects to different formatscore :: union_find
union–find algorithm using an efficient disjoint-set data structureaccept_scroll_and_zoom
# Simple API for 2D games, built around `Sprite` and `App::update`
#
# Client programs should implement `App::update` to execute game logic and
# add instances of `Sprite` to `App::sprites` and `App::ui_sprites`.
# At each frame, all sprites are drawn to the screen.
#
# This system relies on two cameras `App::world_camera` and `App::ui_camera`.
#
# * `App::world_camera` applies a perspective effect to draw the game world.
# This camera is designed to be moved around to see the world as well as to
# zoom in and out. It is used to position the sprites in `App::sprites`.
#
# * `App::ui_camera` is a simple orthogonal camera to display UI objects.
# This camera should mostly be still, it can still move for chock effects
# and the like. It can be used to standardize the size of the UI across
# devices. It is used to position the sprites in `App::ui_sprites`.
#
# See the sample game at `contrib/asteronits/` and the basic project template
# at `lib/gamnit/examples/template/`.
module flat
import gamnit::flat_core
# Extra optional features
import gamnit::limit_fps
import gamnit::keys
import gamnit::camera_control
import gamnit::tileset
import gamnit::bmfont
import app::audio
lib/gamnit/flat/flat.nit:15,1--44,17