Font size
WorksheetsCode.org 8th Grade Part 2 (Conditionals and the Draw Loop)
Total questions: 53
Worksheet time: 43mins
the if(keyDown(up)) returns
a boolean value of true if the user presses the down key
a boolean value of false if the user presses the down key
A boolean value of true if the user presses the up key
A boolean value of false if the user presses the up key
In the draw loop, if you call the text function before the drawSprites and/or background function, what happens?
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.
Predict what will show up on console.log
true true true
true false false
false false false
true false true
What happens in this code?
nothing is shown, there are no sprites
the background is white and we can't see anything because the textsize is 0;
the background is white, the counter increases in size as the counter increase.
the background is white, and we see a number that goes up but the textsize stays the same.
What happens if you don't call background in your draw loop and your sprite has movement?
nothing, animation is fine.
the sprites are drawn on top of each other to simulate movement, the older drawings don't get erased.
you don't need to call background because you don't have one.
you can just use sprite.move( ) so there's no need for the function background( )
What happens if you don't call background in your draw loop and your sprite has movement?
nothing, animation is fine.
the sprites are drawn on top of each other to simulate movement, the older drawings don't get erased.
you don't need to call background because you don't have one.
you can just use sprite.move( ) so there's no need for the function background( )
In this scenario it is raining. Is the conditional true or false and what will we do in this scenario.
true, we will stay indoors
true, we will go outside
false, we will stay indoors
false, we will go outside
Which key makes the player move to the right?
The left arrow key
The right arrow key
Neither
Which values stored in lives would cause the gameOver sprite to become visible?
1
2
3
-2
0
Is the boolean expression on line 14 currently true or false?
True
False
Is the boolean expression on line 14 currently true or false?
True
False
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 is pressed?
Up
Down
Left
Right
Oh no! This code is all messed up! Read the code carefully. Which direction will the sprite go 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?
Which of these places an incorrect block into the condition for the if statement?
What would be the best natural (normal) english way to say the code shown?
bird3.scale is assigned the value of 0.25
change bird3.scale is changed by 0.25
decrease bird3.scale by 0.25
none of these
Which of these is the best match for this statement: "bird2.y is assigned 300"
Which of these is the best match for line two?
greenFish.x is counted down by 1
greenFish.x is counted down by 2
greenFish.x is counted down by 3
greenFish.x is counted up by 1
greenFish.x is counted up by 2
Is the coke sprite's rotation less than the pepsi sprite's rotation?
coke.rotation > pepsi.rotation
coke.rotation >= pepsi.rotation
coke.rotation < pepsi.rotation
coke.rotation == pepsi.rotation
coke.rotation != pepsi.rotation
Is the coke sprite's rotation greater than the pepsi sprite's rotation?
coke.rotation > pepsi.rotation
coke.rotation >= pepsi.rotation
coke.rotation < pepsi.rotation
coke.rotation == pepsi.rotation
coke.rotation != pepsi.rotation
Is the coke sprite's rotation greater than or the same as the pepsi sprite's rotation?
coke.rotation > pepsi.rotation
coke.rotation >= pepsi.rotation
coke.rotation < pepsi.rotation
coke.rotation == pepsi.rotation
coke.rotation != pepsi.rotation
Is the coke sprite's rotation the same as the pepsi sprite's rotation?
coke.rotation > pepsi.rotation
coke.rotation >= pepsi.rotation
coke.rotation < pepsi.rotation
coke.rotation == pepsi.rotation
coke.rotation != pepsi.rotation
Is the coke sprite's rotation not the same as the pepsi sprite's rotation?
coke.rotation > pepsi.rotation
coke.rotation >= pepsi.rotation
coke.rotation < pepsi.rotation
coke.rotation == pepsi.rotation
coke.rotation != pepsi.rotation
If the dinosaur's y position is greater than 200, then the dinosaur should change the costume to a pterodactyl.
None of these
If the dinosaur's y position is less than 200, then the dinosaur should change the costume to a pterodactyl.
None of these
If the dinosaur's y position is the same as 200, then the dinosaur should change the costume to a pterodactyl.
None of these
If the dinosaur's y position is not the same as 200, then the dinosaur should change the costume to a pterodactyl.
None of these
If the dinosaur's y position is greater than or the same as 200, then the dinosaur should change the costume to a pterodactyl.
None of these
Which of these matches the graph shown?
sprite.x < -1
sprite.x <= -1
sprite.x >= -1
sprite.x > -1
Which of these matches the inequality shown?
sprite.scale > 2
sprite.scale < 2
sprite.scale >= 2
sprite.scale <= 2
None of these
What does this code affect?
It affects the sprite's up and down motion
It affects the sprite's right and left motion
It affects the sprite's appearance (on a tilt, upside down, etc.)
It affects the sprite's size
What is true about this code? (pick all that apply)
It is used to put something in the grid
It is for use by the coder
It usually shows the status of a condition
Its results show up in the debug console
What is true about these codes?
They give number values to things
They change the values of counters
They perform math operations
They are used to compare
Which of these is used when you want something to happen when a certain key is pressed, but not held down?
keyDown
keyWentUp
keyWentDown
What does the top code do?
It tracks whether the mouse is moved
It tracks the motion of the mouse right or left
It tracks the motion of the mouse up or down
It tracks whether a button on the mouse is pressed
What is true about this code? (pick all that apply)
It updates two values for a sprite in a draw loop
It is made up of counters
It moves the sprite down and to the right
It moves the sprite up and to the right
What is true about this code? (pick all that apply)
It moves the sprite to the right
It moves the sprite down
It updates a specific sprite value in a draw loop
It's called a counter
What is true about this code? (pick all that apply)
It usually uses the same comparisons from a console log
It can make something happen on the grid if a condition is met
It can make something happen on the grid if a condition is NOT met
It shows "true" or "false" in the debug console
What does this code affect?
It affects the appearance the sprite (on a tilt, upside down, etc.)
It affects the size of the sprite
It affects how far up or down the sprite moves
It affects how far right or left the sprite moves
What does the sprite animation look like?
Move your sprite up
Rotate your sprite clock wise
Make your sprite grow
Move your sprite down
What does the sprite animation look like?
Move your sprite up
Rotate your sprite clock wise
Move your sprite to the right
Move your sprite down
What does the sprite animation look like?
Move your sprite to the left
Rotate your sprite clock wise
Move your sprite to the right
Make your sprite grow
(5 == 3)
True
False
(5 < = 5)
True
False
(5 > 3)
True
False
Which of the following is an example of a boolean value?
true
2
"hello"
"red"
Which of the following is an example of a sprite's rotation property?
sprite.x
sprite.rotation
rotateSprite()
sprite.around
Which of the following values can be returned by the code: randomNumber (0, 10)?
-1
3
11
10.5
Which of the following Random Number functions would return a value between 1 and 10?
randomNumber(10);
randomNumber(1, 10);
randomNumber(1-10);
random(10);
Which of the following ellipses has a width of 250 and height 100?
ellipse(100, 100, 250, 100);
circle(250, 50);
rect(100, 100, 250, 100);
ellipse(50, 100);
What would the counter pattern for losing a life in a game look like?
lives = -1;
lives = lives;
lives = lives -1;
lives = 1;
