Save this video free

CS50 2D - Lecture 0 - Pong

CS50 · 2:33:37 · Watch on YouTube

These notes were made with YouTube Collector. Paste any YouTube link and get the same: a summary, chapters and a searchable transcript.

Overview

CS50's Colton Ogden introduces 2D game development using Lua and the LÖVE framework, starting with a Pong implementation. The lecture covers core game development concepts like the game loop, coordinate systems, drawing shapes, handling input, collision detection, and state management, culminating in a functional Pong game with scoring and basic AI.

Key takeaways

Chapters

0:00 Introduction to CS50 2D and Colton Ogden's Background
0:26 Course Overview: From Pong to Modern Classics
5:21 Setting Up the Development Environment: LÖVE and Lua
8:04 Pong Fundamentals: Shapes, Collision, and States
9:53 Implementing the 'Day Zero Update': A Basic Window
15:06 Core Game Loop: Input, Update, and Render
20:06 2D Coordinate Systems and Basic LÖVE Functions
21:51 Creating the Initial Window and 'Hello Pong' Text
28:29 Understanding Lua's `end` vs. Parentheses for Function Calls
28:53 Implementing Retro Aesthetics: Low Resolution and Pixel Filtering
35:03 Handling Keyboard Input: Quitting with Escape
38:20 Applying Pixel Filtering and String Concatenation
44:14 Drawing Rectangles and Setting Colors
50:00 Implementing Paddles and Ball with Rectangles
54:26 Introducing Delta Time and the `love.update` Function
1:03:55 Moving Paddles with Keyboard Input
1:08:33 Clamping Paddle Movement within Screen Bounds
1:19:43 Ball Movement and Random Velocity Initialization
1:25:13 Implementing Game States: Start, Serve, Play
1:30:43 Object-Oriented Programming: Classes for Paddle and Ball
1:35:49 Class Structure: Init, Update, Render Methods
1:42:34 Adding FPS Counter and Setting Window Title
1:47:03 Collision Detection: Axis-Aligned Bounding Boxes (AABB)
1:51:57 Implementing Ball-Paddle and Ball-Wall Collisions
1:56:49 Scoring and Game States: Serve, Play, Done
2:01:51 Implementing the Serve State and Resetting Ball
2:05:54 Victory Condition and Game Reset Logic
2:09:10 Adding Sound Effects with LÖVE Audio
2:12:33 Generating and Integrating Sound Effects
2:15:13 Handling Window Resizing with `love.resize` and Push
2:21:59 Assignment 1: Implementing Basic AI for Player 2
2:23:25 Next Lecture Preview: Flappy Bird and Images

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:20 Hello world, this is CS 50's introduction to 2D game development, also known as CS 50 2D. My name is Colton Ogden, and today we'll be talking, taking a look at Pong for our first lecture. So I have a bit of a story about game development and programming. So what got me into programming to begin with many years ago was as a kid I really loved playing video games and so I decided one day to go to the bookstore and look for whatever book seemed the most appealing or the most likely to help me in my endeavor to learn video game development. And so I stumbled upon this book, even though it says 3D game programming all in one. Uh, it was kind of a an all catch all book teaching an engine called Torque which we can see an image of here, which was sort of a precursor in some sense to Unity and Unreal Engine which are popular engines nowadays,

1:11 but back then, you know, this was the first time I'd ever seen anything quite like it. And I remember very vividly opening up the book and also looking at some of the source code, and I had never really thought too much about programming up to that point or what game development really meant. I just knew that I wanted to make them. I enjoyed playing them and it was a surprise to say the least, when I opened up the book and saw dollar signs and ampersands and pipes and all these things, and it was very overwhelming to me and I ended up unfortunately I suppose tucking the book away and not really looking at it again, but. Sort of by happenstance, I was in a Barnes and Noble, not too far in the future,

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, CS50.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.