Пример #1
0
 def __init__(self, x_co, y_co, w_co, h_co, vx_co, vy_co, mass, world_name,
              c_co):
     Block.__init__(self, x_co, y_co, w_co, h_co, vx_co, vy_co, mass,
                    world_name, c_co)
     self.graphics = TiledGraphics("img/bluerounded.png",
                                   self.mylevel.meter * self.w,
                                   self.mylevel.meter * self.h)
Пример #2
0
    def __init__(self, x, y, image, viewport, targetable=True):
        Block.__init__(self, x, y, image, viewport)

        self.targetable = targetable

        self.collided = False

        self.selected = False
Пример #3
0
 def __init__(self, image_path, position, center, collider=None):
     Block.__init__(self, image_path, position, collider)
     self.center = center
     self.this_center = pygame.math.Vector2(self.position.x
                                            + self.animation.current_frame().get_width() / 2,
                                            self.position.y
                                            + self.animation.current_frame().get_height() / 2)
     self.distance = self.this_center - self.center
     self.type = Entity.TYPE_OBJECT_DYNAMIC
Пример #4
0
 def __init__(self, position, velocity, height, width, identifier):
     pygame.sprite.Sprite.__init__(self)
     Block.__init__(
         self,
         position,
         velocity,
         height,
         width,
         Moss.MASS,
         Moss.MOMENT,
         pygame.image.load(
             "images/moss square box tileset game obstacle/PNG/moss_tile.png"
         ),
         identifier,
         body_type=pymunk.Body.STATIC)
Пример #5
0
 def __init__(self,
              position,
              velocity,
              height,
              width,
              identifier):
     pygame.sprite.Sprite.__init__(self)
     Block.__init__(self,
                    position,
                    velocity,
                    height,
                    width,
                    Stone.MASS,
                    Stone.MOMENT,
                    pygame.image.load(
                        "images/brick_game_asset_game_obstacles/PNG/brick_1.png"),
                    identifier)
Пример #6
0
 def __init__(self,
              position,
              velocity,
              height,
              width,
              identifier):
     pygame.sprite.Sprite.__init__(self)
     Block.__init__(self,
                    position,
                    velocity,
                    height,
                    width,
                    Crate.MASS,
                    Crate.MOMENT,
                    pygame.image.load(
                        "images/wooden brick tile game obstacle/PNG/1.png"),
                    identifier)
Пример #7
0
    def __init__(self, x, y, viewport, dispatcher):
        image = random.choice(Unit.images)
        Block.__init__(self, x, y, image, viewport)

        self.dispatcher = dispatcher

        self.old_x = x
        self.old_y = y

        with open("names.json") as f:
            names = json.load(f)
            self.name = random.choice(names["unit_names"])

        self.cooperation_rating = 10
        self.regeneration_coefficient = random.uniform(0.2, 0.70)
        self.degeneration_coefficient = random.uniform(0.5, 1.2)

        self.stuck_options_tried = [False, False, False, False]
        self.stuck_location = None
        self.turns_stuck = 0

        self.stock_pile = None

        self.inventory = []
        self.inventory_size = 10

        self.id = str(uuid4())

        self.work_surf = None

        self.task = None
        self.work_target = None
        self.collection_target = None
        self.return_from_collection = False

        self.dirty = 2
Пример #8
0
 def __init__(self,game,grid_x,grid_y,grid_x_max,grid_y_max):
     Block.__init__(self,game,grid_x,grid_y,grid_x_max,grid_y_max,2)
Пример #9
0
 def __init__(self, parent=None):
     Block.__init__(self, parent)
     self.setOriginalBackGround()
Пример #10
0
 def __init__(self):
     Block.__init__(self, random.randint(1, COLUMNS - 2),
                    random.randint(1, ROWS - 2))
    def __init__(self, index, data, previous_hash=None):
        self.index = index
        self.data = data

        # this must be at last line of __init__
        Block.__init__(self, previous_hash)
Пример #12
0
 def __init__(self,screen,pos,size,num,color=(0,0,0)):
     Block.__init__(self,screen,pos,size,num,color)
     self.param_init()
Пример #13
0
 def __init__(self, position, velocity, height, width, identifier):
     pygame.sprite.Sprite.__init__(self)
     Block.__init__(self, position, velocity, height, width, Sheep.MASS,
                    Sheep.MOMENT,
                    pygame.image.load("images/RoundAnimals/sheep.png"),
                    identifier)
Пример #14
0
	def __init__(self):
		Block.__init__(self)
		self.name = "self.name"
		self.state = False
		self.canvas = self.frame = self.id = None
		self.coords = (0,0)
Пример #15
0
 def __init__(self, x_co, y_co, w_co, h_co, vx_co, vy_co, mass, world_name, c_co):
     Block.__init__(self, x_co, y_co, w_co, h_co, vx_co, vy_co, mass, world_name, c_co)
     self.graphics = TiledGraphics("img/bluerounded.png", self.mylevel.meter*self.w, self.mylevel.meter*self.h)
    def __init__(self, index, path, previous_hash=None):
        self.index = index
        self.path = path

        # this must be at last line of __init__
        Block.__init__(self, previous_hash)
Пример #17
0
 def __init__(self):
     Block.__init__(self)
     self.name = "self.name"
     self.state = False
     self.canvas = self.frame = self.id = None
     self.coords = (0, 0)
Пример #18
0
 def __init__(self, position, velocity, height, width, identifier):
     pygame.sprite.Sprite.__init__(self)
     Block.__init__(self, position, velocity, height, width,
                    Ice.MASS, Ice.MOMENT,
                    pygame.image.load("images/iceblock.png"), identifier)