示例#1
0
文件: road.py 项目: marychev/ride_me
    def set_distance_traveled(self, val: Optional[int] = None) -> None:
        if val is not None:
            self.distance_traveled = val

        self.distance_traveled += self.get_distance_traveled()
        set_texture_uvpos(
            self,
            self.texture.uvpos[0] + self.bike.speed / self.texture.size[0],
            self.texture.uvpos[1])
        ValidObject.scene(self.parent).define_and_add_map_elements()
示例#2
0
 def scene(self):
     if hasattr(self.road, 'parent') and self.road.parent:
         return ValidObject.scene(self.road.parent)