Hello, I have a bullet class and a player class, what I want is when the bullet hits the player, the same loses health but I get this error:
"non-static method hit(int) cannot be referenced from a static context".
Here is what I got on player:
and the bullet:
public class Player extends Human
{
private int hp = 100;
public void hit(int damage)
{
hp = hp - damage;
if(hp <= 0)
{
Greenfoot.stop();
}
}public void hitPlayer()
{
Actor hit;
hit = getOneObjectAtOffset(0, 0, Player.class);
if(hit != null)
{
getWorld().removeObject(this);
Player.hit(DMGE);
}
}

