Apr 18, 2013 at 2:17pm Apr 18, 2013 at 2:17pm UTC
Bump. You don't have to re write/correct the code, I only require a reason why it's not working.
Apr 18, 2013 at 2:28pm Apr 18, 2013 at 2:28pm UTC
It's not working due to the break ;
on line 24
Apr 18, 2013 at 2:39pm Apr 18, 2013 at 2:39pm UTC
Ok thanks, the reason why I added that break was because it was basically loading the map constantly and flickering (really annoying) How can I solve this? Maybe a bool saying if the map is loaded?
EDIT: tried this:
1 2 3 4 5 6
if (MapLoaded == false ) {
for (int i = 0; i < 10; ++i) {
cout << Map[i] << endl;
}
MapLoaded = true ;
}
But then the map doesn't load at all.
Last edited on Apr 18, 2013 at 2:44pm Apr 18, 2013 at 2:44pm UTC
Apr 18, 2013 at 2:57pm Apr 18, 2013 at 2:57pm UTC
I've used your idea, but it's still flickers :/
this is the code(note, I haven't changed the name as of this moment. I wanted to see if works first.)
1 2 3 4 5 6 7 8
if (MapLoaded == true ) {
system("cls" );
for (int i = 0; i < 10; ++i) {
cout << Map[i] << endl;
}
//MapLoaded = false;
}
I first tried putting it to false (it's finished updating) then setting it to true in the key detection but that didn't work.
I know what's doing .. it's obviously the loop (while)
Last edited on Apr 18, 2013 at 3:08pm Apr 18, 2013 at 3:08pm UTC
Apr 18, 2013 at 3:04pm Apr 18, 2013 at 3:04pm UTC
yes sorry, I forgot line 6. It is required so remove the comments.
Set it to true after Map[y2][j] = '@' ;
Apr 18, 2013 at 6:39pm Apr 18, 2013 at 6:39pm UTC
this is because you are painting the whole screen. If you can device a trick to just change specific characters on the screen then you would be good.