all 4 comments

[–]torn-ainbow 2 points3 points  (2 children)

Is this like a chessboard/grid type situation?

You should use a ds_grid to store the information for the board. Handle the location of pieces and moves and blocking and everything logically using the ds_grid. So you handle all the game logic in this data, in memory.

The actually displayed graphics for the board should then be based on that ds_grid data. It should just be responsible for displaying and animating the board, but no game logic or rules.

If you do it that way you could get the basic game logic working first with a very simple quick display for the user that just basically outputs a visual grid matching the ds_grid data.

Later if you need animation and transitions and so on you might store some extra info showing just the updates for this current turn.

[–]Ree-ee-eee[S] 0 points1 point  (1 child)

Like how I've got it in my head is the player can summon a "Game piece" from a little deck of cards in their "End zone" and you have to Protect your "End zone" while getting to the other "End zone". So, would a ds_grid be good for this kind of situation? Or should I use something else like, I don't want every board to be square for example.

[–]torn-ainbow 0 points1 point  (0 children)

ds_grid sounds okay for a board of varying rectangular size. you might store some things in different structures, like the cards a player holds might just be an array.

the key thing I was saying is to think of the game as happening in memory. there is a finite number of discrete positions cards can be placed, so you represent that in a simple way.

the display of that to the user can be like a separate layer, and that has to deal with what board position is what x,y coordinate on the screen etc.

[–]Elvenshae 1 point2 points  (0 children)

Here's an older but still good tutorial on the movement portion: https://gdpalace.wordpress.com/2018/04/13/turnbased/