Main content
Hour of Code
Course: Hour of Code > Unit 1
Lesson 1: Drawing with code- Welcome to our Hour of Code™!
- Learning coding on Khan Academy
- Making drawings with code
- Quick tip: number scrubbing
- Challenge: Simple snowman
- Drawing more shapes with code
- Challenge: Waving snowman
- Coloring with code
- Quick tip: color picking
- Challenge: Sunny snowy day
- Quick tip: Use the docs!
- Pick a drawing project!
- Project: Super snowman
- Project: Wild animal
- Project: Self portrait
- Code beyond the hour
© 2023 Khan AcademyTerms of usePrivacy PolicyCookie Notice
Welcome to our Hour of Code™!
The 'Hour of Code' is a nationwide initiative by Computer Science Education Week and Code.org to introduce millions of students to one hour of computer science and computer programming. Created by Pamela Fox.
Want to join the conversation?
- If i am correct we can make are own games and learn how to draw ?(165 votes)
- Yes. To make complex pictures, though, you will need lots of practice. And games are even more complex. Your characters must be programmed to move and you will need to program how the game responds to a certain button.Games like Minecraft took years to code. If you can put enough effort into it, you can do the same.(101 votes)
- How do u make games in KA with coding because I can code but that's only on my Kano coding computer but I just don't get the game making part about coding.(48 votes)
- Much of making a game will come down to being creative with the programming tools you know, and being willing to search out new tools to solve the problems you come across as you try.
Much of creating a game is not in the coding but in coming up with the idea for the game.
The best advice I think I can give is this: determine what you want to do in the game then break it up into smaller tasks. create individual programs that tackle each of these tasks and then incorporate the parts back into a larger program.
for example.I want a top down shooter game where enemies attack from all sides and I want there to be loot that upgrades my character as he progresses through the game. I want to control the characters movement with the keyboard and shoot with the mouse.
So lets break it down into smaller tasks. I will need to:
1) Make the program react when I click the mouse
2) Make the program react when I push a key on the keyboard
3) Animated a shape on the screen
4) Make the shape move when I push a key
5) make enemies that act independently according to rules I outline. like follow a mouse pointer
6) Add animated objects when the mouse is clicked.
7) create a collision mechanism the determines when two objects hit one another. to use to check for bullet strikes or a character grabbing upgrades
8) figure out how to remove enemies that have been killed and add to my experience or score
9) make objects appear from fallen enemies for my character to grab and get stronger
10) Create a user interface that includes difference scenes like a start scene and a play scene and an end game scene.
.
.
.
You will learn TONS as you create these programs and then you can begin patching this all together into a functional game.(126 votes)
- Well as of a few weeks ago, you have to complete a coding challenge.(5 votes)
- How do you color(18 votes)
- use this:
fill(0, 0, 0)
the first number is for red the second is for green and the third is for blue.
fill(255, 0, 0) will make complete red
fill(0, 255, 0) will make complete green
fill(0, 0, 255) will make complete blue(40 votes)
- What does coding do(14 votes)
- Coding helps you make a website or a better environment online. It will most likely be the thing that helps us achieve the most in this generation.(5 votes)
- where u can find the challenges?(10 votes)
- On your left you will see the challenges but your on a video "Welcome to oir Hour of CodeTM!"
The first challenge is Simple Snowman.
The Challenge icon is a star
so if you click on that,it will teleport you to the challenge.(10 votes)
- I was wondering if this could help teach me coding for robotics? I am using Parallax Boe-Bots to code for.(11 votes)
- Knowing how to code in general (which you'll learn here) will help you with learning to code more specific things.
But I don't know how much it will help with Parallax Boe-Bots. It looks like more hardware than software. You may be better off learning those tutorials.
That doesn't mean you can't learn both, of course. ;)(15 votes)
- How do you get help on projects that have no right?(7 votes)
- If you need help, please post questions on the "Help Requests" tab below the coding frame. Posting in "Help Requests" allows members of the Khan Academy community to view your code.(13 votes)
- Which is more complicated, Java or JavaScript?(6 votes)
- Any subject can be complicated when you are first learning. There are concepts - like variables, loops, and branching - that are common to many programming languages. Typically, you would learning these concepts when you learn your first programming language, which can make learning that first language seem more difficult.
When you can apply these concepts to the next programming language that you learn, it can make learning that second language a little easier.(5 votes)
- so coding has to do with?(5 votes)
- Coding is the way to talk to computers and get them to do things for you. Without code, your computer wouldn't do anything at all.(13 votes)
Video transcript
- [Voiceover] Heyyaz! I'm Pamela, from the Khan Academy team. So you're here for Hour of Code, right? That's awesome! I can still remember my
first hour of coding, when I was a little kid, and now I'm on my 10,000th hour of coding, and it's still really, really fun. There are tons of ways to learn to code, and there's so many things
you can do with code, like making games, if you like PAC-MAN, or Angry Birds, or Minecraft, or, if you like Science,
you can use programming to visualize the way the Universe works and help other people
understand it better. If you like Medicine, you
could help doctors understand what's going inside the human body, because it's really crazy. You could make robots,
like self-driving cars. You could analyze data. You could make websites like Khan Academy. There's so much you can do. Here, on Khan Academy, you'll
spend your Hour of Code learning to make
computer-generated drawings. We can't cover that
much in so little time, but we hope you're excited
by your first taste of code and wanna go deeper. Here's what you'll do in the next hour. First, you'll watch these
interactive talk-throughs. They're kind of like
videos, where we write code and we talk while we're writing it, and you can see the result of
the code on the right side, and you can pause it, just like a video. But, even better than a
video, you can actually edit the code that we've written and see what happens when you change it, and then you can turn it back
on when you wanna keep going. Now, remember, there's audio, so make sure you have speakers or headphones on when you're watching these. Next, you'll do a coding challenge. This is how you practice
what you just learned, and earn points for completing it, going through each of the
steps until you get them done. Try to get through each
challenge to the end, but, if you don't, and
you're getting frustrated, don't worry, just keep going
to the next talk-through. Finally, at the end,
you'll do a more free form creative project, where
there's no right answer and the point is just to have fun while using what you've learned. And, hey, if this takes
you longer than an hour, that's totally okay with us. Here, at Khan Academy, we believe that everybody
should learn at their own pace. We'll always be here for
you to keep learning, no matter how long it takes. Ready to get started?! Let's have a Coding Party! Woo-hoo!