MCPcopy
hub / github.com/CharlesPikachu/Games / ShowStartInterface

Method ShowStartInterface

cpgames/core/games/ski/ski.py:199–217  ·  view source on GitHub ↗
(self, screen)

Source from the content-addressed store, hash-verified

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']

Callers 1

runMethod · 0.95

Calls 2

QuitGameFunction · 0.85
updateMethod · 0.45

Tested by

no test coverage detected