Пример #1
0
 def start_drawing(self, x, y):
     x, y = self.check_snap(x,y)
     self.new_obj_id = level.get_id()
     self.new_free_obj = level.ImageDoorSprite(
         self.new_obj_id, self.doors[self.which_door][0],
         x, y, 0
     )
     level.simple_objects.append(self.new_free_obj)
Пример #2
0
 def stop_drawing(self, x, y):
     x, y = self.check_snap(x,y)
     if self.rad < 10: return
     obj_id = level.get_id()
     new_circ = level.Circle(
         obj_id, self.x, self.y, self.rad, self.visible, self.collides
     )
     level.primitives.append(new_circ)
     level.add_label(str(obj_id), self.x, self.y, new_circ)
Пример #3
0
 def stop_drawing(self, x, y):
     obj_id = level.get_id()
     new_triangle = level.FilledTriangle(obj_id, self.x1, self.y1, 
                                             self.x2, self.y1, 
                                             self.x1, self.y2, True)
     level.primitives.append(new_triangle)
     label_x = (self.x2-self.x1)/4 + self.x1
     label_y = (self.y2-self.y1)/4 + self.y1
     level.add_label(str(obj_id), label_x, label_y, new_triangle)
Пример #4
0
 def stop_drawing(self, x, y):
     obj_id = level.get_id()
     new_line = level.Line(
         obj_id, self.x1, self.y1, self.x2, self.y2, 
         self.visible, self.collides
     )
     level.primitives.append(new_line)
     level.add_label(
         str(obj_id), (self.x1+self.x2)/2, (self.y1+self.y2)/2, new_line
     )
Пример #5
0
 def stop_drawing(self, x, y):
     coord_list = (
         (self.x1, self.y1, self.x1, self.y2),
         (self.x1, self.y2, self.x2, self.y2),
         (self.x2, self.y2, self.x2, self.y1),
         (self.x2, self.y1, self.x1, self.y1)
     )
     for coords in coord_list:
         obj_id = level.get_id()
         new_line = level.Line(
             obj_id, coords[0], coords[1], coords[2], coords[3], 
             self.visible, self.collides
         )
         level.primitives.append(new_line)
         level.add_label(
             str(obj_id), (coords[0] + coords[2])/2, (coords[1] + coords[3])/2, new_line
         )
Пример #6
0
 def start_drawing(self, x, y):
     obj_id = level.get_id()
     new_key = level.Key(obj_id, x, y, self.key)
     level.primitives.append(new_key)
     level.add_label(str(obj_id), x-5, y+5, new_key)
Пример #7
0
 def start_drawing(self, x, y):
     self.obj_id = level.get_id()
     self.new_free_obj = level.DecalSprite(
         self.obj_id, x, y, 0.0, 1.0, self.decal_name
     )
     level.simple_objects.append(self.new_free_obj)
Пример #8
0
 def start_drawing(self, x, y):
     self.new_obj_id = level.get_id()
     self.new_free_obj = level.TurretSprite(
         self.new_obj_id, x, y, 0, self.turret_type, self.base_type
     )
     level.simple_objects.append(self.new_free_obj)
Пример #9
0
 def start_drawing(self, x, y):
     self.new_obj_id = level.get_id()
     self.new_free_obj = level.RockSprite(
         self.new_obj_id, x, y, 0, self.rock_type
     )
     level.simple_objects.append(self.new_free_obj)
Пример #10
0
 def stop_drawing(self, x, y):
     obj_id = level.get_id()
     new_door = level.Door(obj_id, self.x1, self.y1, self.x2, self.y2, self.key, self.visible)
     level.primitives.append(new_door)
     level.add_label(str(obj_id), (self.x1 + self.x2) / 2, (self.y1 + self.y2) / 2, new_door)
Пример #11
0
 def stop_drawing(self, x, y):
     obj_id = level.get_id()
     new_rect = level.FilledRect(obj_id, self.x1, self.y1, self.x2, self.y2, True)
     level.primitives.append(new_rect)
     level.add_label(str(obj_id), (self.x1+self.x2)/2, (self.y1+self.y2)/2, new_rect)
Пример #12
0
 def start_drawing(self, x, y):
     self.new_obj_id = level.get_id()
     self.new_free_obj = level.DestructibleWallSprite(self.new_obj_id, x, y, 0, 1, self.shelf_types[self.shelf_type])
     level.simple_objects.append(self.new_free_obj)