Hey there! Have you ever wondered what it’s like to work on Minecraft? Well, Stacy is about to find out! She meets Katie, who works as a developer on the Minecraft marketplace team. Katie knows a lot about coding and has worked with over a dozen coding languages. That’s a lot!
Stacy is curious about a little character called “the Agent.” Katie explains that the Agent can do things that Steve or Alex, the main characters in Minecraft, can’t do. For example, the Agent can cross lava safely. How cool is that?
Stacy wants to learn how to code, and Katie is ready to help. One of the first things you need to know when learning to code is how to use loops. But what are loops? Loops are commands that tell the computer to do something over and over again. This makes coding much easier because you don’t have to write the same command many times.
In the next level of the game, you can use a loop to move the Agent along a path. Here’s how you do it: drag the “repeat” block into the workspace and place the “move forward” block inside it. This tells the computer to move the Agent forward several times without dragging a lot of blocks. You can decide how many times the Agent moves by putting a number in the repeat block. You can also add turns and other commands inside the repeat block. If you get stuck, just hit the blue “reset” button and try again!
If you’re interested in having a cool job like Katie’s, click the “show code” button when you finish each level. This will show you the JavaScript code that developers like Katie use to program Minecraft. It’s a great way to see what real coding looks like!
Stacy thanks Katie for her help, and Katie wishes everyone good luck. Now it’s your turn to try coding with loops in Minecraft. Have fun and keep learning!
Design a simple maze on paper and use a pencil to represent the Agent. Write down the steps needed to navigate through the maze using repeat loops. Share your maze with a classmate and see if they can solve it using loops!
Create a dance routine for the Agent using repeat loops. Choose a series of movements, like “move forward,” “turn left,” and “turn right,” and decide how many times each should repeat. Perform your routine for the class!
Work in pairs to create a race track on the playground. Use chalk to draw the path and decide how many steps or turns are needed. Use repeat loops to write down the steps for your Agent to complete the race. The first team to finish wins!
Use repeat loops to create a piece of art. Choose a simple shape, like a square or triangle, and repeat it to form a pattern. Use colored pencils or markers to bring your loop art to life. Display your artwork in the classroom!
After completing a level in Minecraft Hour of Code, click the “show code” button to see the JavaScript code. Try to identify the repeat loops in the code. Discuss with a partner what each part of the code does and how it relates to the blocks you used.
**Sanitized Transcript:**
**Stampy:** I wonder what Stacy is up to?
**Stacy:** Woah, I think I’m in the right place. This is amazing! I feel like I’m back in Minecraft! Hello. How are you? Hello? Oh, there’s a creeper. You don’t do anything, do you?
**Katie:** Stacy?
**Stacy:** Hi, Katie?
**Katie:** Yes! Welcome to Minecraft.
**Stacy:** Thank you!
**Katie:** Come on in!
**Stacy:** This is amazing. So you work here every day as a developer, right?
**Katie:** Yeah, it’s pretty awesome. I’m a developer on the Minecraft marketplace team.
**Stacy:** How many coding languages do you know?
**Katie:** In my career, I’ve probably worked with over a dozen.
**Stacy:** A dozen?
**Katie:** Yeah.
**Stacy:** So now, you wouldn’t happen to know anything about this little golem guy that calls himself “the Agent”?
**Katie:** We use the Agent to do things that Steve or Alex can’t, like go across lava.
**Stacy:** Well, I want to learn how to code, and they want to learn how to code, so what is one of the first things that you need to know when you’re learning?
**Katie:** Well, you need to learn how to use loops.
**Stacy:** Ok.
**Katie:** Loops are things that developers write to give commands to a computer that can be run over and over again.
**Stacy:** Got it, so I think there’s actually some of that coming up in the levels ahead, so go ahead and give loops a try. In the next level, you can use a loop to move the Agent along the path. Drag the repeat block into the workspace and place the move forward block inside the repeat block. This tells the computer to do the same thing many times in a row without having to drag a whole bunch of blocks into the workspace. You can choose how many times to repeat by putting a number in the repeat block. You can put turns and multiple commands in the repeat block too, but for now, try using a repeat to move the Agent forward a few steps. Remember, if you get stuck on a puzzle, you can always hit the blue “reset” button and try again. If you are thinking about having a cool job like Katie’s, go ahead and click the “show code” button when you finish every level. That’s going to actually show you the JavaScript code that someone like Katie uses when she’s actually programming Minecraft.
**Stacy:** So anyway, thank you so much!
**Katie:** Yeah, good luck everyone!
Minecraft – A popular computer game where players can build and explore virtual worlds made of blocks. – Example sentence: In Minecraft, you can use coding to create amazing structures and automate tasks.
Coding – The process of writing instructions for a computer to follow. – Example sentence: We learned the basics of coding by creating a simple game in class.
Loops – A sequence of instructions that repeats until a certain condition is met. – Example sentence: We used loops in our program to make the character jump continuously.
Agent – A character or program that performs tasks in a virtual environment, often in games or simulations. – Example sentence: In the coding game, my agent helped me collect resources automatically.
Computer – An electronic device that processes data and performs tasks according to a set of instructions. – Example sentence: We used a computer to write and test our coding projects.
Commands – Instructions given to a computer or program to perform specific actions. – Example sentence: By typing the right commands, we made the robot move forward and turn left.
Repeat – To do something again, often used in coding to execute the same set of instructions multiple times. – Example sentence: We used the repeat command to make the character dance in the game.
Move – To change position or location, often used in coding to control characters or objects. – Example sentence: I wrote a program to make the sprite move across the screen.
JavaScript – A programming language commonly used to create interactive effects on websites. – Example sentence: We learned how to use JavaScript to make buttons change color when clicked.
Developer – A person who creates computer programs or applications. – Example sentence: My dream is to become a developer and create fun and educational games.