source: nagslang/screens/menu.py@ 20:347667c941de

Last change on this file since 20:347667c941de was 20:347667c941de, checked in by Simon Cross <hodgestar@…>, 8 years ago

Hook up area.

File size: 578 bytes
Line 
1"""Display a menu screen."""
2
3import pygame
4
5from nagslang.screens.base import Screen
6from nagslang.events import QuitEvent, ScreenChange
7
8
9class MenuScreen(Screen):
10
11 def handle_event(self, ev):
12 if ev.type == pygame.locals.KEYDOWN:
13 if ev.key == pygame.locals.K_ESCAPE:
14 QuitEvent.post()
15 elif ev.key == pygame.locals.K_1:
16 ScreenChange.post('level1')
17
18 def render(self, surface):
19 color = pygame.color.Color(255, 0, 0)
20 rect = pygame.rect.Rect(10, 10, 200, 200)
21 surface.fill(color, rect)
Note: See TracBrowser for help on using the repository browser.