| 197 | return obstacles |
| 198 | '''显示游戏开始界面''' |
| 199 | def ShowStartInterface(self, screen): |
| 200 | screen.fill((255, 255, 255)) |
| 201 | tfont = self.resource_loader.fonts['1/5screenwidth'] |
| 202 | cfont = self.resource_loader.fonts['1/20screenwidth'] |
| 203 | title = tfont.render(u'滑雪游戏', True, (255, 0, 0)) |
| 204 | content = cfont.render(u'按任意键开始游戏', True, (0, 0, 255)) |
| 205 | trect = title.get_rect() |
| 206 | trect.midtop = (self.cfg.SCREENSIZE[0] / 2, self.cfg.SCREENSIZE[1] / 5) |
| 207 | crect = content.get_rect() |
| 208 | crect.midtop = (self.cfg.SCREENSIZE[0] / 2, self.cfg.SCREENSIZE[1] / 2) |
| 209 | screen.blit(title, trect) |
| 210 | screen.blit(content, crect) |
| 211 | while True: |
| 212 | for event in pygame.event.get(): |
| 213 | if event.type == pygame.QUIT: |
| 214 | QuitGame() |
| 215 | elif event.type == pygame.KEYDOWN: |
| 216 | return |
| 217 | pygame.display.update() |
| 218 | '''显示分数''' |
| 219 | def showScore(self, screen, score, pos=(10, 10)): |
| 220 | font = self.resource_loader.fonts['default'] |