Page 1 of 1
Posted: Tue Jul 04, 2017 7:08 am
I was wondering if anyone have a tile example. Because I dont want to make sprites of everything
There iare some tile examples, but they are always hardcoded into memory. I was wondering if it was possible with a png image and some cool SGDK commands
Posted: Tue Jul 04, 2017 9:22 am
Of course you can load GFX data from iamge (BMP or PNG).
Look at the "sprite" sample provided in SGDK :
https://github.com/Stephane-D/SGDK/tree ... ple/sprite
If you go into the "res" folder you will see some .res files declaring resources.
Rescomp tool will compile the resources into .s / .h file for you. you can read the rescomp.txt file (in the "bin" folder of SGDK) to see which kind of resource are supported
Posted: Wed Jul 05, 2017 8:22 am
Well, I have a tileset resource that exist as a resource in my code, but I dont know how to use it in any functions....
Havent found a single example that loads my tileset. Tried to use the same funktions as the hardcoded tileset in sprite example, but didnt work.
Posted: Wed Jul 05, 2017 2:28 pm
How are you declaring it ? TILESET ? or IMAGE ?
The easiest way to display it is to use IMAGE resource then use VDP_drawImage(..) method.
Posted: Thu Jul 06, 2017 2:46 pm
Tiles are characters right? At the commodore 64 i used characters because they are so fast. If I use an image like you said, can I still load it
to the TILE_USERINDEX adress, and then use it with VDP_setTileMapXY?
Posted: Thu Jul 06, 2017 2:52 pm
IMAGE contains a TileSet and and Map internally so you can use all those functions with it
Posted: Thu Jul 20, 2017 6:24 am
Now I can out tiles in the background as well.
Does anyone know how to see what tile im standing on?
I mean read the data and se what character is under a certain sprite?
Posted: Fri Aug 11, 2017 8:56 am
I solved the above by looking at my own Tile Array and doing some math. Feels like the wrong way but it works.
I was also wondering about the best way to animate tiles. Is the vdp_drawimage function fast enough?
I will have a water tile with waves or something.
Posted: Fri Aug 11, 2017 9:11 am
About looking what map tile is behind your sprite, you should do it from your map data.
As you know the sprite position in the level so you should be able to find which background tile is behind the sprite just by using its coordinates / 8 or something like that
Also about animating background, it's better to have a large image containing the different water animation and just use VDP_setMapEx(..) to refresh only a part of the tilemap with a specific region of your map image.
Posted: Fri Aug 11, 2017 3:01 pm
Are there any drawbacks with using VDP_drawImageEx? I dont have to learn the map structure then and it seems to work.
Besides rescomp.txt says map isnt implemented....
Posted: Fri Aug 11, 2017 3:03 pm
... and I will also show what I got so far.