View Single Post
  #3 (permalink)  
Old 07-04-2007, 06:06 AM
Felissa Felissa is offline
Member
 
Join Date: Jun 2007
Posts: 95
Felissa is on a distinguished road
here is my Items class code:

Code:
package finalproject; public interface Items { public void useItem(Game game); . . . }
it's an interface, but here is a class that implements Items
Code:
package finalproject; public class HealthPotion implements Items{ public void useItem(Game game){ int health = game.getHealth() + 50; if(health >= 100){ game.setHealth(100); System.out.println("your health has increase to 100"); } else{ game.setHealth(health); System.out.println("your health has increased to "+ health); } } }
Thanks!

Felissa
Reply With Quote