Greenfoot Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

what is the move method?

A
if(Greenfoot.isKeyDown("key name"))
{
  move(amount);
  or turn(amount(minus for turning right));
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

move randomly?

A
if(Greenfoot.getRandomNumber(10) == 1)
{
  turn(Greenfoot.getRandomNumber(360));
}
move(amount);
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

remove touching?

A
Actor (actor name) = getOneObjectAtOffset(0, 0, (actor name).class);
if (actor name != null)
{
   getWorld().removeObject(actor name);
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

play a sound?

A

Greenfoot.playSound(“filename.wav”);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

add a counter?

A
  1. create a counter class

2. add: ((Counter)getWorld().getObjects(Counter.class).get(0)).add(1); to the class affected by the counter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is a superclass?

A

the class that all the others come from (e.g actor, world)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly