Hello eXpl0it3r,
I used your gravity example and its working without problems.
I tried to use a similar code of my game, but the gravity dont works = its "too slow". I really think, the problem is, that my game needs over 4000 FPS to works well. So if the FPS going limited by window.setFramerate(60), by FRAPS (60 FPS) or MSI (100 FPS), so my game dont works well anymore. I think, thats the problem. But I dont know, how I solve this. Maybe its caused by my time-process? I would show you some parts of my code:
main.cpp: float ElapsedTime = clock.restart().asSeconds();
spawnTime+=ElapsedTime;
animationTime+=ElapsedTime;
//(...)
if(spawnTime>=3.0)
spawnTime= 0; // I write this because I think its causing lags
//(...)
main.cpp:
if(start==false &&gameOver==false)
{
gui.DrawStart(window);
}
if(start==true &&gameOver==false)
{
if(player.life<=0)
{
start=false;
gameOver=true;
}
// main process of game, im using only void for all processes
}
else if(start==false &&gameOver==true)
{
gui.DrawFinish(window);
}
else
{
// nothing at first moment
}
Its my first project that im working with full classes (at all, its my second game project). I know its not 100 % clean, but Its for my practice.
I hope, you can me tell more. If you need more, I can post it.
kursukia
edit & ps: WinXP = I know. Im going to change next year (1- 2 month) to windows 7 home
So its time to say goodbye to WinXp. My personally beautiful office os.
edit 2: I think, i going to "slow down" some variables to adjust it to 60 FPS. I going to try it. I post in few hours a reply to tell you, if its work. Normally that should to be the solution.
Final Edit: Now its working well.
I limited the FPS to 60 with window.setFrameRate... from unlimited / 4000 fps and adjust my variables (decrase speed, gravity variables and timer and so on) to fps 60 and now its working all fine.
The only on not so good think is, that the movement of enemys and player are not smooth anymore. So FRAPS says the game have 30 FPS. If I record, the FPS is jump to 60 FPS and all movement is smooth.
What I see too: The timer is suddenly work "faster" if the FPS is on 60.
So I found a "balance": I set the frameLimit to 70 - 90 for windows and the movement is smooth plus the timer is not going too crazy. FRAPS says 64 FPS without recording, and 90 FPS on recording. But is this normal? Its normal that the timer is working faster if the FPS is higher? Its interesting too see whats happening for my experience.
Kursukia