Pygame Space Invaders Beginner Tutorial in Python - PART 2 | Creating Spaceship

preview_player
Показать описание
In this Python tutorial I code Space Invaders using the PyGame module. I'm going to cover the creation of a spaceship and adding controls to move it left and right.

Рекомендации по теме
Комментарии
Автор

Thank you Russ, your videos have allowed me to follow along easily and create more things than I did previously. I’m also learning a lot more about programming in general from your videos. Honestly, the best videos on YT

joemorris
Автор

This tutorial is awesome. I love tagging along with this - I fully admit I don't understand everything that is going on, but I definitely know more about python than when I started and it's teaching me to scan my code when something goes wrong and figure it out. I got super stuck putting the health bar on initially until I realized I had the code one tab off. Fixed it and it worked!

KeepitWausome
Автор

Simplified to the extreme! Thanks, dude! I'm Subscribed!

rashidix
Автор

am learning this after the platformer, i was interested in the shooting mechanism

really easy to understand, thanks man!

soupnoodles
Автор

red = (255, 0, 0)
orange = (255, 128, 0)
yellow = (255, 255, 0)
green = (0, 255, 0)
turqiouse = (0, 225, 128)
light_blue = (0, 255, 255)
blue = (0, 0, 255)
purple = (127, 0, 255)
magenta = (255, 0, 255)
pink = (255, 0, 127)
black = (0, 0, 0)
white = (255, 255, 255)

if necessary

someonerandom
Автор

It's hard for me to understand, cause I am a newbie in programming, also don't know any library, BUT IT WORKS! Thank you mister!

volodyagorov
Автор

Downloaded the code file on your GitHub and when i open it in VS code and try to run it I get this (I downloaded all img and wav files) "FileNotFoundError: No such file or directory" Please help!

Ghosted
Автор

instead of spaceship = Spaceship(int(screen_width / 2), screen_height - 100, 3) a shorter way of saying that is
spaceship = Spaceship(screen_width // 2, screen_height - 100, 3)
the double slash basicly is floor division which does the same thing as the int() function so use either one

jedicubing
Автор

The health bar only shows up when i am moving right.

Azerc
Автор

my images do not appear on the pygame window when i run it. please what could be the problem

mbellaesther
Автор

Question - when you don't want a decimal value you seem to sometime use floor division and other time convert to integer. Do these do different things in Pygame or do you just use them interchangeably? Fantastic videos by the way - I have been using them with my students to help them learn Pygame. Great work!

stuartburnaby
Автор

I have been following along and I get the error 'Spaceship' object has no attribute 'image'. Does anyone have an idea why?

konstantinosmatis
Автор

It's showing rect argument is invalid, in the case ' pygame.draw.rect ', how can I fix that?

ratnadeephalder
Автор

Idk what is wrong with my code, the spaceship keeps appearing in the top left corner of the screen, doesnt matter what cordinates I put.

victoralmeida
Автор

when i try and create an instance, I get this error
add() argument after * must be an iterable, not int

mdwirh
Автор

type object argument after * must be an iterable, not float

PhuongNguyen-xssn
visit shbcf.ru