Mercurial > skaapsteker
comparison skaapsteker/menuscene.py @ 632:0675f390653c
Initial port to Python 3 and Pygame 2.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Fri, 20 Jan 2023 20:01:06 +0100 |
parents | a5a57abd5472 |
children |
comparison
equal
deleted
inserted
replaced
631:672e6e7ecfe9 | 632:0675f390653c |
---|---|
43 cursor_y += 43 * self._selected | 43 cursor_y += 43 * self._selected |
44 surface.blit(self._background, (0, 0)) | 44 surface.blit(self._background, (0, 0)) |
45 surface.blit(self._cursor, (cursor_x, cursor_y)) | 45 surface.blit(self._cursor, (cursor_x, cursor_y)) |
46 | 46 |
47 def dispatch(self, ev): | 47 def dispatch(self, ev): |
48 if ev.type is KEYDOWN: | 48 if ev.type == KEYDOWN: |
49 if ev.key in (K_q, K_ESCAPE): | 49 if ev.key in (K_q, K_ESCAPE): |
50 pygame.event.post(pygame.event.Event(QUIT)) | 50 pygame.event.post(pygame.event.Event(QUIT)) |
51 elif ev.key == K_DOWN: | 51 elif ev.key == K_DOWN: |
52 self._selected += 1 | 52 self._selected += 1 |
53 elif ev.key == K_UP: | 53 elif ev.key == K_UP: |