NEW
Font size
WorksheetsCookiesnitch
Total questions: 20
Worksheet time: 10mins
Which line in the code creates a variable that tracks the player’s score?
speed = 5
count = 0
score = text(count,550,1000,'orange',75)
toy = stamp('flying cookie',70,move)
What is the purpose of the drag() function?
To make the bat move
To let the player move the toy by dragging it
To increase the game speed
To detect collisions
What does the variable speed most likely control in the game?
How fast the toy rotates
How quickly the bat moves toward the player
The number of points per cookie
How fast the score updates
Which function is called repeatedly to keep the game running?
drag()
lose()
loop()
gotcha()
What event triggers the gotcha() function?
When the bat moves off the screen
When the toy is dragged
When the bat hits the toy
When the score reaches 20
What happens inside the gotcha() function?
The game ends
The cookie changes, the score increases, and speed gets faster
The bat resets to the top of the screen
The toy disappears permanently
Which of the following is an example of a conditional statement in the code?
speed = speed + 10
count = count + 1
if (net.hits(toy)){ gotcha() }
toy.pop()
What is the purpose of the lose() function?
To increase the bat’s speed
To change the cookie image
To stop the game when the bat hits the player
To drag the toy
What happens when the bat hits the toy in the game?
The game ends
The score increases and the speed gets faster
The bat disappears
The toy changes color
Which code action demonstrates a variable updating?
toy.rotate()
count = count + 1
bat.move(DOWN,70)
sound('vii laugh')
What does the "900" do in this line of code? stamp('dolphin',50,400,900)
places the dolphin at x=400
makes the dolphin 900 pixels tall
places the dolphin at y=400
makes 400 dolphins
What are conditional statements and how are they used?
Conditional statements are used to determine the weather conditions in a given location.
Conditional statements are used to execute different blocks of code based on certain conditions in programming.
Conditional statements are used to cook different types of food based on the recipe.
Conditional statements are used to predict the stock market trends accurately.
Explain the '==' comparison operator in programming.
The '==' comparison operator checks for inequality without considering data types.
The '==' comparison operator only works with numerical values.
The '==' comparison operator converts data types before checking for equality.
The '==' comparison operator checks for equality without considering data types.
What is a statement that helps to reduce the redundancy within a program?
Loop
Constant
Speed
Blank lines
What term describes redundancy in coding that occurs when lines of code or functions are unnecessarily repeated?
Abstraction
Redundancy
Constant
Speed
What measures how fast a sprite moves on the screen/canvas in milliseconds?
Speed
Loop
Abstraction
Redundancy
What is used to make code easier to read?
Loops
Blank lines
Constants
Speed
What command starts counting the time as soon as the "play" button is clicked?
Delay command
Loop
Speed
Constant
What command adds a sound file to the game found in the library?
Tap command
Sound command
Delay command
Loop
What does the "900" do in this line of code? stamp('dolphin',50,400,900)
places the dolphin at x=400
makes the dolphin 900 pixels tall
places the dolphin at y=400
makes 400 dolphins
