Star Wars with Blockly – Hour of Code: Events

Alphabets Sounds Video

share us on:

In this lesson, Charita Carter introduces the concept of events in programming, emphasizing their importance in creating interactive games. Students learn how to use events to control R2-D2’s movements in a Star Wars-themed game by responding to player inputs, such as arrow key presses, making the gameplay more engaging and dynamic. The lesson encourages experimentation and creativity in game development.

Star Wars with Blockly – Hour of Code: Events

Hey there! I’m Charita Carter, and I work as a senior creative producer at Walt Disney Imagineering. My job is to lead teams that create the amazing attractions you see at Disney parks. We always try to make these experiences better, and technology is a big part of that.

Great job on programming BB-8! Now, let’s take things up a notch. You’ve learned some programming basics, and it’s time to travel back in time to create your own game featuring the famous Star Wars droids, R2-D2 and C-3PO.

Understanding Events in Programming

To make your game, you need to learn about something called “events.” Events are super important in programming, especially for games. They let your program watch for certain actions and then do something when those actions happen. For example, events can be things like clicking a mouse, pressing arrow keys, or tapping on a screen.

Making R2-D2 Move

In our game, we want R2-D2 to move up to deliver a message to a rebel pilot and then move down to another pilot. We’ll use events to make him move. When the player presses the up or down arrow keys, we’ll use a special block called “when up” to make R2-D2 go up. This block is like a command that tells R2-D2 what to do when the up arrow is pressed. We’ll do the same thing for moving him down.

Interactive Game Building

Instead of writing all the code at once to control R2-D2, we can make him respond to button presses. This way, he can move around the screen based on what the player does. Step by step, your game becomes more interactive and fun!

By using events, you can create games that respond to what players do, making them exciting and engaging. Keep experimenting and have fun creating your own Star Wars adventure!

  1. How did Charita Carter’s role as a senior creative producer at Walt Disney Imagineering influence your understanding of the integration of technology in creating immersive experiences?
  2. Reflect on your experience programming BB-8. What challenges did you face, and how did you overcome them?
  3. What new insights did you gain about the importance of events in programming, particularly in game development?
  4. How do you think the concept of events can be applied to other areas of technology or everyday life?
  5. Describe your thought process when designing the movement of R2-D2 in the game. What strategies did you use to ensure smooth and responsive gameplay?
  6. In what ways did building an interactive game enhance your understanding of programming concepts?
  7. How do you plan to apply the skills and knowledge gained from this activity to future projects or learning opportunities?
  8. What aspects of creating a Star Wars-themed game did you find most enjoyable, and why?
  1. Event Scavenger Hunt

    Explore your surroundings and identify different events that occur in everyday life. For example, when you flip a light switch, the light turns on. Write down at least five events and describe what triggers them. Share your findings with the class to see how events are all around us!

  2. Blockly Maze Challenge

    Use Blockly to create a simple maze game where you control a character using arrow keys. Set up events to move your character through the maze. Challenge your classmates to complete your maze and see who can do it the fastest!

  3. R2-D2 Dance Party

    Program R2-D2 to perform a dance routine using Blockly. Use events to make him move in different directions when specific keys are pressed. Add music and invite your classmates to join the dance party by controlling R2-D2’s moves!

  4. Design Your Own Droid

    Draw and design your own Star Wars droid on paper. Think about what events you would program for your droid. Share your design with the class and explain how your droid would interact with the world using events.

  5. Interactive Storytelling

    Create a short interactive story using Blockly, where the reader can choose different paths by clicking buttons. Use events to change the story’s direction based on the reader’s choices. Share your story with a friend and see how their choices affect the outcome!

Sure! Here’s a sanitized version of the transcript:

Hello, my name is Charita Carter. I’m a senior creative producer at Walt Disney Imagineering. I lead teams that produce the attractions our guests experience. We are always looking for ways to improve and enhance the guest experience, and technology plays a key role in that.

Congratulations on programming BB-8! Now, let’s take it a step further. Having learned the basics of programming, we’re going to go back in time to create your own game featuring R2-D2 and C-3PO.

To create a game, we need to understand a concept that game programmers use every day: events. Events allow your program to listen for specific actions and then perform a corresponding action when those events occur. Examples of events include mouse clicks, arrow button presses, or taps on the screen.

In this game, we’ll make R2-D2 move up to deliver a message to a rebel pilot and then move down to another rebel pilot. We’ll use events to control his movements. When the player uses the up or down arrow keys, we’ll employ the “when up” event block and attach the “go up” block to it. When the player presses the up arrow key, the code linked to the “when up” block will execute. We’ll do the same for R2-D2’s downward movement.

Instead of writing all the code to control our droid in advance, we can allow R2-D2 to respond to button press events that move him around the screen. Step by step, your game is becoming more interactive.

Let me know if you need any further modifications!

ProgrammingThe process of creating instructions for a computer to follow. – Sarah enjoyed programming because she could make her own computer games.

EventsActions or occurrences that a computer program can respond to. – In the game, clicking the mouse triggers different events like jumping or running.

GameAn activity or program designed for entertainment, often involving challenges or puzzles. – Alex created a game where players have to solve math problems to advance to the next level.

MoveTo change the position of an object on the screen. – In the coding project, you can move the character by pressing the arrow keys.

MouseA device used to point and click on items on a computer screen. – Using the mouse, Jenny selected the icon to open her favorite drawing program.

KeysButtons on a keyboard that are used to type or control a computer program. – By pressing the spacebar key, the character in the game could jump over obstacles.

ScreenThe part of a computer that displays images and text. – The screen showed a colorful animation when the program started.

InteractiveAllowing a user to engage and participate actively with a program. – The interactive story let the reader choose what happens next by clicking on different options.

CodeA set of instructions written in a programming language that a computer can understand. – Emma learned how to write code to make a robot move forward and backward.

FunEnjoyable and entertaining. – Learning to code was fun because it felt like solving a puzzle and creating something new.

All Video Lessons

Login your account

Please login your account to get started.

Don't have an account?

Register your account

Please sign up your account to get started.

Already have an account?