This wiki has been moved to https://github.com/SuperTux/wiki into the mediawiki branch.

Difference between revisions of "Game Engine"

From SuperTux
Jump to: navigation, search
(Undo revision 13251 by 50.80.139.102 (Talk))
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
The SuperTux game engine is structured as follows:
 
The SuperTux game engine is structured as follows:
  
On startup, main.cpp instantiates a single MainLoop that is run until the application terminates.
+
# On startup, [http://supertux.lethargik.org/svn/supertux/trunk/supertux/src/main.cpp main.cpp] instantiates a single MainLoop ([http://supertux.lethargik.org/svn/supertux/trunk/supertux/src/mainloop.cpp mainloop.cpp]) that is run until the application terminates.
 
+
# The MainLoop manages, updates and draws all Screens, Controllers, Menus and the [[Console]].
The MainLoop manages, updates and draws all Screens, Controllers, Menus and the [[Console]]. A Screen is the abstract base class for code the MainLoop runs exclusively and full-screen.
+
:*A Screen ([http://supertux.lethargik.org/svn/supertux/trunk/supertux/src/screen.hpp screen.hpp]) is the abstract base class for code that the MainLoop runs exclusively and full-screen.
 
+
:Probably the most important Screen is the GameSession ([http://supertux.lethargik.org/svn/supertux/trunk/supertux/src/game_session.cpp game_session.cpp]), which actually runs a Level ([http://supertux.lethargik.org/svn/supertux/trunk/supertux/src/level.cpp level.cpp]).
Probably the most important Screen is the GameSession, which actually runs a Level. Examples of other Screens are: The SuperTux title screen, a world map or an intro text scroller.
+
:Examples of other Screens are:
 
+
:# The SuperTux title screen ([http://supertux.lethargik.org/svn/supertux/trunk/supertux/src/title.cpp title.cpp])
A GameSession loads and runs a single Level, which consists of multiple, separate parts, the Sectors. Sectors contain the various GameObjects that can be encountered in SuperTux.
+
:# a world map ([http://supertux.lethargik.org/svn/supertux/trunk/supertux/src/world.cpp world.cpp])
 
+
:# an intro text scroller ([http://supertux.lethargik.org/svn/supertux/trunk/supertux/src/textscroller.cpp textscroller.cpp])
Examples of such GameObjects are the [[Badguys]], Players and TileMaps, but also Thunderstorm controllers, the currently visible viewport (i.e. a Camera object), the sector's time limit, etc.
+
  
 +
:A GameSession loads and runs a single Level, which consists of multiple, separate parts, the Sectors. Sectors contain the various GameObjects that can be encountered in SuperTux.
 +
:Examples of such GameObjects are the [[Badguys]], Players and TileMaps, but also Thunderstorm controllers, the currently visible viewport (i.e. a Camera object), the sector's time limit, etc.
  
 
More in-depth information about the game engine can be found in the source code itself, e.g. as [http://supertux.lethargik.org/development/doxygen/html/ Doxygen HTML Documentation], or on pages in [[:Category:Game Engine]], most notably:
 
More in-depth information about the game engine can be found in the source code itself, e.g. as [http://supertux.lethargik.org/development/doxygen/html/ Doxygen HTML Documentation], or on pages in [[:Category:Game Engine]], most notably:

Latest revision as of 17:36, 25 May 2011

The SuperTux game engine is structured as follows:

  1. On startup, main.cpp instantiates a single MainLoop (mainloop.cpp) that is run until the application terminates.
  2. The MainLoop manages, updates and draws all Screens, Controllers, Menus and the Console.
  • A Screen (screen.hpp) is the abstract base class for code that the MainLoop runs exclusively and full-screen.
Probably the most important Screen is the GameSession (game_session.cpp), which actually runs a Level (level.cpp).
Examples of other Screens are:
  1. The SuperTux title screen (title.cpp)
  2. a world map (world.cpp)
  3. an intro text scroller (textscroller.cpp)
A GameSession loads and runs a single Level, which consists of multiple, separate parts, the Sectors. Sectors contain the various GameObjects that can be encountered in SuperTux.
Examples of such GameObjects are the Badguys, Players and TileMaps, but also Thunderstorm controllers, the currently visible viewport (i.e. a Camera object), the sector's time limit, etc.

More in-depth information about the game engine can be found in the source code itself, e.g. as Doxygen HTML Documentation, or on pages in Category:Game Engine, most notably: