0
I’m reading a python book had a code I can’t understand: my doubt
Doubts:
1.What is this get_rect() ?
2.How does it work to treat things like rectangle ?
3.What is self.screen_rect = screen.get_rect() ?
4.Which is self.rect.centerx = self.screen_rect_centerx ,self.rect.bottom = self.screen_rect.bottom ?
Get me those doubts pfv.
import pygame
class nave():
def __init__(self,screen):
self.tela = tela
self.image = pygame.image.load('images/ship.bmp')
self.rect = self.image.get_rect()
self.screen_rect = screen.get_rect()
self.rect.centerx = self.screen_rect_centerx
self.rect.bottom = self.screen_rect.bottom
def blitme(self):
self.screen.blit(self.image,self.rect)