
/* Generated by Interface Builder */

// Handles moving and rendering various moving objects.

#import "GameActor.h"


@implementation GameActor

- init				// initialize the new instance vars
{
	[super init];
	myX = 0; myY = 0;
	lastx = 0; lasty = 0;
	px = 0; py = 0;
	return self;
}

- move:sender				// Move the Actor one animation frame
{	// you must override this and put something here
	return self;
}

- at:(float *)xx :(float *)yy		// where is the actor now?
{
	*xx = myX;
	*yy = myY;
	return self;
}

- lastAt:(float *)xx :(float *)yy	// called to find out where actor is
{
	*xx = lastx;
	*yy = lasty;
	return self;
}

- (int)xpos { return myX; }	// return our x-coord

- (int)ypos { return myY; }	// return our y-coord

- moveOneFrame	// moves the actor along; access directly or via renderAt::move:
{
	myX += px;
	myY += py;
	return self;
}

- renderAt:(int)posx :(int)posy move:(BOOL)moveOk	// draw actor
		// you should lock focus on view that gets the actor first.
{		// this should be overridden by the actor subclass
	if (moveOk) [self moveOneFrame];
	lastx = myX;
	lasty = myY;
	return self;
}


@end
