Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Help: Tilemaps with Sprites

Years of Service
User Offline
Joined: 2nd Oct 2017
Posted: 13th Feb 2018 21:54 Edited at: 13th Feb 2018 22:36
The last days i try something with Tilemaps.
No Sprites only with colored rects.
Now i have a Map.dat File and loading works fine.
What is the issue on my code?
The numbers from the mapfile displays correct but no sprite to see.

edit: Argh.....for every array-index one CreateSprite(index) its to late tonight Maybe anybody helps my code for beginning.....

edit code:
DBPro Master
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 14th Feb 2018 14:22
Quote: "loading works fine.
What is the issue on my code?"

According to you, nothing. It works fine. You need to explain a lot more.

I can tell you that you're drawTileMap() function is positioning sprites that you haven't created. If your map is just 1s and 0s representing the only two sprites you did create, then you either need to clone them to position like you want. Or, you'd have to use drawSprite() to paste it to the backbuffer every cycle.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Years of Service
User Offline
Joined: 2nd Oct 2017
Posted: 14th Feb 2018 15:21
Well i found the solution last night myself -> edited code
I filled the map complete with createsprite.
And in the mainloop i draw with SetSpritePosition only the Sprites wich are visible in screen.

My mistake was i havenĀ“t forget in my Fillfunction insert for every Tile in the maparray a createsprite.

Login to post a reply

Server time is: 2020-04-08 16:48:56
Your offset time is: 2020-04-08 16:48:56