Space Invaders in Python Part 1 - Window, Title and Player

preview_player
Показать описание
Hello again everyone! Today we will be making the window, title and player for the game using the pygame module in Python!

Here is the link if you would like to review the code for this video or download the player image:

#Python #pygame #Games #SpaceInvaders #Learning #pythongames
Рекомендации по теме
Комментарии
Автор

forget my curiosity, but how old r u? i think we r the same age lol. Great video keep it up

s.dh
Автор

Hi, sorry if this question is too basic. Can you tell me which ide you are using? and where to get it from?

SamirMishra
Автор

I did exactly what you said while coding "Space Invaders." However, after installing pygame and putting my png images in the "Assets" folder in PyCharm, I got an error saying "pygame.error: Couldn't open player_ship.png".

All my png images were made on Microsoft Paint.

Here is my code so far:

import pygame

# Initialize the Game
pygame.init()

# Create the Screen
screen = pygame.display.set_mode((800, 600))

# Title
Invaders")

# Player
playerImg =
playerX = 370
playerY = 480

def player():
screen.blit(playerImg, (playerX, playerY))

# Main Game Loop
running = True

while running:

# Color of Screen(r, g, b)
screen.fill((0, 0, 0))

for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False

# Display the Player
player()

pygame.display.update()

drewbug
visit shbcf.ru