本文整理汇总了Python中pygame.K_9属性的典型用法代码示例。如果您正苦于以下问题:Python pygame.K_9属性的具体用法?Python pygame.K_9怎么用?Python pygame.K_9使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类pygame
的用法示例。
在下文中一共展示了pygame.K_9属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: new_demo
# 需要导入模块: import pygame [as 别名]
# 或者: from pygame import K_9 [as 别名]
def new_demo(test=True):
import pygame
from demo.game import Game
if test is False:
game = Game(640, 480, None)
else:
def _render(game):
while True:
game.draw()
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_9:
game.increase_fps()
elif event.key == pygame.K_0:
game.decrease_fps()
pygame.init()
DISPLAYSURF = pygame.display.set_mode((640, 480), 0, 32)
pygame.display.set_caption('Demo')
game = Game(640, 480, DISPLAYSURF)
t = Thread(target=lambda: _render(game))
t.start()
return game
示例2: new_demo
# 需要导入模块: import pygame [as 别名]
# 或者: from pygame import K_9 [as 别名]
def new_demo(test=False):
import pygame
from demo.game import Game
if test is False:
game = Game(640, 480, None)
else:
def _render(game):
while True:
game.draw()
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_9:
game.increase_fps()
elif event.key == pygame.K_0:
game.decrease_fps()
pygame.init()
DISPLAYSURF = pygame.display.set_mode((640, 480), 0, 32)
pygame.display.set_caption('Demo')
game = Game(640, 480, DISPLAYSURF)
t = Thread(target=lambda: _render(game))
t.start()
parameter = Parameter(lr=1e-3)
parameter.gamma = 0.9
parameter.iteration_num = 300000
parameter.num_history_frames = 1
parameter.network_type = 'mlp'
parameter.update_method = 'rmsprop'
parameter.rho = 0.95
parameter.async_update_interval = 5
parameter.input_scale = 1.0
return game, parameter