Jump to content
  • Advertisement
Sign in to follow this  

Architecture Question for VB.NET WinForm turn-based game

This topic is 2304 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

Good afternoon.

I am writing a turn-based game where one human player competes against one AI player. I'm writing it in VB.NET as a WinForms app.

I wrote a simple version of the game as a Console application just so I could spend time working out the details of the game mechanics and not fret about the UI. Now that I'm moving my code into a WinForm application, I'm up against an architectural question.

In my Console app, I eventually get to code that looks like this:

GameOver = CheckVictoryConditions()
Loop Until GameOver

In the Console, this makes sense because everything is procedural. When the game prompts you to choose an action, it waits for you to enter your decision via the keyboard. In a WinForm app, it's a completely different context because everything is event-driven (e.g. button clicks).

Are there other .NET developers who have coded turn-based games who wouid be willing to share how their game is architected? Specifically, how did you address the issue of a turn-based system in the context of WinForms? Edited by DWRoelands

Share this post

Link to post
Share on other sites
Events are key, wait for an event on the form (ie the user clicking a button) and then process this input as usual, then once the player turn has ended (a button in the corner civilization style or whatever works best for your game) simply call the function for the AI turn, the AI turn should update the form accordingly. I don't currently have code to share unfortunately but I hope that short insight helps

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!