ICT Digital Tools - Programming & Logic Chapter 5
Kiera is writing the code for a new video game. She is creating a character who waves to other characters. Every time the game player says "hello" to the character (by pressing the "H" key), the character waves back. The code to make the character wave is very long, so Kiera decides to name the segment of code WAVE. Now every time she needs the wave series of code she simply inputs WAVE. What has Kiera created?
A function
You have written a segment of code that includes the instructions to make a character jump. Your program will need to use these instructions multiple times. To save yourself the trouble of writing the code over and over again, you decide to name this section of code JUMP and then call the section of code using only the name JUMP. What type of programming component is JUMP?
A function
Katherine is creating a computer program that will allow the cursor to jump to a different location when the mouse is clicked on a certain image. Which programming component should Katherine use to tell the program what to do when the mouse is clicked on the image?
An event handler
Omar is creating a video game. He wants his character to jump when the spacebar is pressed. Which programming component should Omar use to tell the program what to do when the spacebar is pressed?
An event handler