def notifyVelocityChanged(self, oldV): """Does not check whether velocity has in fact changed.""" if self._v == Vector2(0, 0): eventType = Event.ENTITY_STOPPED else: eventType = Event.ENTITY_MOVING e = Event(self._entity._world._time, eventType) e.entity = self._entity e.oldVelocity = oldV e.newVelocity = self._v self._entity._em.handleEvent(e)