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

Author
Message
c0d3r9
2
Years of Service
User Offline
Joined: 2nd Oct 2017
Location:
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:
Phaelax
DBPro Master
16
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
c0d3r9
2
Years of Service
User Offline
Joined: 2nd Oct 2017
Location:
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-02-16 21:35:38
Your offset time is: 2020-02-16 21:35:38