Rotating around a piece in a board game
Got a board game I am working on for the heck of it, its pretty simple.
I have different colored pieces, the way you move is by clicking on one of your pieces, depending if its a right click or a let click I want all the surrounding pieces to rotate one square CW, or CCW.
Thats all dandy, but every time I start to code it I run into special cases I cant figure out for some reason, like if it is completly surrounded by pieces, none of the pieces will move because they will collide on their first attempt at updating. I would have to move them all simotaniously.
Im not sure I made that clear enough
I have different colored pieces, the way you move is by clicking on one of your pieces, depending if its a right click or a let click I want all the surrounding pieces to rotate one square CW, or CCW.
Thats all dandy, but every time I start to code it I run into special cases I cant figure out for some reason, like if it is completly surrounded by pieces, none of the pieces will move because they will collide on their first attempt at updating. I would have to move them all simotaniously.
Im not sure I made that clear enough
The machine does not run without the coin.
Could you use a 'before' state and an 'after' state? So if you had an array representing the board, you'd calculate each piece's new position and write it to the 'after' array. Then when you've done that for every piece, you can replace the 'before' with the 'after'. Or animate from one to the other.
Or am I misunderstanding your problem?
Or am I misunderstanding your problem?
maximile Wrote:Could you use a 'before' state and an 'after' state? So if you had an array representing the board, you'd calculate each piece's new position and write it to the 'after' array. Then when you've done that for every piece, you can replace the 'before' with the 'after'. Or animate from one to the other.
Or am I misunderstanding your problem?
No you understand it. Not sure why I didn't think of that at all, maybe since im playing super smash bros at the same time? Not storing it in a 2d array though, so Ill just make a destination x/y position variable, thanks.
The machine does not run without the coin.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Board Game Design | ahnona84 | 0 | 2,213 |
Oct 31, 2011 11:54 PM Last Post: ahnona84 |
|
| skeleton for a board game | sefiroths | 6 | 6,480 |
Nov 30, 2010 12:51 PM Last Post: ThemsAllTook |
|
| Question on AI and board games | Taxxodium | 3 | 3,631 |
Oct 8, 2004 01:44 PM Last Post: Taxxodium |
|
| Board Game idea...needs coder | CaptKevMan | 2 | 3,376 |
Apr 11, 2003 05:06 PM Last Post: CaptKevMan |
|

