🔒 Locked
Board implementation in visual programming
Advertisement
Original Post
I''m working on a board game programming, and I have a question about it. How to make the board (the interface) that user will use to play the game? (I use boarland C++ Builder). Should I use image to represent the board? Or I have to use button? The board size is 19x19, so, should I make 361 small pieces of the board that user can clik and do a programming on each of that? (use on-click action?)
thx
either way really would be fine. As long as you code it well enough, having 361 "tiles" for the board shouldn''t be much slower (do your best to keep each tile object as trim as possible). Plus having seperate tiles will make it a touch more robust and allow you to do some cool things with the board more easily (e.g. Raise the tile that the player''s mouse cursor is currently over a bit).
quote:
Original post by MelvinElvin
either way really would be fine. As long as you code it well enough, having 361 "tiles" for the board shouldn''t be much slower (do your best to keep each tile object as trim as possible). Plus having seperate tiles will make it a touch more robust and allow you to do some cool things with the board more easily (e.g. Raise the tile that the player''s mouse cursor is currently over a bit).
and, can I just make one function to control all that "tiles"? (how?) or still I have to do a single manual coding for each tile?
well is this in visual basic, basic.NET, c++? there are alot of IDE''s out there for every language. if it''s an object oriented language then make a button object!
if it''s VB, just create a Buttwhenclickedoned function and whenever a button is clicked, forward any relevent data like mouse position, tile state (occupied? active?), etc to Buttwhenclickedoned. Then just use a for loop to create your buttons where you need them when you start up your game.
if it''s VB, just create a Buttwhenclickedoned function and whenever a button is clicked, forward any relevent data like mouse position, tile state (occupied? active?), etc to Buttwhenclickedoned. Then just use a for loop to create your buttons where you need them when you start up your game.
quote:
Original post by Penance
well is this in visual basic, basic.NET, c++? there are alot of IDE''s out there for every language. if it''s an object oriented language then make a button object!
if it''s VB, just create a Buttwhenclickedoned function and whenever a button is clicked, forward any relevent data like mouse position, tile state (occupied? active?), etc to Buttwhenclickedoned. Then just use a for loop to create your buttons where you need them when you start up your game.
i use borland c++ builder..
quote:
Original post by reeanquote:
Original post by MelvinElvin
either way really would be fine. As long as you code it well enough, having 361 "tiles" for the board shouldn''t be much slower (do your best to keep each tile object as trim as possible). Plus having seperate tiles will make it a touch more robust and allow you to do some cool things with the board more easily (e.g. Raise the tile that the player''s mouse cursor is currently over a bit).
and, can I just make one function to control all that "tiles"? (how?) or still I have to do a single manual coding for each tile?
ummm, lost me a bit on what you''re asking for there. control the tiles how?
I''d really just have the tiles largely as data structures, pointer to the "piece" (or whatever is in your game), a position, that sort of stuff. Any actual manipulation (like picking or say raising a tile when the cursor is over it) should be done by an external piece of code. Maybe have a board object while holds a linked list of all the tile objects, and have the board do all the manipulation of the tiles and so on and so forth. This is just basic code structuring though and you should really do it however you want. I would keep as much code seperate from the Tile object as possible though, since you''ll have heaps of them you won''t want them taking up too much room in memory.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement