def create_raindrop(r_settings, screen, raindrops, raindrop_number): """Create an raindrops and place it in the row.""" raindrop = Raindrop(r_settings, screen) raindrop_width = raindrop.rect.width raindrop.x = raindrop_width + 2 * raindrop_width * raindrop_number raindrop.rect.x = raindrop.x raindrops.add(raindrop)
def create_raindrop(ai_settings, screen, raindrops, raindrop_number): """Create raindrop object at its location.""" raindrop = Raindrop(screen) raindrop_width = raindrop.rect.width raindrop_height = raindrop.rect.height raindrop.x = raindrop_width + 2 * raindrop_width * raindrop_number raindrop.rect.x = raindrop.x raindrops.add(raindrop)
def create_raindrop(ai_settings, screen, raindrops, number): # 创建一个雨滴并加入当前行 raindrop = Raindrop(ai_settings, screen) raindrop_width = raindrop.rect.width raindrop.x = raindrop_width + 2 * raindrop_width * number raindrop.rect.x = raindrop.x raindrop.rect.y = raindrop.rect.height raindrops.add(raindrop)
def create_raindrop(ai_settings, screen, raindrops, raindrop_number, row_number): """Create a raindrop and place it in the row.""" raindrop = Raindrop(ai_settings, screen) raindrop_width = raindrop.rect.width raindrop.x = raindrop_width + 2 * raindrop_width * raindrop_number raindrop.rect.x = raindrop.x raindrop.rect.y = raindrop.rect.height + 2 * raindrop.rect.height * row_number raindrops.add(raindrop)
def create_raindrop(ayarlar, screen, raindrops, raindrop_number, row_number): """Create a raindrop and place it in the row.""" raindrop = Raindrop(ayarlar, screen) raindrop_width = raindrop.rect.width raindrop.x = 0.5 * raindrop_width + raindrop_width * raindrop_number raindrop.rect.x = raindrop.x raindrop.y = 0.5 * raindrop.rect.height + raindrop.rect.height * row_number #raindrop.rect.y = raindrop.y # look at line 38 we need to store x direction but why we do not need y direction. raindrops.add(raindrop)
def create_raindrop(screen, raindrops, row_number, line_number): raindrop = Raindrop(screen) raindrop_width = raindrop.rect.width raindrop_height = raindrop.rect.height raindrop.x = raindrop_width + 2 * raindrop_width * row_number raindrop.y = raindrop_height + 2 * raindrop_height * line_number raindrop.rect.x = raindrop.x raindrop.rect.y = raindrop.y raindrops.add(raindrop)
def _create_raindrop(self, raindrop_number): #Create a raindrop and place it in the game surface. raindrop = Raindrop(self) raindrop_width, raindrop_height = raindrop.rect.size raindrop.x = (randint(0, self.settings.screen_width - raindrop_width)) raindrop.rect.x = raindrop.x raindrop.rect.y = randint( 0, (self.settings.screen_height - raindrop_height)) self.raindrops.add(raindrop)
def _create_raindrop(self, raindrops_num, raindrop_row): raindrop = Raindrop(self) raindrop_width, raindrop_height = raindrop.rect.size raindrop.x = raindrop_width + 2 * raindrop_width * raindrops_num raindrop.rect.x = raindrop.x raindrop.rect.y = raindrop.rect.height + 2 * raindrop.rect.height * raindrop_row self.raindrops.add(raindrop)
def create_raindrop(screen, myset, raindrops, x_number, y_number): """ 创建单个雨滴 """ raindrop = Raindrop(screen, myset) h = raindrop.rect.height w = raindrop.rect.width raindrop.rect.x = w + 2 * x_number * w raindrop.x = raindrop.rect.x raindrop.rect.y = h + 2 * y_number * h raindrop.y = raindrop.rect.y raindrops.add(raindrop)
def _create_drop(self, drop_number): new_drop = Raindrop(self) drop_width, drop_height = new_drop.rect.size new_drop.x = drop_number * drop_width * 2 + self._get_raincloud_buffer( ) // 2 + 2 * drop_width new_drop.rect.x = int(new_drop.x) new_drop.rect.y = self._get_drop_start_y() self.drops.add(new_drop)
def create_one_row_fleet(ayarlar, screen, raindrops): """Create a only one row raindrop fleet.""" for row_number in range(1): for raindrop_number in range(7): raindrop = Raindrop(ayarlar, screen) raindrop_width = raindrop.rect.width raindrop.x = 0.5 * raindrop_width + raindrop_width * raindrop_number raindrop.rect.x = raindrop.x raindrop.y = 0 #0.1 * raindrop.rect.height #+ raindrop.rect.height * row_number #raindrop.rect.y = raindrop.y # look at line 38 we need to store x direction but why we do not need y direction. raindrops.add(raindrop)
def create_raindrop(ai_settings, screen, storm, raindrop_number, raindrop_width, row_number): # Create alien and place it in a row raindrop = Raindrop(ai_settings, screen) raindrop.x = raindrop_width + 2 * raindrop_width * raindrop_number # x stores where the raindrop should be, raindrop rect object will move it on the screen raindrop.rect.x = raindrop.x # Need to update raindrop y, alien does not have a y attribute raindrop.y = raindrop.rect.height + 2 * raindrop.rect.height * row_number raindrop.rect.y = raindrop.y storm.add(raindrop)
def _create_drop(self, drops): raindrop = Raindrop(self) raindrop_width, raindrop_height = raindrop.rect.size raindrop.x = raindrop_width + 2 * raindrop_width * drops raindrop.rect.x = raindrop.x self.raindrops.add(raindrop)