NOGDUS
December 17, 2018, 03:05:26 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Blogs Help Search Tags Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: GameState::Update()  (Read 2994 times)
0 Members and 1 Guest are viewing this topic.
Cycl0ne
Guest
« on: April 17, 2011, 02:49:31 PM »

Hi,

the more I dig into it, the more I really love it. Its not the graphics engine whats so impressive, but the whole mechanics you implemented. If SDL or any other Library would see what you have build.....

Ok but to get back to my Question. If I use the GameState Engine, i have to create a class with the following Method:
void GameState_FrontDoorAnimation::Update(float deltaTime)
{
}

Now my Question: The deltaTime. Is it fix? Or is it the fastest possible thing? How can i create a smooth animation, that will be fix on any machine? do i have to calculate with the deltatime? or can i rely that i get called (every 25fps/60fps/...)?
Logged
Mattias Gustavsson
Moderator
Member
*

Respect: 58
Offline Offline

Posts: 94



« Reply #1 on: April 18, 2011, 01:19:32 PM »

I'm glad you like it  Grin I've made sure to have actual game projects drive all of the development - it's the best way to make sure your features end up being nice to use Smiley (a brief outline of which games added what functionality can be found here

The deltaTime is determined by the FrameTime object, and passed through to all the engine systems. It is not a fixed rate - it measures the time elapsed since last update, so you need to scale object movement by it to get the same animation rate on all machines. It will, however, be locked to the update rate of your screen, so on most systems, you will probably get a delta time of 1/60th of a second.
Logged
Cycl0ne
Guest
« Reply #2 on: April 19, 2011, 07:05:07 AM »

Ok, I understand. Hmm I have to finaly Port the engine to android based mobile devices to see how the framerate locks there.

I got my hand on a cool book (Game Coding Complete), there are some ideas, that would perfectly fit into the engine. Mind if I posted some Ideas sometime? Especially the "Process"-Manager Thing form the book would make pixie even "cooler". Have to think about it. I will show you then what i mean.
Logged
Mattias Gustavsson
Moderator
Member
*

Respect: 58
Offline Offline

Posts: 94



« Reply #3 on: April 19, 2011, 08:19:24 AM »

yeah, feel free to post any ideas Smiley it's always interesting to hear of different ways of doing things!
Logged
Cycl0ne
Guest
« Reply #4 on: April 19, 2011, 05:19:34 PM »

Tomorrow (ohh shit so late, today) i will write down a first idea. with perhaps some code. Now i have to go to bed Smiley Wife screaming Cheesy
Logged
Tags:
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!