Esempio n. 1
0
void Collectible::init()
{
	setDrawOffset(16, 16);
	setFrameSize(32, 32);

	Animation * tmp;
	tmp = addAnimation("image");
	tmp->addFrame(0, .1f);
	setCurrentAnimation("image");
	shape->collision_type = PhysicsType::Item;
	setShapeLayers(PhysicsLayer::Player);
}
Esempio n. 2
0
CollectibleEnergyBall::CollectibleEnergyBall(double x, double y, int expValue)
: Collectible(x, y, 32.0f, 32.0f) {
	actorName = "EnergyBall";
	this->setImage("energyball.png");
	setDrawOffset(16, 16);
	setFrameSize(32, 32);
	experienceValue = expValue;

	Animation * tmp;
	tmp = addAnimation("anim");
	tmp->addFrame(0, .2f);
	tmp->addFrame(1, .2f);
	tmp->addFrame(2, .2f);
	tmp->addFrame(3, .2f);
	tmp->setDoLoop(true);
	setCurrentAnimation("anim");
	shape->collision_type = PhysicsType::Item;
	setShapeLayers(PhysicsLayer::Player);
}