Font size
WorksheetsInteractive Games & Animations Quiz
Total questions: 55
Worksheet time: 55mins
A part of a program that does not work correctly.
Bug
Debugging
Program
Variable
Finding and fixing problems in an algorithm or a program.
Bug
Debugging
Variable
Parameter
An algorithm that has been coded into a form that can be run by a machine.
Bug
Debugging
Program
Parameter
An extra piece of information passed to a function to customize it for a specific need.
Bug
Program
Parameter
Variable
A placeholder for information that can change.
Program
Parameter
Variable
Debugging
A graphic character on the screen with properties that describe its location, movement, and appearance.
Animation
Sprite
A series of images that create the illusion of motion by being shown rapidly one after another.
Animation
Sprite
How are shapes displayed on the screen?
with alphabet letters
with X and Y coordinates
using a touch screen
with width and height values
What is the origin of a square or a rectangle?
The bottom right corner
The bottom left corner
The top right corner
The top left corner
What is the origin of a circle or an ellipse?
The bottom left corner
The center
The bottom right corner
The top
In this line of code:
rect(250, 100);
Which number is the y value?
rect
250
100
In this line of code: rect(250, 250, 100, 50); what do 100 and 50 represent?
The x and y values
The w and h values
Which command matches this block of code?
Draws an ellipse while keeping the height-to-width ratio the same.
Shrinks or grows a sprite while keeping the height-to-width ratio the same.
Draws a rectangle while keeping the height-to-width ratio the same.
In which direction will the sprite move?
bee.y = bee.y + 2
left
right
up
down
Which sprite property would you change to move the sprite from left to right?
sprite.x
sprite.y
sprite.scale
sprite.rotation
Which sprite property would you change to make the sprite turn in a circle?
sprite.x
sprite.y
sprite.scale
sprite.rotation
The program below attempts to draw a crab with a blue background. What change needs to be made so that it works correctly?
Move background("blue"); to the end of the program.
Move drawSprites(); to the end of the program.
Rename the variable sprite to crab.
No change, the program already works.
Describe what will happen in the following program.
When the right mouse button is pressed, the sprite moves to the right. When the left arrow key is pressed, it rotates.
When the left mouse button is pressed, the sprite rotates. When the right arrow key is pressed, it moves to the right.
When both the left mouse button and right arrow key are pressed, the sprite rotates and moves to the right.
When the left mouse button is pressed, the sprite rotates. When the right arrow key is pressed, it moves to the right. When the left arrow key is pressed, it moves to the left.
Which program will draw the image below?
Consider the following program. What will be the value of score at the end of this program?
0
1
5
6
Match each line of code with its explanation.
fries.scale = 0.6;
Set the scale of the fries sprite to 0.6
fries.x = 100;
Move the x position of the fries sprite
fries.y = 50;
Move the y position of the fries sprite
fries.rotation = 45;
Rotate the fries sprite.
MatcMatch each parameter of the rect() block with it's purpose: rect(parameter1, parameter2, parameter3, paramter4);
Hint: the following program draws the scene on the right.
parameter1
x
parameter2
y
parameter3
width
parameter4
height
What is the correct way to change the background color to green in the program below?
background("green");
setBackground("green");
changeBackground("green");
bgColor = "green";
How can you make the sprite rotate continuously in the draw loop?
sprite.rotation = sprite.rotation + 1;
sprite.rotateContinuously();
Which line of code would you add to make the square move to the left?
square.x = square.x - 2;
square.x = square.x + 2;
square.moveLeft();
square.moveRight();
How can you make the sprite grow continuously in the draw loop?
sprite.scale = sprite.scale + 0.01;
sprite.grow();
sprite.scale = sprite.scale - 0.01;
sprite.growContinuously();
Which keyboard key do you need to press to move the sprite?
x
y
up arrow
space
Which line of code creates a sprite?
Line 1
Line 2
Line 8
Line 9
Match the code with the output
What will happen when this code is run?
The balloon will move down if the down arrow is pressed; otherwise, it will move up.
The balloon will move up if the up arrow is pressed; otherwise, it will move down.
The balloon will move down if the mouse is down; otherwise, it will move up.
The balloon will move up if the mouse is down; otherwise, it will move down.
Match the code to the correct direction the sprite will move using the keyboard.
Move Up
Move Down
Move Left
Move Right
Predict what will be shown in the console.log statements.
true true true
true false false
false false false
true false true
In the draw loop, what happens if you call the text function before the drawSprites and/or background functions?
You won't be able to see your text because the sprites and background will be drawn on top of the text.
You will be able to see your text because Game Lab knows you want to see the text.
You won't be able to see your sprites or background because order doesn't matter.
You will be able to see your text because the sprites and the background will be drawn after the text.
Boolean Expression
A single image within an animation.
A single value of either TRUE or FALSE.
A piece of code that you can easily call over and over again.
Finding and fixing problems in your algorithm or program.
Conditionals
Any valid unit of code that resolves to a value.
A single image within an animation.
Statements that only run under certain conditions.
Any valid unit of code that resolves to a value.
If-Statement
The common programming structure that implements "conditional statements".
Attributes that describe an object's characteristics.
An algorithm that has been coded into something that can be run by a machine.
Part of a program that does not work correctly.
Which key moves the player to the right?
The left arrow key
The right arrow key
Neither
Is the boolean expression on line 14 currently true or false?
True
False
Oh no! This code is all messed up! Read the code carefully. Which direction will the sprite go if the up arrow key is pressed?
Up
Down
Left
Right
Oh no! This code is all messed up! Read the code carefully. Which direction will the sprite move if the down arrow is pressed?
Up
Down
Left
Right
Which of these increases the values of clicks when the space key has been released?
The ellipse block will plot a circle at the x and y coordinates it is given.
What is this line of code?
ellipse
rect
The _ block plots a square at the x and y coordinates it is given.
ellipse
rect
fill
background
Labels cannot contain spaces.
True
False
Labels cannot begin with a number.
True
False
Labels are not case sensitive.
True
False
The rate at which frames in an animation are displayed, typically measured in frames per second.
property
frame
frame rate
animation
The common programming structure that implements "conditional statements" is:
If-Statement
Boolean Expression
Boolean
A generic term for code that alters program flow based on true/false values (like an if statement).
Program
Conditional
_ is a statement that evaluates to a Boolean value (either true or false).
Sprite
Boolean Expression
In programming, an expression that evaluates to true or false.
Boolean
Boolean Expression
Boolean Value
Which line of code should you add to make the circle move upward?
circle.y = circle.y - 2;
circle.y = circle.y + 2;
circle.moveUp();
circle.moveDown();
A student wants to make a sprite appear. The student begins with "var sprite = createSprite(200, 300)". What is the next step?
Add a "drawSprites" command
Add a "sprite.setAnimation" command
Add a "sprite.x" command
Add a "sprite.y" command
Which command is necessary to make a sprite move across the screen from right to left?
if then
sprite.x = sprite.x + 2;
sprite.x = sprite.x - 2;
sprite.y = sprite.y + 2;
Match the block code to the correct description.
A plane moves up and a jet moves across the screen.
A blue sky and two planes are created without motion.
A plane moves across and a jet moves up.
The plane and the jet move together across the screen.
