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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - demix226

Pages: [1]
1
Graphics / Re: Tiled map same sprites but diferent position
« on: September 08, 2015, 02:07:49 pm »
Hey really thanks, option 1 is the correct.

I saw the axample. They have al the Tiles in the same texture. I want to create a multi tileset map. For each map tile i have to create 1 sprites (10x10 map = 100 sprites) + 1 sprite for each enemy (same texture enemy), etc...

Thanks for all.

2
Graphics / Tiled map same sprites but diferent position
« on: September 08, 2015, 03:12:21 am »
Hello SFML Community!.

I hope you excuse my bad english.

im working on a tiled based game and i have a 40 x 40 tiled map. Some tiles have the same graphics like another tile.

Mi question is:
should i create different sprites for each tile (talking about the same graphics tiles) with different positions??, or should i create one sprite for each graphics and change the position of the sprites in each reander??.

Example:

RenderWindow rWindow(VideoMode(500, 500), "Test");
Texture t1;
t1.loadFromFile("MyTextureFile");

Sprite s1(t1);
Sprite s2(t1);

s1.setPosition(50, 50);
s2.setPosition(100, 100);

while(true) {
      rWindow.clear();
      rWindow.draw(s1);
      rWindow.draw(s2);
      rWindow.display();
}

 

or


RenderWindow rWindow(VideoMode(500, 500), "Test");
Texture t1;
t1.loadFromFile("MyTextureFile");

Sprite s1(t1);

while(true) {
      rWindow.clear();
      s1.setPosition(50, 50);
      rWindow.draw(s1);
      s1.setPosition(100, 100);
      rWindow.draw(s1);
      rWindow.display();
}

 

Thanks =D

Pages: [1]