本文整理汇总了Python中pygame.K_c方法的典型用法代码示例。如果您正苦于以下问题:Python pygame.K_c方法的具体用法?Python pygame.K_c怎么用?Python pygame.K_c使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pygame
的用法示例。
在下文中一共展示了pygame.K_c方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _map_keys
# 需要导入模块: import pygame [as 别名]
# 或者: from pygame import K_c [as 别名]
def _map_keys(self):
key_map = self.io.key_map
key_map[imgui.KEY_TAB] = pygame.K_TAB
key_map[imgui.KEY_LEFT_ARROW] = pygame.K_LEFT
key_map[imgui.KEY_RIGHT_ARROW] = pygame.K_RIGHT
key_map[imgui.KEY_UP_ARROW] = pygame.K_UP
key_map[imgui.KEY_DOWN_ARROW] = pygame.K_DOWN
key_map[imgui.KEY_PAGE_UP] = pygame.K_PAGEUP
key_map[imgui.KEY_PAGE_DOWN] = pygame.K_PAGEDOWN
key_map[imgui.KEY_HOME] = pygame.K_HOME
key_map[imgui.KEY_END] = pygame.K_END
key_map[imgui.KEY_DELETE] = pygame.K_DELETE
key_map[imgui.KEY_BACKSPACE] = pygame.K_BACKSPACE
key_map[imgui.KEY_ENTER] = pygame.K_RETURN
key_map[imgui.KEY_ESCAPE] = pygame.K_ESCAPE
key_map[imgui.KEY_A] = pygame.K_a
key_map[imgui.KEY_C] = pygame.K_c
key_map[imgui.KEY_V] = pygame.K_v
key_map[imgui.KEY_X] = pygame.K_x
key_map[imgui.KEY_Y] = pygame.K_y
key_map[imgui.KEY_Z] = pygame.K_z
示例2: game_intro
# 需要导入模块: import pygame [as 别名]
# 或者: from pygame import K_c [as 别名]
def game_intro():
intro=True
while intro:
for event in pygame.event.get():
if event.type==pygame.QUIT:
pygame.quit()
quit()
if event.type==pygame.KEYDOWN:
if event.key==pygame.K_c:
intro=False
if event.key==pygame.K_q:
pygame.quit()
quit()
gameDisplay.fill(white)
message_to_screen("Welcome to Flafel",green,-100,"large")
message_to_screen("The objective of the game is to eat red apples",black,-30)
message_to_screen("The more apples you eat,the longer you get",black,10)
message_to_screen("If you run into yourself, or the edges, you die!",black,50)
message_to_screen("Press C to play, P to pause or Q to quit",black,180)
pygame.display.update()
clock.tick(15)
示例3: pause
# 需要导入模块: import pygame [as 别名]
# 或者: from pygame import K_c [as 别名]
def pause():
paused=True
message_to_screen("Paused",black,-100,size="large")
message_to_screen("Press C to continue or Q to quit",black,25)
pygame.display.update()
while paused:
for event in pygame.event.get():
if event.type==pygame.QUIT:
pygame.quit()
quit()
if event.type==pygame.KEYDOWN:
if event.key==pygame.K_c:
paused=False
elif event.key==pygame.K_q:
pygame.quit()
quit()
clock.tick(5)
示例4: intro_for_game
# 需要导入模块: import pygame [as 别名]
# 或者: from pygame import K_c [as 别名]
def intro_for_game():
intro_screen = True
while intro_screen:
for eachEvent in game.event.get():
if eachEvent.type == game.QUIT:
game.quit()
quit()
if eachEvent.type == game.KEYDOWN:
if eachEvent.key == game.K_c:
intro_screen = False
if eachEvent.key == game.K_q:
game.quit()
quit()
DisplayScreen.fill(color_white)
display_ScreenMessage("Welcome to drawSnake",
green,
-100,
"large")
display_ScreenMessage("",
color_black,
-30)
display_ScreenMessage("",
color_black,
10)
display_ScreenMessage("Made by Python Programmers",
color_black,
50)
display_ScreenMessage("Press C to play or Q to quit.",
color_red,
180)
game.display.update()
objectClock.tick(15)