So lets say i'm making a board game. i've got a game board array, my logic needs to check for position and collision detection, thats all fine.
Traditionally using something like directX you would have a game loop, test some logic, update the game board array and finally draw the screen, but with cocos2dx we don't directly draw to the screen we add sprite to layers, and cocos does the rest!
For instance..
- Initialise a game array that represents the game board
- Initialise a game object
- add objects to the array
- update the screen (render the array to the screen)
- start game loop
- Test for some logic condition
- remove object from array
- more Test for some logic condition, update object position
- add objects to the array
- update the screen again
- loop
The previous would work fine but i don't need to remove the object from the layer only to update its position and re-render to the screen, with cocos2d/cocos2dx if i keep a reference to that object i could just move it, and update the array.
I can continue with this approach, but i want to know if i'm missing something.
The game array helps with the game logic and mimics the actual playable area, but i can't help feeling its a bit stone-age.
Can anybody help with this, am i completely missing the plot?