Unit 3: [Assessment] Lessons 5, 6, 7 & 9
Displays a group of sprites. If no parameter is specified draws all sprites in the sketch
draw.sprites
Which of the following rules need to be followed when using variables
-Labels are case sensitive -Labels can't include spaces -Labels can't with with a number
Which of the following can the counter pattern do in programming
-keep track of mouse clicks -make an image fly across the screen -count down a timer -increase or decrease numbers
Which of the following code is written in camel case format?
-sizeOfRectangle -sizeofRectangle
What is the default scale for the size of a sprite.
1
How many sprites does the following program create when run? var leftSprite = createSprites (100,200) drawSprites (); var rightSprite = createSprites (300,200) drawSprites ();
2
Read this program and predict which of the following animations will be produced using link.
A
a series of images that create the illusion of motion by being shown rapidly one after the other
Animation
What is the counter pattern?
It is code that increases or decreases the value of a variable by 1 to count up or down.
The follwoing code does what?
Creates a new sprite and assigns it to the variable specified.
What does the following code do in the game lab?
Displays a group of sprites. If no paramteer is specified draws all sprites in the sketch.
Another method to put multiple words in a variable label is to use X's between the words.
False
You are not able to draw or upload your own image in the Animation tab in Game Lab
False
a single image within an animation
Frame
the rate at which frames in an animation are shown, typically measured in frames per second
Frame Rate
The following sprite.scale = 0.5 does the following to the sprite charachter
Makes the sprite one half the original size
The following code does what in game lab function draw () {}
The lines of code contained inside its block are continuously executed until the program is stopped.
The most important thing when you choose how to label your variables is to use a consistent style so it's easy for you to remember the exact spelling and capitalization of your variables
True
You can add text in game lab.
True
In which corner of the screen will the circle be drawn with the following code? car xPosition = 300 var whatstheY = 100
Upper right
Names used in coding that refer to stored data in your apps
Variables
Using a series of pictures to create the illusion of smooth movement from frame to frame is called
an animation
Where does the draw function need to be placed in the following code so that the shalt shaker will loop? var salt = createSprite(200,200); salt.setAnimation("salt"); background ("skyblued"); salt.y randomNumber(200,220); draw sprites();
before background("skyblue")
The setAnimation (); code does the following
call the sprite name located in between the () to be drawn on the screen from the animation Tab in Game Lab
x = x +1; is an example of what type of code?
counter pattern
What does the following code do? var sprite = createSprite ();
creates a new sprite and assigns it to a variable
Attributes that describe and object's characteristics
property
A graphic character on the screen with properties that describe its location, movement, and look.
sprite
What is a "watcher" used for in coding?
to use as a debugging tool that watches your variables while the program runs.
When the following code is run, where will the sprite (mySprite) be located? var my Sprite = createSprite(300,100);
upper left