Hi there.
I´m new to DarkGDK and C++.
I usually work with Java , so i´m not that familiar with the C++ Language.
Most of you probably think: "OMG , Not another Noob!"
So i already excuse for that.
As you can see by my Syntax, my English is not the best since i´m German.
How ever , that´s the deal:
I try to create a 2D Game.
To design the different levels , I try to design them with a Tileset System.
That way i want to use textfiles like that , to design them:
stage1.st
00001110001
00001110001
10001110221
00001110221
00001110001
10001110001
Just as an example!
Now i try to make an Array[20][15] with that file , that contains the shown values as integers in it.
So that Array[0][2]=1 f.E.
The problem that i have already starts with reading out the values i need from the file.
I tried something like this:
char line[256];
char* a;
dbOpenToRead( 1, "stage1.st" );
for (int i=0;i<2;i++) {
a = dbReadString(1,line);
}
dbPrint(a);
I know it´s a 1-dim Array , but i don´t even get that one to work the way i want it to.
I try to read the files as a String , so i´m still able to control what the program reads.
With that code , i get either a strange output that has nothing to do with my File or simply nothing.
I hope anybody got through my confuse answer and tries to help me ^^° <