#include "Pellet.h"

// constructor
Pellet::Pellet( DisplayInterface &d, int x, int y, bool super ) : Object( 0 )
{
	super_pellet = super;
	if (super_pellet)
		d.DrawSprite( x, y, SPRITE_PELLET_SUPER );
	else
		d.DrawSprite( x, y, SPRITE_PELLET );
}

// returns object identity
int Pellet::identify( )
{
	return pellet_id;
}

// takes a turn to act in the world; pellets do nothing
bool Pellet::act( DisplayInterface &d, World *w, int x, int y, int time )
{
	return true;
}

// disappears from the world
void Pellet::die( DisplayInterface &d, World *w, int x, int y )
{
//	d.writexy( x, y, '+' );
	d.pause(pellet_die_time);
	d.DrawSprite( x, y, SPRITE_EMPTY );
}

// shows the object at its spot in the world
void Pellet::show( DisplayInterface &d, World *w, int x, int y )
{
	if (super_pellet)
		d.DrawSprite( x, y, SPRITE_PELLET_SUPER );
	else
		d.DrawSprite( x, y, SPRITE_PELLET );
}

bool Pellet::is_super ( ) const
{
	return super_pellet;
}