text
How do I make it so I can no longer drag my object?
$this.draggable(false)
Make my rocket move up by 100.
Explain the isTouching function
isTouching takes 2 objects and returns true if they are touching and false otherwise.
What function changed the animation of an image?
frameIndex
Write a statement to remove the object you are in.
$this.remove();
Explain what the rocket.pointToObject(rock) will do?
It will make the rocket point in the direction of the rock object.
Explain what rectangle.moveToObject(circle) will do.
It will move the rectangle to the circle object.
How do I make an object invisible?
$this.visible(false);
Clone my rock only if my scene state is equal to play.
if($this.scene.state() == "PLAY"){
rock.clone();
}
Write an if statement that will make your debug print hi when you press the up arrow key
var upArrowPressed = isKeyPressed(Keys.upArrow);
if(upArrowPressed){
console.log("hi");
}
What are the two functions we can call on an object to make an object that is able to be dragged, unable to be dragged.
$this.draggable(false);
or
$this.toggleDraggable();
Write an if statement that checks to see if the rock object is touching the rocket object. If it is, make the console print the string hi
if(rock.isTouching(rocket)){
console.log("hi")
}
Store a random whole number from 1 - 400 into the variable roll.
var roll = Math.round(random(5));
Explain the difference between var totalScore and $this.totalScore
var is used for local and $this is used for global
Write a create timer function that will clone the raindrop object every 1 second
CreateTimer(1000, function(){raindrop.clone()}, true)
What two functions can we call on an object that is visible to be invisible?
$this.visible(false)
or
$this.toggleVisible()
Create your own createTimer function and explain what it is suppose to do.
(Sensei can judge if it is correct or incorrect)
rectangle.fill("red")
Write 4 statements one that will make my rectangle move up, one that will make my circle move down, one that will make my square move left, and one that will make my oval move right.
rectangle.moveY(-100);
circle.moveY(100);
square.moveX(-100);
oval.moveX(100);