Save this video free

CS50 2D - Lecture 1 - Flappy Bird

CS50 · 2:01:09 · 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 Flappy Bird lecture introduces 2D game development concepts using Lua and LÖVE 2D, building a Flappy Bird clone. Key topics include sprite rendering with `love.graphics.newImage`, parallax scrolling via modulo arithmetic, object-oriented programming with classes for game entities like birds and pipes, gravity simulation, input handling (keyboard and mouse), procedural generation of infinite pipe pairs, collision detection using AABB, state machines for managing game flow (title, play, score, countdown), and integrating sound effects and music. The lecture emphasizes code organization and modularity through states and object-oriented design.

Key takeaways

Chapters

0:00 Introduction to Flappy Bird and Course Concepts
0:47 Flappy Bird Gameplay Demonstration
10:47 Loading and Drawing Images with `love.graphics.newImage`
19:07 Implementing Parallax Scrolling for Depth Illusion
25:36 Scrolling Textures with Modulo Arithmetic
32:35 Creating a Bird Entity with Object-Oriented Programming
38:45 Understanding Lua's Colon Syntax for Method Calls
40:44 Simulating Gravity with a Constant Downward Velocity
50:14 Implementing the Jump Mechanic (Anti-Gravity)
55:41 Custom Input Handling with `love.keyboard.wasPressed`
1:07:21 Generating Infinite Pipes with a Timer and Table
1:14:05 Iterating and Removing Off-Screen Pipes
1:30:51 Creating Pipe Pairs with Top and Bottom Pipes
1:43:22 Rendering Flipped Pipes with Y-Axis Offset

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

Transcript excerpt

0:20 Hello world. This is CS 52D. Welcome back. This is Lecture one, Flappy Bird. So we're doing the zero indexed approach to the course titles. Last time we did Pong, which was a bit of an older title from the 70s, and this week we're going to be exploring something a little bit newer. Maybe a lot of folks actually got the chance to play it themselves back around 2013 or so called Flappy Bird, which kind of had a bit of a controversy around it as well, related to, I believe the pipe graphics had been stolen, something to that effect. Um, but a lot of people for a brief period of time were really enjoying it. I got hooked into it as well. I was playing it for a little while. I wasn't very good at the game. I don't remember. I had friends who were very, very enthusiastic about it, but this week, thankfully, Flappy Bird is a simple enough example that it allows us to sort of evolve from Pong because last time when we were looking at Pong,

1:08 it was just essentially shapes, rectangles, and just, you know, white and an off black color, but this week we want to actually begin looking at a lot more interesting things. Things that will take us to not just shapes but rather things that are 2D artwork that move around on the screen, namely with what we also alluded to last lecture, which are sprites. And so a sprite and an image are kind of interchangeable. Sprite is essentially typically an image that will move around on screen, and people, when they think Sprite, they'll think of, oh, a character graphic or maybe. Fireball or something versus what might be a background texture or the like, but we'll be looking at images and sprites.

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.