I am making a map loader that reads what is in the file given to it and puts it into the screen with darkgdk heres the file format(its only the current version, it will probably change in the futuer):
object {
id{ 1 }
type{ cube }
pos{ x=100 y=100 }
size{ x=30 y=30 }
}
object {
id{ 2 }
type{ circle }
pos{ x=100 y=100 }
size{ r=3 }
}
this code would be turned into:
dbLoadImage ( "cube.jpg", the id of the chosen object );
dbSprite ( the stuff that goes here );
you get the picture.
file extension: .lvl
the pos:
x = the x pos on the screen
y = the y pos on the screen
the size:
cube:
x = the x size
y = the y size
circle:
r = radius
i dont know how to get it to read structured files like this, can anyone suggest any tutorials or paste some code and explain it?
i already know about iostreams and stuff like that but i have no idea about reading structured files. thanks in advance!