In summary, in case the question is not clear, could anyone help me to increase the rate at which enemies spawn and/or increasing the velocity when certain score limits are reached? Score_display(screen, "Score: " + str(score), 18, 0, 0) If xor(keys, keys):Įlif xor(keys, keys):Ĭollide_list_x = (player, enemies_listX, False)Ĭollide_list_y = (player, enemies_listY, False)ĭrawing_text(screen, "Game Over",32, 300, 150)ĭrawing_text(screen, "Score: " + str(score), 32, 300, 300)ĭrawing_text(screen, "Press any key to restart", 32, 300, 450)īullet_collide_x = (bullets, enemies_listX, True, True)īullet_collide_y = (bullets, enemies_listY, True, True) Projectile = Bullet(player.pos, player.angle) If len(bullets) < 1: # number of bullets on screen Text_surface = font.render(text, False, white)ĭrawing_text(screen, "Welcome to the game!", 32, 300, 150)ĭrawing_text(screen, "Press any key to start", 32, 300, 300) Text_surface = font.render(text, True, white)Īll_sprites = (player)įor i in range(5): # number of enemies spawned (x)įor i in range(5): # number of enemies spawned (y)ĭef drawing_text(surface, text, size, x, y): ![]() If screen.get_rect().contains(self.rect):ĭef score_display(surface, text, size, x, y):įont = ('freesansbold.ttf', size) Self.velocity = Vector2(9, 0).rotate(angle) If Vector2.length(self.pos) > Vector2.length(Vector2(800, 0)): Self.image = (self.original_image, -self.angle) Self.radius, self.angle = direction.as_polar() (self.image, pygame.Color('steelblue2'), ) Self.image = pygame.Surface((50, 30), pygame.SRCALPHA) This statement here throws up no errors, but does not have the desired effect. But this game is rather linear and I would like to add a bit of difficulty to it by either increasing the speed of enemies and/or increasing the rate at which enemies spawn (therefore increasing the number of enemies)Īn example I tried (I put this in the main loop) if score >= 10: ![]() ![]() I have a score counter, and every time an enemy is killed, the score increases by 1. I am stuck on something that seems rather simple but I am not sure how to implement it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |