Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: How do I organize my Tileset based on the Tile Map example  (Read 1409 times)

0 Members and 1 Guest are viewing this topic.

Stock

  • Newbie
  • *
  • Posts: 11
    • View Profile
How do I organize my Tileset based on the Tile Map example
« on: June 03, 2014, 04:47:29 pm »
So I have a Tilemap, and it works... if I am only loading one Tile. As soon as I try to load more than one(Example 1 results in only one, very distorted, tile loading      Example 2 results in crash), it doesn't work.

Here are two ways I thought would work, but aren't for me... any ideas?

Code: [Select]
//Load First Tile
if (!Map.Load("Tile Location", Vector2u(32, 32), Level, 16, 16))
    return -1;

//Load Second Tile
if (!Map.Load("Tile2 Location", Vector2u(32, 32), Level, 16, 16))
    return -1;

Code: [Select]
//Load 1 Tile sheet, 256x256                   //I Have also tried 256, 256 here
if (!Map.Load("Tileset Location", Vector2u(                           32, 32), Level, 16, 16))
    return -1;

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: How do I organize my Tileset based on the Tile Map example
« Reply #1 on: June 03, 2014, 04:59:39 pm »
What is your Map class? It can't be the one from the tutorial since it has an uppercase Load() function... which leads to the question what else is different in your code.

In general, you will get better help if you read the forum rules before posting, especially this part. You should at least stick to the original TileMap code so we can exclude the possibility that your implementation contains bugs.

Are you sure that the other parameters are meaningful? Have you checked the size of Level and the last two arguments, do they match? Which image file are you using?
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Stock

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: How do I organize my Tileset based on the Tile Map example
« Reply #2 on: June 04, 2014, 12:38:38 am »
Ok, I updated the code now, it is the one from the tutorial exactly now, nothing changed...

As far as I can tell, I did a fairly good job following those guide lines... a few mistakes though...

Yes. Yes Levels size and the two args match. PNG.

 

anything