Esempio n. 1
0
 def Update(self):
     self.count -= 1
     self.moveH -= 1
     if self.count <= 0 or self.fast:
         if not self.move():
             self.place()
         self.count = 15
     keys = pygame.key.get_pressed()
     if self.moveH == 0:
         pp = self.pos + qVec(keys[K_d] - keys[K_a], 0)
         if self.isValid(pp):
             self.pos = pp
         self.moveH = 5
Esempio n. 2
0
 def move(self):
     pp = self.pos + qVec(0, 1)
     if self.isValid(pp):
         self.pos = pp
         return True
     return False
Esempio n. 3
0
 def rot(x):
     if event.key == K_w:
         return qVec(-x[1], x[0])
     return qVec(x[1], -x[0])
Esempio n. 4
0
 def newPize(self):
     rr = randint(0, 6)
     pos = qVec(self.width / 2, -3)
     closs = Closs(self, pos, rr)
     self.add(closs)
Esempio n. 5
0
import numpy as np
import pygame
from pygame import K_a, K_s, K_d, K_w, K_SPACE
from quark import qGameObject
from quark.colors import *
from quark.maths import qVec2, qVec
from random import randint

colours = [qRed, qBlue, qLime, qDarkRed, qSilver, qWheat, qDeepOink]
shapes = [
    [qVec(0, 0), qVec(0, 1), qVec(1, 0),
     qVec(1, 1)],
    [qVec(0, -1), qVec(0, 0), qVec(1, 0),
     qVec(1, 1)],
    [qVec(1, -1), qVec(0, 0), qVec(1, 0),
     qVec(0, 1)],
    [qVec(0, 0), qVec(-1, 0), qVec(1, 0),
     qVec(0, 1)],
    [qVec(0, -1), qVec(0, 0), qVec(0, 1),
     qVec(0, 2)],
    [qVec(-1, 0), qVec(0, 0), qVec(0, 1),
     qVec(0, 2)],
    [qVec(1, 0), qVec(0, 0), qVec(0, 1),
     qVec(0, 2)],
]


class Closs(qGameObject):
    def __init__(self, level, pos, clossType):
        self.level = level
        self.type = clossType
Esempio n. 6
0
 def __init__(self, pygame_surface):
     self.data = pygame_surface
     self.size = qVec(self.data.get_size())
     self.width = self.data.get_width()
     self.height = self.data.get_height()