import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Main Player
* Must reach finishline while getting all of the balloons.
* @author (Quinn Sapp)
* @version (28 June 2013)
*/
public class Player1 extends Actor
{
public void act(){
checkKeyPress();
lookForBalloon();
}// end act
public void checkKeyPress(){
if (Greenfoot.isKeyDown("left")){
turn(-4);
}
if (Greenfoot.isKeyDown("right")){
turn(4);
}
if (Greenfoot.isKeyDown("up")){
move(4);
}
if (Greenfoot.isKeyDown("down")){
move(4);
}
if (Greenfoot.getRandomNumber(100) < 10){
turn(5);
}
}
public void lookForBalloon(){
if(canSee(Balloon.class)){
eat(Baloons.class);
Greenfoot.playSound("au.wav");
}
}
}//end class

