How would you set the size of the Greenfoot world?
GCSE Unit 2 Prep - Greenfoot

Quiz
•
Computers
•
10th Grade
•
Medium

Andrew Dawson
Used 7+ times
FREE Resource
17 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
super(9, 9, 100);
world(9, 9, 100);
world(9, 9);
superWorld(9, 9, 100);
Answer explanation
This sets a world with a grid of 9 by 9 cells, where each cell contains 100 by 100 pixels.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In Greenfoot Java, which method is used to move an object within the world?
setLocation()
move()
shift()
transport()
Answer explanation
In Greenfoot Java, the move() method is used to move an object within the world. This method is typically called on an actor object to change its position by a specified amount. When move() is invoked, the object will be displaced by the specified distance in the direction it is currently facing. For example, if you have a character in a game and you want it to move forward, you can call the move() method to make it shift its position in the forward direction. e.g.
move(1) would move the object 1 space.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In Greenfoot Java, which method is used to change the direction an object is facing within the world?
rotate()
turn()
spin()
shift()
Answer explanation
In Greenfoot Java, the turn() method is used to change the direction an object is facing within the world. This method is typically called on an actor object to rotate it by a specified angle. When turn() is invoked, the object will rotate clockwise by the specified angle. For example, if you want a character in a game to turn right, you can call the turn() method with a positive angle to make it rotate in that direction.
e.g turn(90) will turn 90 degrees clockwise.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In Greenfoot Java, which method is used to generate a random number within a specified range?
random()
getRandomNumber()
nextInt()
generateRandom()
Answer explanation
n Greenfoot Java, the getRandomNumber() method is used to generate a random number within a specified range. This method takes an integer argument that represents the upper bound of the range (exclusive). The returned random number will be greater than or equal to zero and less than the specified upper bound. For example, if you call getRandomNumber(10), you will get a random number between 0 and 9 (inclusive).
5.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Is this the correct way to implement a random number for move?
move(Greenfoot.getRandomNumber(2));
Yes
No
Yes
No
Answer explanation
This can also be used for turning a random amount:
turn(Greenfoot.getRandomNumber(360));
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In Greenfoot Java, which method is used to check if a specific key is currently being pressed?
Greenfoot.isKeyPressed("up")
Greenfoot.isKeyDown("up")
Greenfoot.isKeyHeld("up")
Greenfoot.isKeyReleased("up")
Answer explanation
In Greenfoot Java, the isKeyDown() method is used to check if a specific key is currently being pressed. This method takes a string argument representing the key to check. It returns a boolean value of true if the specified key is currently being held down, and false otherwise. For example, if you want to check if the "Space" key is being pressed, you can use Greenfoot.isKeyDown("space").
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In Greenfoot Java, which method is used to set the rotation angle of an object within the world?
setAngle()
rotate()
turn()
setRotation()
Answer explanation
In Greenfoot Java, the setRotation() method is used to set the rotation angle of an object within the world. This method takes an integer argument representing the desired rotation angle in degrees. The object will then be rotated to the specified angle. For example, if you want to set an object's rotation angle to 90 degrees, you can use the setRotation(90) method.
Create a free account and access millions of resources
Similar Resources on Quizizz
17 questions
AP CS Test 0 Module 1

Quiz
•
9th - 12th Grade
20 questions
Java 2 Quiz 9

Quiz
•
10th - 12th Grade
17 questions
Greenfoot

Quiz
•
10th - 12th Grade
12 questions
CodeHS Unit 1

Quiz
•
9th - 12th Grade
14 questions
CSA 1.1.1 Why Programming? Why Java?

Quiz
•
10th - 12th Grade
20 questions
Java OOP Connections

Quiz
•
10th - 12th Grade
14 questions
Python Objects and Recursion

Quiz
•
10th Grade
14 questions
Unit 5: Input in Java

Quiz
•
9th - 10th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University