MCPcopy Create free account
hub / github.com/atraczyk/2d-engine / G_initializeGame

Function G_initializeGame

engine/src/game.cpp:144–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144void G_initializeGame()
145{
146 game.loadConfig("config.ini");
147
148 window.initialize();
149
150 game.clientRect =
151 ScreenRect(0, 0, window.currentWidth(), window.currentHeight());
152 game.aspectRatio = game.clientRect.w / game.clientRect.h;
153 game.sceneRect = ScreenRect(0, 0, 1920, 1080);
154
155 player.initialize(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
156 &game.atlases.sprites);
157 player.frames = &game.atlases.test;
158
159 initializeTileAnimations();
160
161 sound.load();
162
163 G_initializeEvents();
164
165 U_Load_demo();
166
167 font.initialize(16, 16, 8, 8, 1.0f, &camera, &game.clientRect,
168 &game.atlases.font);
169
170 world.gravity = Vector2(0.0f, GRAVITY);
171
172 G_initializeMenus();
173
174 bpause = true;
175
176 camera.pTarget = (MovingObject*)&player;
177
178 gametime.initialize();
179}
180
181void G_loadLevel(const char* file)
182{

Callers 1

mainFunction · 0.85

Calls 11

ScreenRectClass · 0.85
initializeTileAnimationsFunction · 0.85
G_initializeEventsFunction · 0.85
U_Load_demoFunction · 0.85
Vector2Class · 0.85
G_initializeMenusFunction · 0.85
loadConfigMethod · 0.80
currentWidthMethod · 0.80
currentHeightMethod · 0.80
initializeMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected