Tonight I took about 3h to write the core code for Atom, which infact consists of a CellManager class, a Cell class and a IGameStateQueryable interface (needed as my CellManager is a generic class, the idea being I can drop it into anything which can hook a UI to it and provide it with a couple of support functions).
The game is infact pretty easy logic wise;
- You select a tile
- If the tile was empty or one of yours then an 'atom' is added to it
- If the atom count in that title goes over the limit then you reset your count to 1 and tell the manager to update your neighbours
- You then signal 'end of turn'
The manager then performs it's updates by working threw a queue of cells to update until it is empty.
This condition was needed as chain reactions can build, so each cell checks it's state and if it has gone over it's limit it queues it's neighbours for updates and so on.
Thinking about it, this could lead to a big infinite loop so there probably needs to be some kinda check/tracking of which player owns which tiles, so when all the tiles are in play and all belong to one player than player can be declared the winner.
The keypoint however is the basic logic and board seeding is in place, the above might need a slight recode to deal with it but other than that I feel good about todays progress.
One thing I couldn't help but wonder however, is there code already in existance in the .Net framework which would have allowed me to find the neighbours for each cell easier than my bruteforce/loopy method I hacked up earlier? I think I'll check...
Hopefully I'll have some kinda alpha of this game done by next weekend.. infact, I'm hoping before thursday as thats when I go back to college.. inital version might even be Pocket PC 2003 based so I can show people it running on my phone [grin]