diff options
Diffstat (limited to 'riseoftodmoldren/screens')
-rw-r--r-- | riseoftodmoldren/screens/main.py | 19 | ||||
-rw-r--r-- | riseoftodmoldren/screens/start.py | 14 |
2 files changed, 29 insertions, 4 deletions
diff --git a/riseoftodmoldren/screens/main.py b/riseoftodmoldren/screens/main.py new file mode 100644 index 0000000..3ce0645 --- /dev/null +++ b/riseoftodmoldren/screens/main.py @@ -0,0 +1,19 @@ +from .. import assets +from ..base import State, StateApp + + +class MainScreen(State): + background = None + sack = None + potion = None + + def on_start(self, app: 'StateApp'): + if self.background is None: + self.background = assets.FOREST1.as_tiled_surface(app.screen_rect) + self.sack = assets.SACK.as_surface() + self.potion = assets.HEAL_POTION_ICON.as_surface() + + def on_render(self, app: 'StateApp'): + app.screen.blit(self.background, (0, 0)) + app.screen.blit(self.sack, (25, 600)) + app.screen.blit(self.potion, (760, 435)) diff --git a/riseoftodmoldren/screens/start.py b/riseoftodmoldren/screens/start.py index cc33a47..7951a5c 100644 --- a/riseoftodmoldren/screens/start.py +++ b/riseoftodmoldren/screens/start.py @@ -1,17 +1,23 @@ +import pygame + +from .main import MainScreen +from .. import assets from ..base import State, StateApp class StartScreen(State): - def __init__(self): - self.background = None + background = None def on_start(self, app: 'StateApp'): if self.background is None: - from .. import assets self.background = assets.MENU2.as_tiled_surface(app.screen_rect) + def on_keydown(self, app: 'StateApp', key): + app.replace_state(MainScreen()) + def on_event(self, app: 'StateApp', event): - pass + if event.type == pygame.MOUSEBUTTONUP: + app.replace_state(MainScreen()) def on_render(self, app: 'StateApp'): app.screen.blit(self.background, (0, 0)) |