Coder Social home page Coder Social logo

Comments (1)

rozniak avatar rozniak commented on August 23, 2024

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:

  • Bin BrickPicker.RenderFrame()
  • In 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 collection
  • Add a function to BrickPicker() to try retrieving a brick from the player's hand at the coordinate
  • Tie this function into Scene.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)

from junkbot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.