Jump to content

Cars on top of road path


Recommended Posts

Posted

The reason this works is because elements are (currently) drawn in order, where elements later in the list will only overwrite the same pixels if their base height is at least the tile's clearance height so far. The tile elements show them in reverse order, because that's more logical (higher elements higher in the list).

For the selected tile, it'll:

  1. draw the surface
  2. draw the car over the surface - its base height equals the surface's clearance height, so it overwrites the pixels
  3. draw the path behind the car - it won't overwrite the pixels from the car, because it's base height is lower than the clearance height of the car

This trick works with multiple elements on the same tile too.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...