Комментарии:
Although I struggle for 3 days, but nice for beginners like me. Thank you so much! Hope u have the best when prodiving very detailed and free-acess education for people!
ОтветитьEs una gran introducción a PyGame.
¡Felicitaciones!
It is a great introduction to PyGame.
Congratulations!
<3
ОтветитьFreecodecamp, please try to post a video on the tutorial ursina python 3d game engine.
ОтветитьYou should make something like this for teachers to teach certain chunks of knowledge and then the person can play if they get the answers right. Work, then play, then work, then play
ОтветитьTremendous, thanks for the tutorial!
ОтветитьGood course but you have a bad habit of using too much comments
ОтветитьHey screen fill is not working
Ответитьsome how I have to press alt and spacebar at the same time in order to shoot the bullet. strange..... :V
ОтветитьSzkoda tylko że nie ma mechaniki FPS, a to podstawa nawet w najprostszych grach w pygame.
ОтветитьReally is wonderful journey for gaming
Ответитьamazing
ОтветитьHow to atually add photos in vs code
as png files
I've been searching for how to add the PNG images to the Pycharm Directory, or in other words, the sidebar list. That was skipped in the tutorial -- the file was already there when that chapter started.
I have the image I'd like to use for my player icon (spaceship). Any advice on how this is properly done?
I'm using a Mac.
Everyone who just got learned properly because of this man and i learned this in just some minutes people who think that this man should get the best teacher award (Like)
Ответитьthis video is good
Ответитьi love this guy
ОтветитьThis tutorial is nothing short of amazing, I am working on a school project and using this video, I was taught how to use something I was considered a complex topic, so efficiently. Big thanks to you guys at freeCodeCamp. Cheers!
Ответитьjust finished this tutorial - it's great. Many thanks for making this and making it easy to follow.
ОтветитьMy player and enemy are glitching
ОтветитьPNG file image is not loading in mine, the image does not get loaded, when I try to run the code, it shows "Unsupported Image Format" !! What should I do ??
Ответитьbest tutorial about pygame❤🔥
Ответитьthis is fucking terrible
ОтветитьHow to add the downloaded png to your poroject
ОтветитьShowing many errors don't know why
ОтветитьAnyone from 8std
ОтветитьFor some reason it wont let me insert a image
ОтветитьThis tutorial helped me in preparation of using Unreal engine and studying software engineering at university level
ОтветитьFor some reason my bullet isnt appearing on the screen.
import pygame
import random
pygame.init()
running = True
# Screen
screen = pygame.display.set_mode((1200, 800))
image = pygame.image.load('rocket.png')
pygame.display.set_icon(image)
# Background
background = pygame.image.load('background.jpg')
# player
player_image = pygame.image.load('spaceship.png')
playerX = 550
playerY = 650
playerchange = 50
# Enemy
enemy_image = pygame.image.load('enemies.png')
enemyX = random.randint(0, 1200)
enemyY = random.randint(50, 150)
enemychangeX = 0.3
enemychangeY = 30
# Bullet
bullet_image = pygame.image.load('bullet.png')
bulletX = 0
bulletY = 650
bullet_state = False
bulletchangeY = 10
# Drawing spaceship on the surface
def player(x, y):
screen.blit(player_image, (x, y))
def enemy(x, y):
screen.blit(enemy_image, (x, y))
def bullet_fire(x, y):
global bullet_state
bullet_state = True
screen.blit(bullet_image, (x + 16, y + 10))
# Game loop
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_LEFT:
playerX = playerX - playerchange
if event.key == pygame.K_RIGHT:
playerX = playerX + playerchange
if event.key == pygame.K_SPACE:
bullet_fire(playerX, bulletY)
if event.type == pygame.KEYUP:
if event.key == pygame.K_LEFT or event.key == pygame.K_RIGHT:
playerX = playerX
if playerX <= 0:
playerX = 0
if playerX >= 1072:
playerX = 1072
enemyX += enemychangeX
if enemyX <= 0:
enemychangeX = 0.3
enemyY += enemychangeY
elif enemyX >= 1072:
enemychangeX = -0.3
enemyY += enemychangeY
if bullet_state is True:
bullet_fire(playerX, bulletY)
bulletY -= bulletchangeY
screen.fill((0, 0, 0))
screen.blit(background, (0, 0))
player(playerX, playerY)
enemy(enemyX, enemyY)
pygame.display.update()
(Can anyone tell me whats the problem)
You come up with the idea of a game, teaching everything one needs to accomplish it. Much better than any book or tutorial I ever read!
ОтветитьI watched it one sitting
Ответитьcan someone please tlel me how to get the autofill thing cuz they don't come up for me
Ответитьcode is correct but spaceShip is not moving
ОтветитьWayyy better
ОтветитьHernandez Maria Hall Sarah Gonzalez Brian
ОтветитьIm indian and I think this man has destroyed everyone's expectations of our english
ОтветитьWow Finally I successfully completed coding , implemented and played the game. Thanks a lot
Ответитьcan print our score on the game window
Ответитьexcellent
Ответитьloved the video
Ответитьusing flaticon u have to use 500 px just download it then open where its saved then change its size
ОтветитьWhenever i am trying to run the program the screen of pygame doesn’t work
Is there any solution for me?
bullet wont stay with the ship. fires from left side of screen only. how to fix?
Ответить