|
1 | 1 | #!/usr/bin/env python
|
2 | 2 | # coding=utf-8
|
3 | 3 | import pygame as pg
|
4 |
| -from pygame.locals import K_ESCAPE, KEYDOWN, MOUSEBUTTONDOWN, MOUSEBUTTONUP, QUIT |
| 4 | +from pygame.locals import ( |
| 5 | + K_ESCAPE, |
| 6 | + KEYDOWN, |
| 7 | + MOUSEBUTTONDOWN, |
| 8 | + MOUSEBUTTONUP, |
| 9 | + MOUSEMOTION, |
| 10 | + QUIT, |
| 11 | +) |
5 | 12 |
|
6 | 13 | from pysurvive.config import FPS, GRAY_LIGHT2, MAP_DIR, RED_LIGHT
|
7 | 14 | from pysurvive.game.core import Camera, Screen
|
@@ -29,14 +36,16 @@ def __init__(self) -> None:
|
29 | 36 | pg.display.set_caption("pysurvive")
|
30 | 37 | pg.transform.set_smoothscale_backend("SSE")
|
31 | 38 | # Turn off the mouse cursor.
|
32 |
| - pg.mouse.set_visible(0) |
| 39 | + pg.mouse.set_visible(True) |
33 | 40 | # Limit the number of allowed pygame events.
|
34 |
| - pg.event.set_allowed([QUIT, KEYDOWN, K_ESCAPE, MOUSEBUTTONDOWN, MOUSEBUTTONUP]) |
| 41 | + # pg.event.set_allowed( |
| 42 | + # [QUIT, KEYDOWN, K_ESCAPE, MOUSEBUTTONDOWN, MOUSEBUTTONUP, MOUSEMOTION] |
| 43 | + # ) |
35 | 44 |
|
36 | 45 | self.fps_font = pg.font.SysFont("Arial", 14)
|
37 | 46 |
|
38 | 47 | # Absolute (start) position of the player (camera) in game world.
|
39 |
| - self.camera = Camera(0, 0) |
| 48 | + self.camera = Camera(300, 300) |
40 | 49 |
|
41 | 50 | # Prepare the shadow surface / screen.
|
42 | 51 | # self.screen_shadow = pg.Surface(self.screen.size)
|
|
0 commit comments