jmoon018 / PacVim

GNU Lesser General Public License v3.0
3.25k stars 193 forks source link

Won't draw the levels #34

Open isarandi opened 6 years ago

isarandi commented 6 years ago

I compiled the program from sources and when I start it, it simply says LEVEL 0, later on PRESS ENTER TO PLAY! ESC OR q TO EXIT. I press enter and get YOU WIN THE GAME! and the next level comes. There is no game drawn.

I noticed that a ~/errors.log was also generated, containing:

DRAWING THE SCREEN
DRAWING THE SCREEN
DRAWING THE SCREEN
DRAWING THE SCREEN
YOU WIN
GAME ENDED!
DRAWING THE SCREEN
DRAWING THE SCREEN
YOU WIN
GAME ENDED!
DRAWING THE SCREEN
YOU WIN
GAME ENDED!
DRAWING THE SCREEN
YOU WIN
GAME ENDED!
DRAWING THE SCREEN
YOU WIN
GAME ENDED!
DRAWING THE SCREEN
yesanishhere commented 6 years ago

This problem is because maps are not getting drawn. Did you do "make install" and did it show any error?

isarandi commented 6 years ago

No error, compilation is successful. Later I saw a closed Github issue here, which said that checking out an earlier version and compiling that would work. I tried that and it indeed worked.

yesanishhere commented 6 years ago

I didn't ask about 'make' but rather 'make install' which installs the maps. If 'make install' didn't complain then can you try below code?

diff --git a/src/game.cpp b/src/game.cpp
index 75e2f91..7df086a 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -780,7 +780,7 @@ int main(int argc, char** argv)

        init_normal_cmds();
        while(LIVES >= 0) {
-               string mapName = MAPS_LOCATION "/map";
+               string mapName = "maps/map";

                // convert CURRENT_LEVEL to string, and load
                std::stringstream ss;
Costallat commented 6 years ago

This fix worked for me, as I am running it without the 'install' step.