omenking / swap-n-pop

http://swapnpop.com
MIT License
46 stars 7 forks source link

Garbage blocks #37

Open omenking opened 7 years ago

omenking commented 7 years ago

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.

Skytrias commented 7 years ago

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

Skytrias commented 7 years ago

little fun note garbage rows that fall on another garbage row dont cause screenshake, but when they fall on normal panels they cause screenshake

omenking commented 6 years ago

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

omenking commented 6 years ago

e

omenking commented 6 years ago

Got the garbage panel rendering. now checking out framedata to start make it falling.

screen shot 2017-10-08 at 5 27 51 pm

omenking commented 6 years ago

Garbage panels now falling

screen shot 2017-10-08 at 9 00 19 pm