IRESTE/Car.py

16 lines
377 B
Python

import sumolib
import pygame as pg
class Car:
def __init__(self,carID,route,parentMap,surface):
self.id=carID
self.route=route
self.map=parentMap
self.pos=self.map.getEdge(route[0]).getFromNode().getCoord()
self.surf=surface
def draw(self):
pg.draw.circle(self.surf,(255,0,0),self.map.convertPos(self.pos),5)