-
Unplugged Activity | The Big Event
-
This lesson is called "The Big Event" It's all about how
-
we can control our programs and actually change
the way a program runs on the fly, using events.
-
Like the push of a button or like the click
of a mouse. For this lesson, you'll be controlled
-
with a paper remote control. It's just like
a real live video game. An event is an action
-
that causes something to happen. It's like
when you click the button on a mouse, and
-
the web page loads. That's an event. When
you touch your screen on a tablet to scroll,
-
that's an event also. Events are a great way
of letting the user direct your program, whenever
-
they need or want to. There are things that
happen that we all respond to.
-
We feel hungry so we go to the fridge.
-
We hear the mailman
come, he puts our mail in the mailbox, and
-
then we go get our mail. Those are just like
the events of pushing a button or moving the
-
joystick. They are something that happens
that triggers us to do something. Most people
-
who program video games, there's this one
event that everyone calls "update" and it
-
happens 30 or 60 times a second. For video
game programmers, that's more important as
-
an event than the buttons or the joystick.
Because what we tend to do is, the main event
-
we're watching for is that tick happening.
And then we check the joystick in the tick.
-
So we say.. oh? Has somebody pushed the button
in this frame? Yes or no? Without events,
-
the player couldn't move. The player couldn't
jump. You wouldn't be able to control what's
-
going on. The video game wouldn't be able
to animate anything. It's only because of
-
the events of time passing that we're able
to make animations and things move.