Exemplo n.º 1
0
	boolean RayGun::use(byte attackType)
	{
		this->attackType = attackType;
		if(attackType==Player::ATTACK_A)
		{
			if(!active)
			{
				active = true;
				if(ammo>0)
				{
					createProjectile(new Ray(getItemHolder(),x,y));
					ammo--;
				}
				activeTime = Global::getWorldTime() + 500;
			}
			return true;
		}
		else if(attackType==Player::ATTACK_SIDEA)
		{
			if(!active)
			{
				active = true;
				if(ammo>0)
				{
					createProjectile(new Ray(getItemHolder(),x,y));
					ammo--;
				}
				activeTime = Global::getWorldTime() + 400;
			}
			return true;
		}
		return false;
	}
Exemplo n.º 2
0
	void SuperMushroom::onDestroy()
	{
		if(active)
		{
			Player*playr = Global::getPlayerActor(getItemHolder());
			playr->setScale(scale);
		}
	}
Exemplo n.º 3
0
	void SmashBall::Draw(Graphics2D&g, long gameTime)
	{
		if(isHeld() && readyFire!=null)
		{
			Player*owner = Global::getPlayerActor(getItemHolder());
			readyFire->x = owner->x;
			readyFire->y = owner->y;
			x = 0;
			y = 0;
		}
		else
		{
			Item::Draw(g, gameTime);
		}
	}