Well, hello, my name is Charita Carter. I'm
a senior creative producer here at Walt Disney
Imagineering. I'm responsible for leading
teams that actually produce the attractions
that our guests get to experience. We are
always looking for ways that we can improve
and make a better experience for our guests
and technology is at the heart of that.
Congratulations, you did it! You programmed
BB-8. Now I think we're ready for something
harder. Let's go for it. Now that you've learned
the basics of programming, we're going to
back in time to build your own game, starring
R2-D2 and C3PO. To make a game, we need to
learn about something that game programmers
use every day: they're called events.
Events tell your program to listen or wait
for when something happens and then when it
does, it performs an action. Some examples
of events are listening for a mouse click,
an arrow button or a tap on the screen. Here
we're going to make R2-D2 move up to deliver
a message to a rebel pilot and then move down
to the other rebel pilot.
We'll use events to make him move. When the
player uses the up/down arrow keys, or the
up/down buttons. We use the when up event
block and attach the go up block to it. When
the player presses the up arrow key, the code
attached to the when up block is run. And
we'll do the same thing to make R2-D2 move
down.
Now instead of writing all the code to control
our droid in advance, we can let R2-D2 react
to button press events that move him around
the screen. Step by step, your game is getting
more interactive.