Kod güzel İngilizcesi yetmeyenler bulamayabilir diye paylaştım aslinda bir şey farkettim bu formun pygame kategorisinin neredeyse hepsi benim sorularim
bir şey sorucam ben bu particle ların attığım alev topunu takip etmesini istiyorum ama benim kamera modülümü nasıl bağlıcam particlelara bilmiyorum çünkü kamera kodu diğim modül uygun olmaz sadece rectangle ile çalışıyor
#camera kodu
class Camera:
def __init__(self, mapWidth, mapHeight):
self.camera = pg.Rect(0, 0, mapWidth, mapHeight)
self.width = mapWidth
self.height = mapHeight
def apply(self, sprite):
return sprite.rect.move(self.camera.topleft)
def apply_rect(self, rect):
return rect.move(self.camera.topleft)# For The Enemy Health
def update(self, target):
x = -target.rect.centerx + int(WIDTH/2)
y = -target.rect.centery + int(HEIGHT//1.35)
# limit scrolling to map size
x = min(0, x) # left
y = min(0, y) # top
x = max(-(self.width - WIDTH), x) # right
y = max(-(self.height - HEIGHT), y) # bottom
self.camera = pg.Rect(x, y, self.width, self.height)
Kamera sisteminizde bir sıkıntı olsa gerek, kullanımını yeterince esnek hale getirememiş olabilirsiniz. Kamerayı nasıl kullandığınızı ve cisimleri nasıl blit ettiğinizi bilmeden yardım edemem.