22 lines
498 B
Java
22 lines
498 B
Java
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
|
|
|
|
/**
|
|
* Write a description of class HealthItem here.
|
|
*
|
|
* @author (your name)
|
|
* @version (a version number or a date)
|
|
*/
|
|
public class HealthItem extends PowerUps
|
|
{
|
|
int duration = 60*60;
|
|
public void act()
|
|
{
|
|
touchedByPlayer();
|
|
}
|
|
|
|
@Override void collect(){
|
|
Player player = getIntersectingObjects(Player.class).get(0);
|
|
player.reveivePowerUp(duration, "Heal");
|
|
}
|
|
}
|