0
import pygame
def main():
#variaveix
pygame.init()
tela = pygame.display.set_mode([300, 300])
pygame.display.set_caption('THE GAME')
relogio = pygame.time.Clock()
branco = (255,255,255)
azul = (0,255,255)
verde = (0,255,0)
sup = pygame.Surface((200,200))
sup.fill(azul)
sup2 = pygame.Surface((100,100))
sup2.fill(verde)
sair=False
while sair !=True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
sair = True
if event.type == pugame.MOUSEMOTION
sup2 =sup2.move(10, 10)
relogio.tick(27)
tela.fill(branco)
tela.blit(sup,[50,50])
tela.blit(sup2,[70,70])
pygame.display.update()
pygame.quit()
main()
agr aparece line 25, in main sup2 =sup2.move(10, 10) Attributeerror: pygame. Surface' Object has no attribute 'move'
– KeddyHecky
@Keddyhecky This is already a different error than what is in the question. You were asking for a syntax error and this has already been solved. As for this new mistake, really, the object
Surface
has not the methodmove
, After all, a drawing area represents an array of pixels where drawings are made, it makes no sense to move it somewhere. It may make sense to redraw pixels at different positions or change the numbers you use onblit
, but moving Surface itself doesn’t make sense.– Victor Stafusa
really. _. vlw
– KeddyHecky
@Keddyhecky Was that answer the solution to the question problem? If yes, mark it as the answer accepted
– Jefferson Quesado