0
我希望我的遊戲首先轉到標題幻燈片,並在角色死亡(其小行星克隆)任何幫助將不勝感激時返回到該幻燈片。首次在livewires模塊中編程時,如何爲我的可執行遊戲創建起始頁?
我希望我的遊戲首先轉到標題幻燈片,並在角色死亡(其小行星克隆)任何幫助將不勝感激時返回到該幻燈片。首次在livewires模塊中編程時,如何爲我的可執行遊戲創建起始頁?
查看pygame模塊。有很多tutorials會讓你快速運行。
從 「Python的遊戲編程」(第一個教程)的 lecture 3示例:
import pygame, sys,os
from pygame.locals import *
pygame.init()
window = pygame.display.set_mode((468, 60))
pygame.display.set_caption('Monkey Fever')
screen = pygame.display.get_surface()
monkey_head_file_name = os.path.join("data","chimp.bmp")
monkey_surface = pygame.image.load(monkey_head_file_name)
screen.blit(monkey_surface, (0,0))
pygame.display.flip()
def input(events):
for event in events:
if event.type == QUIT:
sys.exit(0)
else:
print event
while True:
input(pygame.event.get())