//Created by Joseph Rioux, 30 March 2013

package edu.benedictine.game.engine;

import edu.benedictine.game.media.ImageSource;
import edu.benedictine.game.engine.collision.Hit;
import edu.benedictine.game.gui.Scene;


public class PickUp extends GameObject
{
	public PickUp(Scene scn, double xLoc, double yLoc, double xCng, double yCng, ImageSource img, 
				  double head, double feet, double left, double right, int lifeTime, double gravity, double maxFall) 
	{
		super(scn, 10, 12, xLoc, yLoc, xCng, yCng, img, head, feet, left, right);
		this.lifeTime = lifeTime;
		setFall(gravity, maxFall);
	}
	
	public void handleHit(Hit h)
	{
		if (h.b.owner instanceof Player)
			hitPlayer(((Player)h.b.owner));
	}
	
	public void hitPlayer(Player o)
	{
		//implmented by subclasses (e.g. Life Cell)
		die(); //gets rid of item
	}
}

@@ -33,16 +33,193 @@
 rch 2013
+%0A//Modified by Joseph Rioux, 23 May 2014%0A//added comments%0A%0A//a PickUp is an object that performs some action when it touches the player.%0A//subclasses would be coins, heart, etc.
 %0A%0Apackag
@@ -805,16 +805,96 @@
 t h)%0A%09%7B%0A
+%09%09//if the other member of the object collision is the player, call hitPlayer()%0A
 %09%09if (h.
@@ -1035,17 +1035,11 @@
 .g. 
-Life Cell
+Gem
 )%0A%09%09
@@ -1051,20 +1051,37 @@
 ; //
+the default is to 
 get
-s
  rid of 
 item
@@ -1080,12 +1080,18 @@
  of 
-item
+the pickup
 %0A%09%7D%0A

Update PickUp.java