class Player: def __init__(self): self.pos = Vector(CANVASWIDTH / 2, CANVASHEIGHT / 2) self.vel = Vector() self.radius = 10 self.colour = 'Green' def draw(self, canvas): canvas.draw_circle(self.pos.get_pos(), self.radius, 1, self.colour, self.colour) def update(self): self.pos.add(self.vel) self.vel.multiply(0.85)
class spawn_point: def __init__(self, pos): self.vel = Vector() self.moveP = Vector(pos[0], pos[1]) self.startPos = Vector(0, 0) self.endPos = Vector(0, 0) def draw(self, canvas): canvas.draw_circle(self.moveP.get_pos(), 10, 5, 'Red', 'Red') def update(self): self.moveP.add(self.vel) self.vel.multiply(0.85) screenPos = self.moveP
class tMap: def __init__(self, zoom): self.vel = Vector() self.source = img self.centreSource = Vector(307, 307) self.dimSource = Vector(614, 614) self.moveP = Vector(307, 307) self.imgZoom = Vector(614 * zoom, 614 * zoom) def draw(self, canvas): canvas.draw_image(img, self.centreSource.get_pos(), self.dimSource.get_pos(), self.moveP.get_pos(), self.imgZoom.get_pos()) def update(self): self.moveP.add(self.vel) self.vel.multiply(0.85)