Font size
WorksheetsCode.org Discoveries Conditional Blocks
Total questions: 20
Worksheet time: 10mins
Predict what will show up on console.log
true true true
true false false
false false false
true false true
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 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.
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
Conditionals let your program
Repeat code to increase efficiency
Make decisions to follow a different path
Run in the right order
Give a set of commands a custom name
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
The isTouching block may be new to you but if it works in if-then statements as the condition, then it must return a ______.
Boolean
String
Number
Bovine
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?
