GalaxyEggbertCnaGame
CNA Game subclass — the entry point and per-frame driver of GalaxyEggbertCNA.
Overview
GalaxyEggbertCnaGame (namespace GalaxyEggbert::CNA) subclasses
Microsoft::Xna::Framework::Game, CNA's XNA-compatible game base class. It owns the
world runtime, terrain renderer, tile atlas, texture, effect, Blupi controller, and camera.
Sources: src/GalaxyEggbertCNA/GalaxyEggbertCnaGame.hpp and .cpp, constructed from src/GalaxyEggbertCNA/main.cpp.
Construction
Sets the window title via getWindowProperty().setTitleProperty("Galaxy Eggbert (CNA)").
Overridden Methods
LoadContent()
- Loads the default world:
worldRuntime_.LoadFromVwrFile("worlds3d/world001.vwr"). - Builds a
GETerrainRendererfrom the loaded world plus aGETileAtlas. - Loads
Content/icons/object-m.pngas a CNATexture2D. - Creates a
BasicEffectwithVertexColorEnabled=false,TextureEnabled=true, bound to that texture. - Places
GEBlupiControllerat spawn(0, 1, 0).
Update(GameTime& gameTime)
- Calls
Game::Update. - Advances
worldRuntime_.Update(dt)— drives the 6 fps tile-animation phase. - Reads
Keyboard::GetState()for arrow keys + Space. - Steps
blupi_.Step(world, dx, dz, jump, dt). - Updates the
Easy3D::Camera3Dto follow Blupi (SetTarget/SetPosition).
Draw(const GameTime& gameTime)
- Clears the device to sky blue (
0.392, 0.584, 0.929, 1.0). - Enables depth test.
- Sets the terrain effect's View/Projection from the camera, World to identity.
- Calls
terrainRenderer_->Draw(device, *terrainEffect_). - Includes a one-shot terrain-visibility self-check that samples backbuffer pixels via
GetBackBufferData().
What This Class Does Not Do
No phase/state-machine dispatch, no HUD, no sound, no object rendering, no Blupi sprite. It is purely: load one world, render its terrain, move an invisible collision point through it.
Dependencies
- CNA:
Game,GameTime,Texture2D,BasicEffect,Keyboard/Keys - Easy3D:
Camera3D GEWorldRuntime,GETerrainRenderer,GETileAtlas,GEBlupiController