forked from thiagocn1/Projeto-Final
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zclasse_mundo_aberto.py
45 lines (37 loc) · 1.45 KB
/
zclasse_mundo_aberto.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#importar
import pygame
from configuracoes import *
class mapa_player(pygame.sprite.Sprite):
def __init__(self,):
pygame.sprite.Sprite.__init__(self)
print('veio aqui')
#falta colocar a imagem
self.image=pygame.image.load(path.join(IMG_DIR,'jair.webp')).convert_alpha()
self.image=pygame.transform.scale(self.image,(WIDTH/20,HEIGHT/20))
self.rect=self.image.get_rect()
self.rect.centerx= WIDTH-100
self.rect.centery= HEIGHT-100
self.vx = 0
self.vy = 0
def update(self):
# Atualização da posição do casa
self.rect.x += self.vx
self.rect.y += self.vy
class Rua(pygame.sprite.Sprite):
def __init__(self,pos):
pygame.sprite.Sprite.__init__(self)
#falta colocar a imagem
self.image=pygame.image.load(path.join(IMG_DIR,'Lula.webp')).convert_alpha()
self.image=pygame.transform.scale(self.image,(WIDTH/20,HEIGHT/20))
self.rect=self.image.get_rect()
self.rect.centerx= pos[0]
self.rect.centery= pos[1]
class Candidato(pygame.sprite.Sprite):
def __init__(self,pos):
pygame.sprite.Sprite.__init__(self)
#falta colocar a imagem
self.image=pygame.image.load(path.join(IMG_DIR,'Ciro.png')).convert_alpha()
self.image=pygame.transform.scale(self.image,(WIDTH/20,HEIGHT/20))
self.rect=self.image.get_rect()
self.rect.centerx= pos[0]
self.rect.centery= pos[1]