gbusto / BrickBreak

An attempt to make a game like "Ballz" or "Bricks and Balls".
1 stars 0 forks source link

Update Item Hit Processing #593

Closed gbusto closed 5 years ago

gbusto commented 5 years ago

Right now the way we process item hits, it just goes down the list of items. One case I can think of where this won't work is this:

A mystery block that gives a "clear row" reward breaks all blocks in a row and also breaks a bomb. If the mystery block is after the bomb in that row, we will skip over the bomb as it was not hit. When we get to the mystery block that needs to break, it will go through and mark all items in that row, including the bomb, as having been hit. But we will never reach the logic that tells the bomb to get hit and break the items around it.

One way I can think of handling this is to have separate functions (in the ItemGenerator) that handle hitting an item of a particular type. Every time an item is hit, we need to make sure that we call its hit function only ONCE to figure out what items to remove.

gbusto commented 5 years ago

Scenarios to try:

  1. 2 mystery block items in the same row; breaking 1 should break both
  2. A mystery block with a bomb in the same row; breaking the mystery block should break the bomb and the bomb should break all surrounding items
  3. Same as previous scenario but have a mystery block in the row above the bomb that should also break and break that row too
  4. Need to have a test where we also collect ball items when a bomb or mystery block breaks
gbusto commented 5 years ago
  1. Add a scenario where 2 bombs are adjacent and break each other as well as a mystery block