How to make SPACE INVADERS using Pygame in Python
DO MAKE SURE TO VISIT MY CHANNEL :) import pygame, random pygame.init() health = 100 score = 0 display = pygame.display.set_mode((1200, 673)) bg = pygame.image.load("space.png") player = pygame.image.load("player.png") enemy = pygame.image.load("enemy.png") bullet = pygame.image.load("bullet (2).png") bullet_2 = pygame.image.load("bullet (2).png") bullet_3 = pygame.image.load("bullet (2).png") player_x = 550 player_y = 500 player_bullet = pygame.image.load("bullet (2).png") player_bullet_x = player_x-10 player_bullet_y = player_y+20 enemy_x = random.randint(0, 1000) enemy_2_x = random.randint(0, 1000) enemy_3_x = random.randint(0, 1000) enemy_y = 0 enemy_bullet_x = enemy_x+17 enemy_bullet_2_x = enemy_2_x+17 enemy_bullet_3_x = enemy_3_x+17 enemy_bullet_y = enemy_y+25 running = True while running: font = pygame.font.SysFont(None, 40 ) display.blit(bg, (0, 0)) text = font.render(f'Score: {score}', T...
Comments
Post a Comment