You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm trying to find a simple way to create a ghost piece display.
This is essentially showing the piece where it will fall should you press hard drop that moment.
Recommendations ?
The text was updated successfully, but these errors were encountered:
I would probably try one of two ways. It can be thought of as a simulated drop, so you could create a new piece, drop it all the way down, and then create a drawGhostPiece() function or something similar. If I wrote it this way, I would probably factor out the parts of dropPiece that deal with dropping and the parts that update the game for code reuse, but it's not clear to me that it's any cleaner.
Another way to do it would be to try to take advantage of some other property. Maybe, for each block in the piece, find the distance from that piece to the nearest already placed block below it. Take the minimum of those distances and draw the ghost piece that many blocks down. I think this should be easier to implement than the first option.
Hi,
I'm trying to find a simple way to create a ghost piece display.
This is essentially showing the piece where it will fall should you press hard drop that moment.
Recommendations ?
The text was updated successfully, but these errors were encountered: