JeLLyNinjas / TerminalFighter

5 stars 2 forks source link

Selecting Quit from main.py #42

Closed beaesguerra closed 8 years ago

beaesguerra commented 8 years ago

Game closes properly, but I get this error:

Traceback (most recent call last): File "main.py", line 33, in gamestate = run_game_state.get(gamestate, sys.exit)(screen, DRAWING_SCALE) TypeError: exit expected at most 1 arguments, got 2

enochtsang commented 8 years ago

Yea, I saw that. Not sure how to fix it, it's a fairly non issue thing right now though.

bseto commented 8 years ago

This is a result of not properly closing pygame.

Example: In SDL2, I have to call:

void close()
{
    SDL_DestroyRenderer(renderer);
    SDL_DestroyWindow(window);
    window = NULL;
    renderer = NULL;
    SDL_Quit();
    exit(0);
}

Try to call https://www.pygame.org/docs/ref/pygame.html#pygame.quit before exit?

enochtsang commented 8 years ago

No, the problem is in the dict I use for moving between game states. Game states are a function that takes 2 arguments. sys.exit() takes either 0 or 1 argument.

bseto commented 8 years ago

ohh i see

enochtsang commented 8 years ago

Not sure if you guys want to do something about that

bseto commented 8 years ago

Nah, I think if you don't think its worth the effort its okay

enochtsang commented 8 years ago

I fixed the previous issues.