Placeholder Image

Subtitles section Play video

  • COLTON OGDEN: Good morning.

  • Good afternoon.

  • Good evening, depending on where you are in the world.

  • My name is Colton Ogden, and this is CS50 on Twitch,

  • where we code stuff from scratch, or where I typically

  • code things from scratch.

  • If you're a first time viewer, that's what we'll be doing today.

  • We're going to be looking at the typing game.

  • So this is kind of an archetype for games.

  • It's not a very common archetype, certainly.

  • But it's a game that you may have seen implemented in such games

  • as Typing of the Dead, where you have a word in front of you,

  • and your goal is to type this word without mistakes.

  • And when you do, you do something like shoot a zombie,

  • or there are certain top down versions where you're a mage

  • and you cast spells.

  • Or you can just do it for sport and see how many points

  • you can accrue over a span of time.

  • And that's what we'll be doing today.

  • So shout outs to everybody that's in the chat already.

  • So we have a bunch of folks.

  • I'm going to go scroll up to the very top.

  • So Whipstreak was here actually from the very beginning.

  • So he says, I'm here.

  • Bhavik Knight says, hey all--

  • Bhavik Knight, a regular.

  • Whipstreak also very much a regular, but I

  • think Bhavik Knight hasn't missed a single stream, if I'm not mistaken.

  • The Korean Bot says, hello there.

  • The Quran Bot, sorry.

  • I mispronounced that.

  • TazNoor, hi everybody.

  • Hello, TazNoor.

  • Sashikant32, another regular, says hello.

  • Buddha Nag says, this is old student, with a smiley face.

  • And then later on, I believe mentioned here she was doing a final project

  • and looking for suggestions.

  • Bella Kirs, hello to you.

  • Let me just make sure I'm not missing anybody.

  • Asley, Nuwanda3333.

  • So shout outs to Asley.

  • She's responsible for this particular stream and the stream preceding it.

  • So she recommended that we do a typing game based stream.

  • And so that's what we're doing today.

  • So shout outs to her.

  • Everybody can thank Asley for her recommendation.

  • She's also recommended many other streams that we have done so far.

  • And asking Buddha Nag, who asked, you guys can suggest me a final year

  • project, please.

  • And then Asley was saying, no one can actually give you

  • an answer on your final project.

  • It needs to be something you're passionate about.

  • And I agree with that.

  • It's definitely something when you're doing

  • a final project or some sort of large project,

  • it helps to do something that is pertinent to your interests,

  • but also intersects with your area of expertise.

  • To Bhavik Knight's point, asking for, what is your expertise area, Buddha?

  • And then Bella says, you can watch the CS50 Fair

  • for inspiration, which is true.

  • Yes, we did showcase many awesome projects

  • for the CS50 Fair, which is on YouTube.

  • Kirayue says hi, CS50.

  • Hello, Kirayue.

  • Hello Shamxr.

  • I suggest having a brainstorm session, be it here or with your friends.

  • Yes, very true.

  • Brainstorm sessions are amazing.

  • I was wondering how to make an application about finding

  • teachers near us, says Buddha.

  • OK, that's an interesting use case, certainly.

  • Whipstreak says, where's my Colton at?

  • JP Guy is waving, says hello.

  • Hello, JP Guy.

  • Good to see you as well.

  • Nice rhythm, Colton.

  • Thank you.

  • I was thinking to make an app that a student will hire a teacher

  • and make an appointment near him or her.

  • Yeah, that'd be pretty cool.

  • An app like that would therefore require you

  • to have some sort of database of teachers,

  • and then maybe a separate log in system for teachers and students

  • so that they could both register and be sort of paired up with one another.

  • But that'd be very interesting.

  • I saw a project very similar to that at the Yale Fair, actually.

  • There was a student that had something similar to that.

  • So good idea.

  • [INAUDIBLE] says, hi, Colton.

  • Glad to see you.

  • Yay.

  • Hey, Colton.

  • Hey, Colton.

  • Everybody is very awesome.

  • Not for engineering.

  • It's for computer applications final year.

  • Oh, I see.

  • OK.

  • Kirayue, Colton, good to see you.

  • Sashikant, Asley.

  • I missed one CDCI.

  • Oh, right.

  • OK.

  • So just one out of 24 or 25 streams, Bhavik has missed only one,

  • the continuous integration with Travis.

  • That's OK.

  • At least you can watch the VOD thereafter.

  • But still, that's like higher than a 90% attendance rate.

  • So awesome.

  • Well, thanks everybody for joining today.

  • So let's sort of get into what we're talking about.

  • I'm going to flip over to my screen.

  • In case you're unfamiliar with what I'm going to be using to make today's game,

  • it's a framework called LOVE and a language called Lua.

  • So the framework is here, love2d.org.

  • It's an awesome 2D graphics programming framework.

  • Definitely grab it if you're not familiar with it.

  • There are other streams where I've talked about how to set it up

  • and the basics of it.

  • And today we're going to be kind of taking a lot of the principles we

  • talked about on Monday.

  • So on Monday of this week--

  • and you can watch the video on YouTube if you're watching it after the fact--

  • but we did Hangman, which is mostly textual, looking for text input

  • from the user, drawing simple shapes, and then trying to fill out a word,

  • and therefore looking at the letters of the word

  • to make sure that they match up with letters that we've already typed,

  • and so on and so forth.

  • Today we're taking some of those ideas and kind

  • of making a different game that has more of a time-based mechanic,

  • insofar as you have 60 seconds to type a word

  • or a series of words that are presented to the user.

  • And for every word you complete, you get a point.

  • And then at the end of the 60 seconds, you're

  • basically graded on how many words you successfully complete.

  • So if you did 20, 25, however many words--

  • it's not quite the same as maybe a typing test on, for example,

  • typing test or whatnot, where you can see a body of text

  • and then write it out, and then be graded

  • on how fast your words per minute would be sort of traditionally typing.

  • This is more like reactively typing, and only

  • being able to see one word at a time.

  • So it's a little bit different, a little more gamey.

  • This principle, this idea, has been used in commercial games, some pretty cool

  • commercial games, like Typing of the Dead,

  • which was a game that they recently added a new version for Windows, I

  • believe, Typing of the Dead Overkill.

  • That's what the more recent incarnation is of the game.

  • But if we look here-- and I'll try to make it nice and large--

  • this is what Typing of the Dead looked like, the original version that

  • came out circa 2000.

  • And this game basically has--

  • it's kind of like House of the Dead, which

  • is a shooter game, a arcade game where you had a light gun,

  • and you would shoot zombies as they come into the view of the screen.

  • And it was kind of tangible in that sense, in that you actually

  • had the physical gun and you're shooting at the zombies.

  • But this game doesn't require you to shoot at any zombies.

  • This game is kind of like, there are zombies coming at you,

  • and you are figuratively shooting at them by just typing words reactively

  • as they come onto the screen.

  • And so for every word that comes on that you successfully type-- in this case,

  • ping-pong and bang-bang--

  • the game will shoot the zombie for you, and treat it

  • as if you had successfully shot it.

  • And if you miss a letter, essentially the zombie will get closer to you

  • and attack you, and eventually you will lose.

  • Now, of course, to make a game like this, there's a lot of layers.

  • A full 3D game or even a 2D game that has these sort of mechanics,

  • we don't have time to do that in a single stream.

  • Instead, what we're going to do is just illustrate