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 - gop_t3r

Pages: 1 2 [3]
31
General / Re: Help with Tile Map tutorial
« on: January 26, 2014, 09:09:46 pm »
Sorry for the delayed response; I've made changes to my code as required and my tile loader now functions how I want it.

Thank you for your help.

32
General / Re: Help with Tile Map tutorial
« on: January 25, 2014, 01:13:50 am »
Your code is nice, but I'm afraid it's not what I'm after because you are over-complicating what I really want. I firstly don't even understand half of what your code does so I can't use it; it would've been helpful to assume that I am not an advanced C++/SFML programmer like you else I wouldn't be making this thread! :-P Secondly, I prefer the function to contain the other parameters and be more more modular than that rather than hardcoding the map's location and other very important information.

So far I've modified my current function to instead use vectors of ints, rather than a const int*. The only last thing I ought to do is move all the values from the array into a file, and then load the values and continue from there. There is a dilemma though; it's possible that I have to replace a parameter in the load() function to also accept another fileLocation wherein the map's location is stored. I just need to find a way to store the values in a text file into a vector array (in this case vector<int>) and just continue on from there. If I wanted to load values within code I could always overload it; but for now I just want something like this:

I just don't feel comfortable using the code you've written because it's too advanced for me; no hard feelings!

33
General / Re: Help with Tile Map tutorial
« on: January 24, 2014, 01:00:37 am »
Meh, am back in square one again. :-P No pun intended.

The code you wrote for reading values in a file was a bit complex and it didn't work out with my code. I would've written. Essentially your function returns a vector, but the one I've shown returns a boolean.

34
General / Re: Help with Tile Map tutorial
« on: January 23, 2014, 11:05:44 pm »
I don't think you're following me. I am trying to get this function on the SFML tutorial:

to load maps from a *.txt file. I want to pass a vector array to
const int* tiles
instead of a raw array. Not only that, but instead of loading the map from within the code, I want it loaded from a *.txt file. I am familiar with vectors and file input/output, but on the first sign of declaring something like:

Since I can't do this I might have to explore other options available, hence I need help.

35
General / Help with Tile Map tutorial
« on: January 23, 2014, 10:26:16 pm »
Hi, I've been following the tile map tutorial on the SFML website and so far my tiles load very well, but one improvement I've been trying to make is having the map be loaded from a *.txt file. Essentially instead of having

I want to be able to contain those values in a *.txt file and load them so I don't have to keep recompiling. The problem is that when I create a raw array the amount of characters is fixed and I do not want that. I want to be able to store the characters from the text file into a vector array. I tried doing this but to not avail. I'd like to know how I can go about this and what I need to change either in the load() function to accommodate this.

From what I understand, a vertex array is based on a vector array, so by analogy my raw array would be treated as a vector array thereby dynamically allocating memory as required. Is this correct?

http://www.sfml-dev.org/tutorials/2.1/graphics-vertex-array.php

I've been following the tutorial mentioned in the foresaid link.

tl;dr:

1. I want to load a map from a .txt file while still being able to load tilesets in conjunction thereof. How can I implement this?
2. I want to use a vector array, rather than a raw array. (If necessary)

Pages: 1 2 [3]
anything