-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathSabredeluz.py
More file actions
37 lines (28 loc) · 1013 Bytes
/
Sabredeluz.py
File metadata and controls
37 lines (28 loc) · 1013 Bytes
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
import pygame
from Start import *
from random import randint
class Sabredeluz():
def __init__(self):
self.largura = 1080
self.altura = 1536
self.image = pygame.transform.scale(pygame.image.load("images/sabredeluz.png"), (50, 50))
self.position()
self.value = 1
def movesabre(self):
self.posicao_sabrey+=self.value
def upVelocidade(self):
if self.value >= 5:
self.value = 2.0
self.value += 0.4
def outWindow(self):
if self.posicao_sabrey >= self.altura - 40:
self.position()
def render(self, tela):
tela.blit(self.image, (self.posicao_sabrex, self.posicao_sabrey))
def object(self, surface):
return pygame.draw.rect(surface, (255, 0, 0), (self.posicao_sabrex, self.posicao_sabrey, 50, 50))
def reset(self):
self.position()
def position(self):
self.posicao_sabrex = randint(0, self.largura - 40)
self.posicao_sabrey = randint(0, 600) * -1