COLTON OGDEN: Hello, world.
This is CS50.
I'm Colton Ogden, and
I'm here to introduce you
to the games track of CS50, where
we'll be taking a look at how
to code interactive games as opposed
to maybe some of the CSI stuff
or the Python stuff that
you've coded so far.
Or even if you've coded any
websites thus far in the course,
likely it has not really
touched upon game development
as it's traditionally known.
And we'll specifically be
looking at Pong and Mario.
And we did actually cover
Mario in CS50 in PSet 1,
where you were asked to implement
a pyramid of hash marks.
Interestingly enough,
we'll tie back to that.
When we get to the Mario
section of the games track,
we'll end up actually coding
a pyramid using tiles the way
that it was actually coded,
more or less, in Mario itself.
And as you can see here on the
title slide, Pong on the left, Mario
on the right.
Pong and Mario are two very iconic
games Pong earlier than Mario,
Pong considered sort of to be
the grandfather of video games,
Mario kind of like the younger
grandfather of video games.
They were both released
in the '70s and the '80s,
even though there were
games before them.
But choosing them specifically because
they're very simple to understand
and to develop a basic version
of, on top of being very iconic.
So the first game will end up looking
at in the games track is Pong.
And Pong, as you can see, is very
sort of simple, austere almost,
game aesthetic.
It's got two paddles on
the left and the right,
which moved up and down,
player one and player two.
You have a ball in the center,
and the goal is very simple.
Just hit the ball back to your opponent.
Don't let the ball get past
your side of the arena.
And you as you can see, there's a
score on the left, on the right,
in the center of the screen.
And we'll take a look
at all the pieces there,
how to draw the shapes and
the text and all that stuff.
Even you can see there's
text at the very top as well.
So we're not just drawing
shapes and images.
We're actually also drawing text,
which you've done at the CLI,
but we'll see it's a little bit
different in the context of game
development.
Some of the topics we'll be
looking at in the context of Pong
are, well, first of all, we
need a programming language
to do all this work in.
So far you've used C, you've
used Python, probably, maybe even
a little bit of the web with HTML,
JavaScript, that sort of thing.
But we'll look at Lua because Lua, and
specifically in the context of a game
framer called LOVE, is very
easy and accessible to get up
and running with right out the gate.
And it's very clean.
We'll see that as we get into the track.
We'll take a look, obviously,
at how to get things
onto the screen, which is the most
obvious apparent thing to begin with,
drawing shapes, drawing text.
We'll look at what delta time
means, what velocity means.
These two things are
very important when you
have games that have things
moving around on the screen.
We'll look at game state, whether we're
serving the ball, whether somebody
has scored 10 points and
it's game over, whether it's
the very start of the game.
Those are all game states.
We'll take a look at how
to transition between them.
We'll look at basic object
oriented programming,
which you may have seen so far in
your studies, probably not so far
in the course.
But as you'll see in the context of
game development and in future courses,
object oriented programming is
extremely prevalent and very good
to get at least a very basic grasp
on, if not a super deep dive.
We'll need to know how to
actually collide things together.
So box collision, this case.
Axis aligned bounding
boxes, as we'll see, AABB.
We'll get into that a little bit later.
And lastly, to polish off the title of
Pong, which is already simple enough,
but just a little
flavor, is sound effects.
So when the ball hits the paddle,
when we score, that sort of thing,
it adds just a little bit of spice and
polish to the game to make it nice.
Once we've finished with Pong, we'll do
something a little bit more refreshing,
a little bit more visually interesting.
We'll look at Mario.
And obviously we're using
a different tile set here,
but the exact same premise of Mario.
If unfamiliar, Mario
is a platforming game.
Specifically, Super Mario
Brothers is the game
that we'll be taking inspiration from.
You play as a little avatar.
Down here we have a little blue alien.
You can move around a world with
bricks and little columns and blocks,
and there's clouds in the sky
and all those sorts of things.
And we'll look at actually how to
generate those levels from scratch
without having to code it ourself.
As we get into the Mario topics
here, one of those topics,
even, is procedural generation
there at the very bottom, a topic
that I'm very much interested in.
But more foundationally, we'll look
at sprite sheets and raster graphics,
so how to actually take a
texture that we've written,
let's say, in Photoshop
or Gimp or Aseprite.
We've saved it as a PNG file, and
we want to import it into our game,
chop it up into the pieces
that make sense to us,
and then draw them on the
screen at relevant times.
Tile map is a concept that
we'll look at that actually
lets us represent our game world
as sort of a series of numbers
which then gets drawn onto the screen.
Then those numbers sort of map back
to those tiles that we spliced out
of our sprite sheet.
We'll look at gravity because
in a platforming game,
you have avatars that jump around.
We need to know how to
actually make them jump up
and then fall back down in a way
that's natural and makes sense.
And then we'll look at animation as
well so that our character not is just
moving around as a static sprite, but
is actually walking as they move around,
and they have a jump
animation, that sort of thing.
All this and much more as we take
a look both at Pong and at Mario.
And I'm very excited to
show this all to you.
And I'll see you in the next video.
