Hello all TGC community, i used to code in DARK GDK like 3 years ago i think, but then i began using PHP and i let the dark gdk aside.
1 year ago i found allegro, a 2D Game library based on OpenGL, and i made a little engine with basic features to a platform game.
a few days ago i begin question myself: "why won't i use DarkGDK since it has more to offer than allegro?"
So i dicided to migrate the engine coding to darkgdk, and i made it in less than 1 day because it was just some C&P with some syntax changes.
Ok now i got my project setup 100% but when i try to go in-game the game is just too slow, i set the display of the fps ON and it's on 1~4 per second...
Not sure why..
Anyway, since it's an engine it has some classes and other functions and since i will release the Open source when its finished i uploaded all project into mediafire.
If you guys could help me with the fps errors it would be great.
The fps issue is on this part of the code:
LOOP
{
if(state == 1)//gamestates
{
//blabalbla
}
if(state == 2)//actual gameplay
{
dbPasteImage(BACKGROUND_IMAGE, 0, 0);
map.Draw();
player.Update();
player.Draw();
enemy.Update(map.getLevel());
enemy.Draw(map.getLevel());
//collision.Update(player, enemy, map);
//camera.Update(player.x, 0);
//camera.Draw();
UpdateBullet(bullets, NUM_BULLETS, enemy, map);
DrawBullet(bullets, NUM_BULLETS);
if(shoot_timer > 0)
{
shoot_timer = shoot_timer - 1;
}
if(dbKeyState(DIK_SPACE) && shoot_timer < 1)
{
FireBullet(bullets, NUM_BULLETS, player);
shoot_timer = 30;
}
FRAME_RATE = dbScreenFPS();
strcpy(SCREEN_FPS,"Frame Rate: ");
strcat(SCREEN_FPS,dbStr(FRAME_RATE));
dbText(0,120,SCREEN_FPS);
}
}
its on the state==2 that the fps is really limited.. Thanks in advance
Here's the download:
http://www.mediafire.com/?as8n5iiw87616nu
C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)