Beginner's Guide to Game Programming Ep1 Part 7-A Regulating FPS in Allegro 4
Uploader Comments (LusikkaMage)
All Comments (24)
-
@LusikkaMage ok i'm confused, so in the counter loop I have character.update which gets the input and I have character.draw in the counter loop which blits the character to the buffer. Outside this loop but still in the game loop I have the buffer blitted to the screen. When I run the game, problems occur.
1. the walking animation is way too fast, how do I slow it down.
2. the character flashes..
what do I do?
-
question, when I run that code, i get an error:
Unhandled exception at 0x100dabf5 in (name of game i'm making): 0xC0000005 Access violation reading location at 0x00000098.
what do I do.
-
Your tutorials are fabulous! Thank you!
-
The inner loop is essentially for getting input, as it might happen more than once per cycle. You only want to draw once per cycle, so you won't put it inside the loop.
-
@LusikkaMage Quick Question. Why should the draw to the screen stuff be outside the second while loop?
why can't you put it inside the second while loop and then clear the buffer in the first while loop?
so basically like this
while (!done) {
while (counter > 0) {
/// update
blit (Buffer, screen , 0 , 0, 0, 0, 640, 480);
}
clear_bitmap (Buffer);
}
-
Great video, I thought when I read the title, that you refered FPS as First Person-Shooter.HAHAHA!
-
that's pretty spiffy, i love your tutorials. Is it a good idea to try to limit the logic loop too? As to avoid eating a lot of cycles, I mean. Could i have the game calculate the logic 100 times per second and no more, for instance? That would be nice, right?
When i build it i get this error c:\mingw\bin\..\lib\gcc\mingw32\4.5.2\..\..\..\libmingw32.a(main.o):main.c|| undefined reference to `WinMain@16'|
||=== Build finished: 1 errors, 0 warnings ===|
i dont know what the problem is ? btw im using code::blocks
Xaloez 9 months ago
@Xaloez Do you have END_OF_MAIN(); immediately after the main function block?
LusikkaMage 9 months ago
I have two questions, in the loomsoft tutorial, they used "END_OF_FUNCTION(incCTL), don't we need that. and why do we decrease the variable?
AlliedSamurais 2 years ago
Ahh, I looked it up. You need it for a function that's been LOCKed by a timer, but doesn't seem necessary for anything else.
LusikkaMage 2 years ago