Save and Load text file (character start)

In a rpg that i am working on in the console i have made it so that the character starts at position x = 1 y = 1 in an array. the array looks like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
char Level[100][100] =
{
"###############################################",
"#@                              WWWWWWWWWWWWW #", //character is the @ sign
"#      T                   T   WWWW       WWW #",
"#               T               WW     T   WWW#",
"#             WWW                WWW      WW  #",
"#         T   WWW         T    T WWWWWWWWWWW  #",
"#              WWW                   WWWWW    #",
"#                 f                           #",
"#T                            T               #",
"#                                             #",
"#           T         WW                      #",
"#                    WWWW           T         #",
"#                     WW   T                  #",
"#               T                             #",
"#                                        T    #",
"#    T                    W        T          #",
"#                        WWW                  #",
"#            T            W                   #",
"#   -                     T              +    #",
"#                                             #",
"###############################################"
};


This works just fine the character starts at (1,1) and when movement happens gets erased and moved to the new position and so on.

Just a little bit ago i added a save feature. it writes the x and y position to a text file. and then when the game is loaded it reads the x and y.

now when you move the character after it has loaded the game there is still an @ sign at (1,1) that character doesnt move and a new one is drawn at the new x y position.

so i tried doing this.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
char Level[100][100] =
{
"###############################################",
"#                               WWWWWWWWWWWWW #", //character no longer there
"#      T                   T   WWWW       WWW #",
"#               T               WW     T   WWW#",
"#             WWW                WWW      WW  #",
"#         T   WWW         T    T WWWWWWWWWWW  #",
"#              WWW                   WWWWW    #",
"#                 f                           #",
"#T                            T               #",
"#                                             #", // now lets say the
"#           T         WW                      #", //character x y is here it 
"#                    WWWW           T         #", // is not drawn until after
"#                     WW   T                  #", // movement happens
"#               T                             #",
"#                                        T    #",
"#    T                    W        T          #",
"#                        WWW                  #",
"#            T            W                   #",
"#   -                     T              +    #",
"#                                             #",
"###############################################"
};


i want to do something along the lines of this:

1
2
3
4
if(Level[x][y] == ' ')
{
     Level[x][y] == '@';
}


but this action of code will not pass for some reason.



please view my entire code here and go down line 906 this is where i feel i need to add the ability to draw the character:

https://sites.google.com/site/temprpgquestion/go-here-for-the-program
1
2
3
4
5
if(Level[x][y] == ' ') // compare for equality
{
     Level[x][y] == '@'; // compare for equality?
     // assignment is '='
}
oh yeah i know that. but still if i change it to level[x][y] = '@'; it still doesnt work for me.
Topic archived. No new replies allowed.