//created by Joseph Rioux, 4 March 2013

package edu.benedictine.game.engine;

import edu.benedictine.game.gui.Scene;

//	any object updated by the scene

public class SceneObject 
{
	int execOrder, lifeTime = -1;
	double xSpeed, ySpeed;
	protected Scene scn;
	
	public SceneObject(Scene scn, int exec)
	{
		scn.objs.add(exec, this);
		this.scn = scn;
		execOrder = exec;
	}
	
	public void setTimer(int time)
	{
		lifeTime = time;
	}
	
	public void update()
	{
		timer();
	}
	
	public void timer()
	{
		if (lifeTime == 0)
			die();
		lifeTime--;
	}
	
	public void move(double xCng, double yCng)
	{
		
	}
	
	public void die()
	{
		scn.objs.remove(this, execOrder);
	}
	
	public void cleanUp()
	{
		
	}

	public double getXSpeed() 
	{
		return xSpeed;
	}

	public double getYSpeed() 
	{
		return ySpeed;
	}
	
}

@@ -32,16 +32,91 @@
 rch 2013
+%0A//modified by Joseph Rioux, 23 May 2014%0A%09//added isAlive(), added comments
 %0A%0Apackag
@@ -189,17 +189,16 @@
 ene;%0A%0A//
-%09
 any obje
@@ -281,16 +281,44 @@
 e = -1;%0A
+%09public boolean alive=true;%0A
 %09double 
@@ -729,183 +729,568 @@
 %7B%0A%09%09
-scn.objs.remove(this, execOrder);%0A%09%7D%0A%09%0A%09public void cleanUp()%0A%09%7B%0A%09%09%0A%09%7D%0A%0A%09public double getXSpeed() %0A%09%7B%0A%09%09return xSpeed;%0A%09%7D%0A%0A%09public double getYSpeed() %0A%09%7B%0A%09%09return ySpeed;%0A%09%7D%0A%09
+//set alive to false so that any object referencing this one through%0A%09%09//another pointer can still tell that it has been removed from the current scene%0A%09%09alive = false;%0A%09%09//remove from the current scene%0A%09%09scn.objs.remove(this, execOrder);%0A%09%7D%0A%09%0A%09public void cleanUp()%0A%09%7B%0A%09%09%0A%09%7D%0A%0A%09public double getXSpeed() %0A%09%7B%0A%09%09return xSpeed;%0A%09%7D%0A%0A%09public double getYSpeed() %0A%09%7B%0A%09%09return ySpeed;%0A%09%7D%0A%09%0A%09public boolean isAlive()%0A%09%7B%0A%09%09//this is used to for check whether an object that you are referencing through%0A%09%09//another pointer is still in the current scene.%0A%09%09return alive;%0A%09%7D
 %0A%7D%0A

Update SceneObject.java