Berserkrgangr is a little 3v3 moba. Customize your character gameplay through different skills, raise towers, level them and try to conquer the enemy field.

Post news Report 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 :(

Post comment Comments
Swyter
Swyter - - 664 comments

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 - - 15 comments

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 - - 15 comments

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 - - 664 comments

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

Your comment will be anonymous unless you join the community. Or sign in with your social account: