Return to repo list

heart-of-gold

Tactical RPG written in python, using pygame.
Return to HMagellan.com

commit 1f2f7cff3c19c78d884de2aec3637fe7c6cc7d20
parent 8c6c0330356fa0136888aca0bf8b14b881b5d5ae
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Wed,  9 Sep 2020 18:33:04 -0500

window working again

Diffstat:
Msrc/game.py | 11++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/game.py b/src/game.py @@ -1,4 +1,5 @@ import pygame +from .constants import SCREEN_WIDTH, SCREEN_HEIGHT, FRAMERATE ########### # game.py # @@ -22,11 +23,11 @@ class Game(object): such as the screen, and for the GameSubsystem objects. """ - def __init__(self, screen_dimensions, framerate): + def __init__(self): # Basic values - self.screen_dimensions = screen_dimensions - self.framerate = framerate + self.screen_dimensions = (SCREEN_WIDTH, SCREEN_HEIGHT) + self.framerate = FRAMERATE self.on = True # PyGame objects @@ -121,9 +122,9 @@ class GameInterface(GameSubsystem): """ for event in events: - if event.type == pygame.KEYPRESS: + if event.type == pygame.KEYDOWN: self.handle_key_press(event) - elif event.type == pygame.KEYRELEASE: + elif event.type == pygame.KEYUP: self.handle_key_release(event) elif event.type == pygame.QUIT: self.game.quit_game()