Palm-Studios / sh3redux

SILENT HILL 3 Engine Remake in OpenGL and C++
GNU General Public License v3.0
158 stars 15 forks source link

Basic state based game system #146

Closed Quaker762 closed 5 years ago

Quaker762 commented 5 years ago

A very barebones implementation of a state based game system. The game itself is modelled as a series of 'states', a state being an object that contains all code and data required for a particular 'screen' the game is in (for example, all 3D geometry data would be loaded in the 'game' scene, while all inventory data would be contained in the 'inventory' screen).

As everything in the original SH3 is hardcoded, this significantly reduces the amount of code required, being that we can just feed a scene name (e.g `mr3f) into the state and have it worry about loading everything.

There is a lot that could be refactored here, as the code is a little bit janky, but for now this works.