I am working on an idea and wanted to get some input, I want to have a grid of objects (Think blocks or bricks) and I want to have AI controlled sprites automatically attack certain blocks. Now The twist here is that when they are attacking one block they should not hit the others, the shots should pass right through. So here is my rough idea, and I am open to anyone else's thoughts on the best way to approach it:
1. Create a grid of blocks made of instances of a sprite.
2. Use an array to track each blocks location and current state.
3. Have enemy sprites that randomly come and shoot/attack a particular block.
4. While that block is being attacked, the surrounding blocks should not block the shots targeting the target block.
5. After 4-5 hits, the block being hit is destroyed
6. At this point a new block is picked and the enemies start attacking it instead.
7. Once a block is destroyed its destroyed state is stored in the array so that it does not get picked again to be attacked.
8. Each block will have multiple states (Whole, multiple levels of damaged, and destroyed). These will be tracked in the Array by assigning a number to each state. For example 6 = whole, 5 = slightly damaged, 1 = destroyed.
9. I may also track how many blocks are left so that I can have an event trigger when all blocks are destroyed.
Something like a block breaker/breakout game except that only a specific brick can be hit at any one time and all other bricks are basically visible but not solid until they are picked as the target...
Anybody have any thoughts on a good way of implementing the logic for this scenario? I haven't had to use arrays much in construct yet, but am familiar with them outside of construct from my developer days. Any thoughts on the best way to do this would be great.