Flashcards
Greenfoot
Cards in this deck (6)
- 1Moving according to arrow keysif(Greenfoot.isKeyDown("up")){
setLocation(getX(), getY()-1);
}
if(Greenfoot.isKeyDown("right")){
setLocation(getX()+1, getY());
} - 2Moving around randomlyif(Greenfoot.getRandomNumber(100)<20){
move(2);
}
if(Greenfoot.getRandomNumber(100)<20){
turn(-90);
move(-2);
} - 3"Eating"Actor Zoe = getOneObjectAtOffset(0,0, Food.class);
if(isTouching(Food.class)){
HouseWorld houseWorld
houseWorld = (HouseWorld)getWorld();
removeTouching(Food.class);
} - 4Playing a soundGreenfoot.playSound("pop.wav");
- 5Counter (at the end of the code for "eating", still in the if statement)
- 6Counter (in the code for the world)
Information
- Description
- GCSE Computer Science (7. Programming) Flashcards on Greenfoot, created by Zoe CB on 01/04/2016.
- Created by
- Zoe CB
- Views
- 46
- Rating