• Register
Post news RSS Collisions, depth-sorting and bugs

I have finally implemented the map in the game handling depth-sorting and collisions.

Posted by on

I have finally implemented the map in the game handling depth-sorting and collisions.


There are some unfortunate misalignments that i'll have to fix soon :(

Comments
Swyter
Swyter

I guess you are z-sorting using the vertical position (y) of the assets.
And colliding to half the sprite down the grid. Very fluid, now for the hero facing.

OpenGL and what language are you coding in? Seeing the platform you're using a wrapper or engine/builder of some sort.

Well done, or in other words... A wild mermaid appeared! Use sexy dance!

Reply Good karma Bad karma+2 votes
Cariboo Author
Cariboo

That's indeed how i sort my tiles, also right for the half-sprite thing :)

I admit i put "Windows, Mac, Linux" because Flash runs there too (well kinda for linux...) but in any case i'm using haxe with the NME framework so i can actually export on those platforms as some native executables too.

For this projet i'm focusing on flash though.

Oh a mermaid ! (\/)(;,,;)(\/)

Reply Good karma+3 votes
Cariboo Author
Cariboo

Adding to the depth-sorting, i'm actually using several draw calls for it, one for the map, several for the moving objects and some others for the depth effect. I'm indeed detecting depth with y but since i wanted to keep my spritesheets in different files it made the sorting & displaying a bit different. So everything except the players are in one static background draw call, then the players and finally the overlapped objects are drawn over the rest, per tile.

I think i will end up making a new big spritesheet at runtime and just use that, easier to sort, display and more efficient; but it's fine for now.

Reply Good karma+3 votes
Swyter
Swyter

Excellent choice. Great to know. Looks really well thought out, and remember, the less code, the better. A bit of overdraw per frame won't kill any machine, leave the optimizations for the last three weeks.

It's pretty clear that you know what you are doing, I can't say the same with a good part of the indie community.

Have fun with it! :)

Reply Good karma Bad karma+3 votes
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.