It's not much, but this is my progress learning SGDK.
I'm mainly using IMAGE for the tile mapping. Added some stuff Stef suggested on another thread regarding collisions, also using IMAGE but not uploaded to VDP.
Then some sprite/background sorting (which one is front or behind).
There's still much to learn. Hopefully I'll get there someday.
Tilemap Collision and Sprite Sorting Demo
Moderator: Mask of Destiny
Tilemap Collision and Sprite Sorting Demo
- Attachments
-
- tilemap_collision_sprite_sorting.zip
- (70.44 KiB) Downloaded 373 times
Re: Tilemap Collision and Sprite Sorting Demo
It looks very good. Will you create jRPG?
Can you give Sprite Sorting code?
Can you give Sprite Sorting code?
Re: Tilemap Collision and Sprite Sorting Demo
I'd like to do an RPG someday, but using original material. I just used Phantasy Star for the demo.
As for sprite-to-sprite sorting, I used SPR_setDepth, using the negated Y value. So if we have something like:
Code: Select all
SPR_setPosition(sprite, fix32ToInt(posX), fix32ToInt(posY));
Code: Select all
SPR_setDepth(sprite, -fix32ToInt(posY));
It's a bit different with the original Phantasy Star II, as I think it used individual priority bits on tiles. Whole buildings belong to the second plane, but certain tiles are over the character sprites. I can't figure out how to embed such information onto an image, unless I do another separate IMAGE resource dedicated to priority bit like I did with collisions.