17 lines
536 B
Python
17 lines
536 B
Python
import pygame
|
|
import numpy as np
|
|
from scripts.utils import to_isometric_pixel
|
|
|
|
class Entity:
|
|
def __init__(self, game, e_type, pos, size):
|
|
self.game = game
|
|
self.type = e_type
|
|
self.pos = np.array(pos)
|
|
self.size = size
|
|
self.velocity = np.array([0,0], dtype=np.float32)
|
|
def update(self, movement = np.array([0,0])):
|
|
frame_movement = self.velocity + movement
|
|
self.pos += frame_movement
|
|
def render(self, surface):
|
|
surface.blit(self.game.assets[self.type], self.pos)
|