1
SFML projects / Creating a classic game
« on: February 26, 2022, 02:39:22 pm » public void Run()
{
load();
// game loop
Clock clock = new Clock();
while(window.IsOpen)
{
window.DispatchEvents();
totalTimeElapsed = clock.ElapsedTime.AsSeconds();
deltaTime = totalTimeElapsed - prevTimeElapsed;
prevTimeElapsed = totalTimeElapsed;
frameTimeElapsed += deltaTime;
if (frameTimeElapsed >= UPDATE_TIME)
{
update();
this.window.Clear(this.backgroundColor);
draw();
this.window.Display();
}
}
}
{
load();
// game loop
Clock clock = new Clock();
while(window.IsOpen)
{
window.DispatchEvents();
totalTimeElapsed = clock.ElapsedTime.AsSeconds();
deltaTime = totalTimeElapsed - prevTimeElapsed;
prevTimeElapsed = totalTimeElapsed;
frameTimeElapsed += deltaTime;
if (frameTimeElapsed >= UPDATE_TIME)
{
update();
this.window.Clear(this.backgroundColor);
draw();
this.window.Display();
}
}
}
Hi, there. I just started making a link-up game with SFML.Net and was surprised by how great this tiny library is. By developing the game, I am also learning the structure of a game engine. Here i am seeking advices for the development of a game engine (especially lighting system), anyone there could share his experiences?