Open TommytheJerk opened 3 years ago
This is intentional, but wrong behaviour - I thought that the bricks in the hand are always rendered on top of everything else. In reality they are in the same z-order as the rest of the scene (but rendered over any bricks in the same spot).
Right now rendering the hand is done in BrickPicker.RenderFrame()
which is called at the end of Scene.RenderFrame()
. This will have to be changed so the hand is rendered by Scene.RenderFrame()
entirely.
The method is slightly different between the two: Scene.RenderFrame()
goes cell-by-cell bottom-to-top, left-to-right rendering the bricks - BrickPicker.RenderFrame()
simply renders each brick from the hand which is already guaranteed to be in z-order.
Probably the easiest way to implement this is to:
BrickPicker.RenderFrame()
Update()
, when there's bricks in the hand and the cell at which the cursor is at differs from the previous update, then update the grid coordinates of each held brick in some kind of collectionBrickPicker()
to try retrieving a brick from the player's hand at the coordinateScene.RenderFrame()
so that it renders the brick in the player's hand (if any) after the brick in the scene (so result should be z-ordered, with the hand drawn on top)
Unplaced blocks should be rendered as though they were placed, in terms of ordering on the z-plane. Right now, they render on top of already placed blocks, which is not how they render in the original game.