Jump to content
  • Advertisement
Sign in to follow this  

help making a 2D board game

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

I need an emergency plan for idiots on making the simplest of the 2d board games. I have been advised (by the way, thanks, guys) to learn to actually program it. Ok, I'm in need of serious help. This is what I guess I have to do in order to start (I know is all too obvious reasoning, but I´m simply on that stage...): 1- In order to make the simplest of the board games in 2D you must have a background image first, which actually is the board, with all the different squares and graphics. I suppose that the best way to do it is by painting it yourself, or using software. 2- You have to create also graphics for the different objects that are going to do something on the board, from dice and counters to further developed characters if there’s to be any. 3- Somehow you must make the computer understand that it has to react when one of these objects falls at certain regions of the background image. 4- Then you have to program the actions: (4a) When a player presses a key, the computer changes the graphic of the dice and gives you a number from one to six and an object moves somewhere accordingly (where something happens, of course). (4b) In one square the object is going to move somewhere else, in another it has to wait the next round without playing, etc. (4c)You must also make it possible for a certain number of players to participate in turns. (4d) Keep the scores, if the object of the game is other than simply reaching the last square. And I don’t have the slightest idea of what comes next, except from making it executable, very important. Anyways, excuse the leght of the topic...:)

Share this post


Link to post
Share on other sites
Advertisement
Problem one:

You need to separate your graphics from your gamestate.

If you're doing a board of squares, then have 2 dimensional array represent that. Do all your modifications and logic on that board, don't even worry about graphics when programming your game logic.

Then you need a function that renders your gamestate. This function doesn't care who is winning or about how the players makes a move or anything. It's only job is to draw onto your screen, the state of the game. It would draw the background, then all the game pieces on top of that, and maybe the score or other such things. The important thing to remember is that the graphics have NOTHING to do with the actual logic of the game.

Doing it this way, you could even write the whole game to use the console, and do simple ASCII graphics, then once the game plays properly, all you do is rewrite the one draw scene function to use actual graphics. (that was a simplification, but the general idea works)

Here's how I would make the game loop (in pseudo-code):

Start Loop
Check for user input
Update GameState (change gamepiece positions if necessary, do logic to see if moves were valid if they score, etc.)
Draw Gamestate to Screen
End Loop

If you have any other questions, you could PM me.

Share this post


Link to post
Share on other sites
On a second read-through of your topic, it looks like you're trying to create a board-game more like Life, or Candyland, or Jumanji... Where you have multiple players racing along a path to the finish. Correct me if I'm wrong.

Don't think of the path on the gameboard as a winding, wandering phyisical object. Imagine it in one long straight line from beginning to end. Then it's easy to represent as an array. In the array, I'd put information specific to each "square" in the path. I'd put a variable for the type of square (normal, lose a turn, draw a card, etc.) I'd put variables for the X and Y position of the square, so that would know exactly where to draw the players' pieces.

Then I'd have an array of players. A player would contain the graphic for his playing piece, his position in the map, and his current state (normal, lost a turn, etc).

Don't worry about animating the dice rolling or the pieces moving along the board yet. Just have them jump straight there when a piece is moved. Do animation type stuff once you have the logic of the game worked out.

Good luck with all of it.

Share this post


Link to post
Share on other sites
If you are really a "Clumsy Begginer" :) then you need to spend a long time (for me, in C++, without ever taking a class about 1-2 years) learning to program solidly before working with graphics. Thats my experience, and I think that most people will tell you the same. I play warhammer, which is a tabletop game you play with small figurines that you assemble and paint yourself. Think of the actual model as the inner gameplay, the controls, and the overall shape and function of you r program. Think of the paint job as the graphics. While the model isn't going to look any good without the paint job, it is not nearly as important as putting the model, or the game, together properly. </analogy>

I would suggest that you start even simpler - guess-the-number. Its very important that you learn how to organize your ideas for the game so they can come together in a cohesive whole rather than a mismatched jumble.

[EDIT] Kudos for thinking through your game ideas before posting, though!

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!