Game flow concept
hello....i m a newbie in game programming.
Recently i m trying to create a game using visual c++ and directx..somehow when come to thinking of the game flow algorithm...i m stuck...
I dont understand hows a game able to do so many things ( like detecting collision, updating hi score, updating screen, accpeting user input and go to next game level, etc...) in the same time..
i have been thinking about this for weeks...but i m still stuck.
I just cant understand the concept.
I been thinking to create a simple side scrolling aircraft shooting game for my college multimedia project and i have been working hard in learning visual c++ and directx.
I hope that those who are experts and beginner that better than me can help me in solving this problem...i m really stress out.
Thanks.
Do them sequentially. My games have so far been:
Draw screen -> get user input -> detect collision -> update sprites -> draw screen . . .
(main animation loop)
if you want to change levels, then just continue that loop until the conditions are met, at which point, exit the loop, change level, start the loop again. Or change the level inside the loop.
Draw screen -> get user input -> detect collision -> update sprites -> draw screen . . .
(main animation loop)
if you want to change levels, then just continue that loop until the conditions are met, at which point, exit the loop, change level, start the loop again. Or change the level inside the loop.
Several billion trillion tons of superhot exploding hydrogen nuclei rose slowly above the horizon and managed to look small, cold and slightly damp.-The Hitchhiker's Guide to the Galaxy by Douglas Adams
Have you developed anything yet? I think that you'll find out that if you follow the "standard" way of doing things you wont even have a problem.
What i usually do is very straight forward:
bool initialize();
bool drawScreen();
bool handleInput();
Main()
{
initialize();
Loop:
{
drawscreen();
handleinput();
}
}
Dont know if this helps, but i suggest you start and if you run into problems conccernig framerates and performance ask about that specific problem.
Good luck
Edited by - NewDeal on October 10, 2000 10:21:43 AM
What i usually do is very straight forward:
bool initialize();
bool drawScreen();
bool handleInput();
Main()
{
initialize();
Loop:
{
drawscreen();
handleinput();
}
}
Dont know if this helps, but i suggest you start and if you run into problems conccernig framerates and performance ask about that specific problem.
Good luck
Edited by - NewDeal on October 10, 2000 10:21:43 AM
If you havent already, try looking in the reference section. You can spend days reading the wonderful articles that are in there. I know there will be -atleast- one article on how to put together a good side scroller. You might also check out the resource file articles... I found these to be particularly interesting.
There is no spoon.
Thanks guys..i know what i should do now.
Thanks a lot...i will try to do a simple one and see what happen.
Thanks a lot...i will try to do a simple one and see what happen.
it took me months to read all the articles
And computers don''t do all that stuff at the same time wedgeboy. they just do it so rapidly people can''t tell they aren''t happening simutaneously.
At a frame rate of 33fps, you have 30ms to get everything done.
I''m not sure what the actual numbers are, but if it happens within about 50ms of when its supposed to, it looks instantenous. Mouth/voice sync and some other stuff probably needs to be better than that, but most stuff doesn''t.
Typical windows programs sleep 10ms every time they get bored (which is frequently); games dont they run non-stop and suck up all available system resources; unless its a minesweeper type game. then you should sleep too.
Every once and a while, windows swaps out your game does something else and returns to it 10ms later. So on occasionally your frame rate will vary in windows.
And computers don''t do all that stuff at the same time wedgeboy. they just do it so rapidly people can''t tell they aren''t happening simutaneously.
At a frame rate of 33fps, you have 30ms to get everything done.
I''m not sure what the actual numbers are, but if it happens within about 50ms of when its supposed to, it looks instantenous. Mouth/voice sync and some other stuff probably needs to be better than that, but most stuff doesn''t.
Typical windows programs sleep 10ms every time they get bored (which is frequently); games dont they run non-stop and suck up all available system resources; unless its a minesweeper type game. then you should sleep too.
Every once and a while, windows swaps out your game does something else and returns to it 10ms later. So on occasionally your frame rate will vary in windows.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement