The ultimate introduction to Pygame
Why Stack Overflow recommends it
Stack Overflow users are mostly beginners who follow this tutorial and then post questions about code that behaves differently from the video, so it shows up as the source they were working from.
Recommended by 0 people across 0 different months, 2022 to 2022.
What it is
A nearly four-hour Pygame tutorial from the Clear Code channel that builds a simple runner game while covering the core Pygame concepts: windows and the game loop, surfaces, rectangles, collisions, input, game states, timers, animation, sprite classes and sound. The presenter says the game is a vehicle for learning the basics needed to start most 2D games.
What people said
Cites Dominzki · 2022-02 · Stack Overflow · on “Pygame beginner, player animation not working despite doing it by the tutorial”
First time ever working with Pygame for a school assignment and I'm following a tutorial for it with my project members (tutorial link [this video] ). Problem is that despite following the tutorial to the dot at the "animating the player", my character (named "Marko" in the game and code) doesn't have his animation playing. When I start the game the character is stuck on it's first frame of animation. I've created a 3-frame animation and have the frames as separate png-files. The game so far itself works (it's on very beginner level, just a couple spawning enemies, collision and intro screens done so far), but the animation has had me and my project group scratching our heads for days. So far hav
Cites lowteq · 2022-04 · Stack Overflow · on “Border behaviour when drawing a rectangle in Pygame”
I'm following a Pygame tutorial on YouTube published by Clear Code. So far it's gone well but I've run into an inconsistency between the demo on the video and the behaviour of my code, I'm pretty sure I'm doing exactly what the tutorial instructs, but my results are different. I'm attempting to draw a border around a rectangle, the rectangle was created from a surface that contains some text as follows. test_font = pygame.font.Font('font\Pixeltype.ttf',50) score_surf = test_font.render('My Game', False, 'Black') score_rect = score_surf.get_rect(center = (400,50)) #Later in the main loop pygame.draw.rect(screen,'Pink',score_rect) pygame.draw.rect(screen,'Pink',score_rect, 6) My understanding
Cites garnaalkroket · 2022-09 · Stack Overflow · on “Pygame always showing a black screen”
I am trying to recreate this [this video] pygame but i keep getting a black screen without anything displayed. I get no error's so i don't know where i need to start. import pygame from sys import exit pygame.init() screen = pygame.display.set_mode((800, 400)) pygame.display.set_caption("Runner") clock = pygame.time.Clock() test_surface = pygame.image.load('graphics/Sky.png') while True: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() exit() screen.blit(test_surface,(0, 0)) pygame.display.update() clock.tick(60)