Skip to content
Snippets Groups Projects
objects.py 440 B
Newer Older
Drahflow's avatar
Drahflow committed
from common import *

class Text:
Drahflow's avatar
Drahflow committed
    def __init__(self, text, y):
Drahflow's avatar
Drahflow committed
        self.text = text
Drahflow's avatar
Drahflow committed
        self.y = y
Drahflow's avatar
Drahflow committed
        self.t = 0

    def draw(self):
        txt = font.render(self.text, True, (0, 0, 255))

        width = txt.get_width()
Drahflow's avatar
Drahflow committed
        screen.blit(txt, (400 - width / 2, self.y))
Drahflow's avatar
Drahflow committed

    def update(self, tick):
        self.t += 1

        if self.t > 100:
            objects.remove(self)

    def typed(self, key):
        pass