Events with R2D2

Alphabets Sounds Video

share us on:

In this lesson, Charita Carter introduces the concept of events in programming through the creation of an interactive game featuring R2D2 and C3PO. Events serve as triggers that allow the program to respond to user actions, such as key presses or mouse clicks, enabling R2D2 to move in response to player inputs. By utilizing event-driven programming, students learn how to create engaging and dynamic gaming experiences.

Events with R2D2

Hello! 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 fun attractions you see at Disney parks. We always try to make these experiences better and more exciting by using cool technology.

Understanding Events in Programming

Now that you know some basics about programming, let’s travel back in time to create a game with two famous Star Wars characters: R2D2 and C3PO. To make this game, we need to learn about something important that game programmers use all the time: events.

Events are like instructions that tell your program to watch for certain things to happen and then do something when they occur. For example, an event could be when you click a mouse, press an arrow key, or tap on a screen. When these things happen, the program knows to take action.

Making R2D2 Move

In our game, R2D2 will have a mission. He needs to move up to deliver a message to a rebel pilot and then move down to another rebel pilot. We’ll use events to control how R2D2 moves. When the player presses the up or down arrow keys, or clicks the corresponding buttons, R2D2 will move.

To make this happen, we’ll use a “when up” event block and attach a “go up” block to it. This means that when the player presses the up arrow key, the code connected to the “when up” block will run, and R2D2 will move up. We’ll do the same thing to make R2D2 move down.

Interactive Game Design

Instead of writing all the code for R2D2’s movements ahead of time, we can let him respond to button press events. This way, he moves around the screen step by step, making your game more interactive and fun!

By using events, you can create games where characters respond to what players do, making the game more exciting and engaging. So, get ready to program your own adventures with R2D2 and C3PO!

  1. How does the concept of events in programming change your understanding of how interactive games are developed?
  2. What are some examples of events you encounter in everyday technology, and how do they enhance user experience?
  3. Reflect on a time when you interacted with a game or application. How did the use of events make that experience more engaging?
  4. In what ways do you think the use of events in programming can be applied beyond gaming to other areas of technology?
  5. How do you think the role of a creative producer like Charita Carter influences the integration of technology in entertainment?
  6. What challenges do you think developers face when designing interactive experiences that rely heavily on events?
  7. How might learning about events in programming inspire you to create your own interactive projects?
  8. What are some potential future advancements in technology that could further enhance the use of events in interactive media?
  1. Create Your Own Event-Driven Story

    Imagine you are a game designer! Write a short story where R2D2 and C3PO go on an adventure. Think about what events might happen in your story. For example, what should R2D2 do when he meets a new character? Share your story with the class and discuss how events make your story interactive.

  2. Build a Simple Game with Scratch

    Use Scratch to create a simple game where R2D2 moves up and down. Use event blocks to control his movements. Experiment with different events, like clicking the mouse or pressing keys, to see how they change the game. Show your game to a friend and explain how events work in your game.

  3. Event Hunt

    Go on an event hunt around your classroom or home. Identify different events that happen, like a doorbell ringing or a light turning on. Write down what causes each event and what happens as a result. Share your findings with the class and discuss how these real-life events are similar to programming events.

  4. Design a Board Game with Events

    Create a board game where players must complete tasks by triggering events. Use cards or dice to represent events that players must react to. Explain the rules to your classmates and play the game together. Discuss how the events make the game more exciting and unpredictable.

  5. Event-Driven Art

    Create a piece of art that changes based on different events. Use materials like paper, markers, and stickers to design a scene. Decide what happens when someone claps their hands or says a word. Present your art to the class and explain how the events change your artwork.

Hello! My name is Charita Carter. I am a senior creative producer here at Walt Disney Imagineering. I lead teams that produce the attractions our guests experience, and we are always looking for ways to improve and enhance their experience, with technology at the core of our efforts.

Now that you’ve learned the basics of programming, we’re going to go back in time to build your own game featuring R2D2 and C3PO. To create a game, we need to understand something that game programmers use every day: events. Events instruct your program to listen for specific occurrences and then perform an action when they happen. Examples of events include listening for a mouse click, an arrow button press, or a tap on the screen.

In this game, we will make R2D2 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 movement when the player presses the up or down arrow keys, or the corresponding buttons. We will use 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 will do the same to make R2D2 move down.

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

EventsActions or occurrences that happen in a program, often triggered by the user or the system. – Example sentence: In the game, clicking the start button is one of the events that begins the adventure.

ProgrammingThe process of creating instructions for a computer to follow using a specific language. – Example sentence: We learned programming by writing simple code to make a robot move forward.

GameAn interactive application designed for entertainment, often involving challenges or puzzles. – Example sentence: We created a game in class where players have to collect coins to win.

MoveTo change the position of an object or character in a program or game. – Example sentence: I used the arrow keys to move my character across the screen.

CodeA set of instructions written in a programming language that tells a computer what to do. – Example sentence: We wrote code to make the spaceship fly through space in our project.

InteractiveAllowing a user to engage and participate actively with a program or game. – Example sentence: The interactive story let us choose different paths for the characters to follow.

TechnologyThe use of scientific knowledge for practical purposes, especially in computers and electronics. – Example sentence: We used new technology to create a virtual reality experience in our computer class.

CharactersFigures or symbols used in a game or program, often representing people, animals, or objects. – Example sentence: The game had colorful characters that each had special abilities.

ActionA specific task or function performed by a program or game, often in response to an event. – Example sentence: Pressing the spacebar triggered the jump action for the character in the game.

MouseA device used to interact with a computer by pointing, clicking, and dragging on the screen. – Example sentence: We used the mouse to drag and drop blocks of code in our programming lesson.

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?