0
Game board
Hi folks, I want to know if someone knows how to move characters inside a Array 2D, please I want to do a game board.
5 Respuestas
+ 2
assuming each index is one tile in your board game, when user presses left you set his position in array like arr[playerIndexX -1][playerIndexY] = player; it should be simple.
______|___X__|__Y|
LEFT | -1 | 0 |
______ |______|____|
RIGHT | 1 | 0 |
_______|______|____|
UP | 0 | 1 |
______|______|____|
DOWN | 0 | -1 |
_______|______|____|
These are the values you should add to player indexes. For diagonal moves just combine two values ex. Up and Right
0
Cool
0
Have not you something more complete to me see it in function?
0
I see a video in YouTube of a Chess called "Chess MS", awesome game, that inspired me, this game has 2 new pieces, Prince and Princess, I would like to do this kind of game.
0
Thanks for your feedback!