swap-n-pop
swap-n-pop copied to clipboard
Garbage blocks
This is quite a large ticket and it currently serves a very high level ticket for my thoughts on how I plan to implement garbage.
Garbage blocks will need to occur on their own layer on the playfield and have their own stack and the stack will be managed just as if its a set of panels. We need to keep the grouping of garbage together when an internal id.
Its possible for us to use the same stack as panels, but then our stack would have to extend far beyond the range of the screen. We might have to extend the panel stack anyway because if you clear garbage offscreen those panels do become part of the stack.
- [x] increase stack to support 24 rows
- [x] create a queue to hold incoming garbage
- [x] create garbage panel
- [x] ensure basic garbage falls
- [ ] add advance garbage logic for chain vs combo
- [x] garbage should clear when comboing
- [ ] garbage should change size based on chain, combo values
- [x] garbage should shake the screen
- [ ] garbage should only allow so much on screen
my major difficulty was in detecting anything happening around a garbage block and transfering it to its neighbor garbage blocks. Eventually the only solution that worked for me was to have garbage Blocks be basically "stupid" panels ie with empty state machine. But each garbage block still has its variables and methods and also are able to survive in the stack - be detectable.
So the way i handled garbage blocks in the stack was per (horizontal) rows. I would then detect each Row in the stack and have Detection of Falling be based on the whole Garbage Row itself.
When is a Garbage Row supposed to Fall? When all Panels are Empty below, but how far should the Row fall. I just had the Fall height calculated through the lowest height detected below each Garbage Block in the row - how many empty blocks were below.
Once you are able to detect Garbage Rows you can easily check for things around them, tho a problem was checking for other Garbage Rows. Another thing was "2d" Garbage Rows and how differently they would be needed to work in my old System.
It was hard to get the System running but i think thats the best "simple" way. Otherwhise youd have to probably do shenigans similar to the chaining or any interconnection working smoothly between each garbage block. I guess it wouldnt be difficult to have them speak to each other but who's going to say, ay we're a row now lets fall. every block would do that.
sorry lots of text, just my thoughts and experience on what i had working
little fun note garbage rows that fall on another garbage row dont cause screenshake, but when they fall on normal panels they cause screenshake
Reported by sharpobject, he says the game can only have one garbage overflowing off screen at a time and rest will wait in queue. The largest garbage blocks would be 13 and there are 12 visible rows meaning our stack only needs to be 24 rows in height.
See here we can see the garbage functionality. https://youtu.be/_SE6Iwd4Vgo?t=11m29s
e
Got the garbage panel rendering. now checking out framedata to start make it falling.
Garbage panels now falling