Jump to content
  • Advertisement
Sign in to follow this  
code_nerd

Game Loop in a roundbased 2-D Wargame

This topic is 4773 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi folks, i am trying to code a roundbased 2-D Wargame like "Panzer General" or "Battle Isle" but much smaller, at the moment i have a Map generated out of Hexfields, which i can identify when klicked on. Now, before going on, i think it would be better to develop a game loop, since i am having trouble already when to call OnPaint,... So my question, can anybody give me an overview or some examples how a game loop in such a roundbased HexBattleGame should look like? Exspecially at what time i need the OnPaint. I am using GDI+ and C#. Thanks for your time.

Share this post


Link to post
Share on other sites
Advertisement
What is OnPaint? I am not familiar with C# so I don't know how it works - is it a function that you fill in with the details of updating the screen? Generally your game loop will look like this, no matter what type of game it is:

while not finished:
collect events
update entities and game state based on events
render entities and update display

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!