source: nagslang/screens/menu.py@ 21:1b048d2a8411

Last change on this file since 21:1b048d2a8411 was 21:1b048d2a8411, checked in by Simon Cross <hodgestar@…>, 8 years ago

Fake area.

File size: 628 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 surface.fill(pygame.color.Color(0, 0, 0))
20 color = pygame.color.Color(255, 0, 0)
21 rect = pygame.rect.Rect(10, 10, 200, 200)
22 surface.fill(color, rect)
Note: See TracBrowser for help on using the repository browser.