import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Player1 here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Player1 extends Animal
{
private Counter counter;
public Player1(Counter pointCounter)
{
counter=pointCounter;
}
public void act()
{
checkKeys();
}
/**
* Act - do whatever the Player1 wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void checkKeys()
{
if (Greenfoot.isKeyDown("up") )
{
move(75);
}
if (getX()>400) setLocation(20, getY());
if (getOneIntersectingObject(KimJongUn.class) != null)
{
setLocation(20, getY());
counter.add(1);
}
}
}

