nosir/obelisk.js

Depth Issue

postmodjoel opened this issue · 2 comments

I'm creating an isometric game using obelisk.js (amazing library btw), but I'm having so issues figuring out how I should create an accurate representation of the player.

DEMO: http://codepen.io/postmodjoel/pen/PwaJpP

I'm currently messing around with code to dynamically modify the player's appearance depending on their location in order to give the illusion that the player is "behind" another cube, but I now realise that this method won't work in all instances.

I realise that this can be done by including the player's sprite into the rendering for the map, but I know that it's not performance-smart clearing the view the regenerating the view each time the player gets behind an object.

I was wondering if there's some way I could render the player behind an object without regenerating the entirety of the map instance? I was looking through some of your CodePens and saw use of a depthIndex property? Would that be an instance relevant to my problem?

Cheers

Joel

Hi Joel,
Thanks for trying the lib. To answer your question, unfortunately there's no native depth sorting supporting in this lib, and yes, you will need to somehow regenerate the map instance for re-rendering. Depth control needs more efforts and I will give it a try someday.

Thanks for the reply! No problem needing to regenerate; it just means I might even have to think more creatively in how I can render the player properly.

Hope you continue to develop this further: it's a nifty little library.