代碼: #!/usr/bin/python
import pygame, time, sys, random, os
from pygame.locals import *
from time import gmtime, strftime
pygame.init()
w = 640
h = 400
screen = pygame.display.set_mode((w, h
我想在繪製方法中得到圓的矩形,但每當我在我的Alien實例上調用get_rect()方法時,Pygame都會發出錯誤。我想要一個動態的圓面來進行碰撞檢測,因爲我的代碼會生成不同的隨機大小的圓。請任何幫助,將不勝感激 class Alien():
def __init__(self, etc):
self.x = random.randrange(0,600)
se
我剛剛開始我的第一個PyGame項目,我無法找到如何正確使用蒙版實體應用於移動的Surface。 我做了一個特定的類動畫面 class LabelObject():
def __init__(self, surface, x, y, endX, speed, idleTime):
self.surface = surface
self.x = x
se