Hello fellow programmers!
First of all excuse me for my English, i am from abroad...
I am trying to learn the C++ programming language as it is one of the most basic languages.So,instead of just creating small examples for each feature(like class,input/output etc), I decided to create a mini game.Nothing special,it will be a game with just numbers and digits,command-line game with some choices affecting the plot etc.Very simple thing(I have in my mind that once I understand the basics of C++, I will search about OpenGL to add graphics in my program but this seems pretty hard for me rigth now).
So, I have a few questions...
1)When the user gives his first/last name, (along with some other features like hit points,weapons carried etc), I decided to "save them " in a single row in a txt file in order to use them inside the game.Actually the main reason for this is that I want to create something like a save file so when a player that has subscribed before enters,he can continue from where he stopped last time(couldnt think of anything else,if you know other ways please tell me).So for the first user the txt file would be something like:
First_Name Last_Name Hit_points Weapon_name
Now the problem that I have is how to manage this file.
A)When another player subscribes, I want all the columns of the file to have the same distance between them.
So instead of:
First_Name Last_Name Hit_points Weapon_name
Bigger_Fisrt_Name Bigger_Last_Name ....
I would like All first names,Last names,weapons etc to be in their own columns
Is that possible?Or I have to write a script or something?
B)Is it possible to sort all rows(let's say by the First_Name)?
C)Is it possible to retrieve a feature(let's say the weapon's name)in order to use it inside the program(for example in a battle as each weapon will do certain damage)
2)When dialogues occur during the story,it is not pretty at all to be presented all together with cout...Even sleep() can't do much work...Is it possible to present them the way I have seen in many games, like someone is typing them at that time? I hope you understand what i am talking about.
Let's start with these two questions and if something new occurs that I cant figure out, i will re-post here...
I have searced to do the things I described above(I used ofstream in order to create the file because until now I was using pure C)...Any suggestion/answer/advice would be really helpful.
Thank you!