Learn Python by Building Five Games - Full Course
Why Stack Overflow recommends it
Stack Overflow users link it when they are following one of its game projects, such as Pong, Snake or the multiplayer game, and ask for help debugging where their code differs from the tutorial.
Recommended by 1 people across 1 different months, 2019 to 2022.
What it is
A 6h43m freeCodeCamp.org course that teaches Python by building five games: Pong, Snake, Connect Four, Tetris and an online multiplayer game. Each section is a tutorial from a different creator (Christian Thompson, Tech with Tim, Keith Galli), with code provided in the description.
What people said
Recommends Stephan Randle · 2021-10 · Stack Overflow · on “Trying to implement object-oriented pong game”
I am trying to follow the freecodecamp python pong game tutorial [this video] . However with an object oriented approach instead of a linear one. I created an object that both the paddles and the ball would be derived from. I wanted all of the functions to be easily accessible and manageable. However when updating the balls position and pressing a key it is also moving the paddings positions as well. I am not sure why because the objects should not have anything to do with each other. its like one object is manipulating another. if anybody could assist in helping me figure out the issue that would be greatly appreciated import turtle class PongObj: score = 0 speed = 0 position = [0, 0] direction
Cites Prakriti Timila · 2019-12 · Stack Overflow · on “Mac keeps crashing and restarting when in try to run a code”
New to python and trying to learn through freecodecamp by making easy games ( [this video] ), however, my windows keeps crashing when I try to run this code to create a Pong game. Used both Spyder, as well as VSC and the same thing, happened on both where it crashed and restarted my computer import turtle wn = turtle.Screen() wn.title("pong") wn.bgcolor("black") wn.set](width=800, height=600) wn.tracer(0) #Paddle A paddle_a = turtle.Turtle() paddle_a.speed(0) paddle_a.shape("square") paddle_a.color("white") paddle_a.shapesize(stretch_wid=5,stretch_len=1) paddle_a.penup() paddle_a.goto(-350, 0) paddle_a.penup() paddle_a.goto(-350, 0)
Cites user13759225 · 2020-07 · Stack Overflow · on “Receiving ValueError: invalid recstyle object”
I am following the instructions of a pygame project on youtube, this is the video [this video] , I am on the project called "Snake", and in the description of the video, you can find what time it starts and the actual code. I am about 10 minutes into the video. I will show you the code that I have written so far: # Snake project on python import math import random import pygame import tkinter as tk from tkinter import messagebox class cube(object): rows = 0 w = 0 def __init__(self, start,dirnx=1, dirny=0, colour=(255,0,0)): pass def move(self, dirnx, dirny): pass def draw(self, surface, eyes=False): pass class snake(object): def __init__(self, color, pos): pass def move(self): pass def reset(self
Cites Ube Van Grimbergen · 2021-01 · Stack Overflow · on “What do I do when I exceed maximum recursion depth in __instancecheck__ in python pong?”
I created pong with the help of a youtube tutorial [this video] , and everything works, except the ball goes really fast, and then really slow and so on. The speed of the ball is inconsistent and this makes it hard to play. I did some research and found this, How to fix inconsistent frame rate (speed) in python turtle [LINK] , I think I did what I had to do, but now the program runs for a couple of seconds, and then stops and gives this error: RecursionError: maximum recursion depth exceeded in instancecheck , what do I do? This is my code right now: import turtle window = turtle.Screen() window.title("Pong by @Ubevg") window.bgcolor("black") window.setup(width=800, height=600) window.tracer(0) #
Cites Lorena Bezerra de Almeida · 2021-05 · Stack Overflow · on “TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType' in a client file of "Rock, paper, scissors" game”
The code above is a simple "Rock, paper, scissors" game I have just finished the last tutorial from this [this video] video. I've tested the code and it is working properly when I open the server and the clients on the same laptop, but as the guy from the Tutorial said it should be able to run from other computers I tried to open a client from my sister's laptop with the server running on mine. It didn't work, the error I get is: "TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType' ". P. S. The beginning of the video explains how the game is supposed to work. And most of the comments are not important, i just write them for taking notes on the code (things
Cites Sun · 2021-10 · Stack Overflow · on “AttributeError: 'Paddle' object has no attribute 'screen'. Did you mean: '_screen'?”
I'm using Turtle, trying to learn the basics of GameDev. As I'm following the video, I got an error that the tutor didn't get. My code is basically the same, the only diference is that I'm using more OOP. Error: Traceback (most recent call last): File "C:\Users\Windows\Desktop\Jogos\Programming Languages\Python\Aulas\GameDev\Pong\pong.py", line 44, in paddle_a = Paddle('white',shape='square', coordinates=(-350, 0)) File "C:\Users\Windows\Desktop\Jogos\Programming Languages\Python\Aulas\GameDev\Pong\pong.py", line 6, in init self.shape(shape) File "C:\Users\Windows\AppData\Local\Programs\Python\Python310\lib\turtle.py", line 2776, in shape if not name in self.screen.getshapes(): AttributeErro
Cites Indian Guy · 2022-07 · Stack Overflow · on “Invalid rectstyle object”
I am following a Tutorial [this video] and cannot seem to find what I am doing wrong. I tried it multiple times while changing the value of the rect to no avail. import pygame width = 500 height = 500 win = pygame.display.set_mode((width, height)) pygame.display.set_caption("Client") clientNumber = 0 class Player(): def __init__(self, x, y, width, height, color): self.x = x self.y = y self.width = width self.height = height self.color = color self.rect = (x,y,width,height) self.vel = 3 def draw(self, win): pygame.draw.rect(win, self.color, self.rect) def move(self): keys = pygame.key.get_pressed() if keys[pygame.K_LEFT]: self.x -= self.vel if keys[pygame.K_RIGHT]: self.x += self.vel if keys[pygam
Cites Lázaro Meira · 2022-08 · Stack Overflow · on “Metadata-generation-failed error when installing Turtle on VSCode”
Ok, thanks guys, got that part about turtle being a package already existing in Python. So why can't I run Pong as in this video? -> [this video]