Exemplo n.º 1
0
bool ArrowTower::init()
{
	if (!TowerBase::init())
	{
		return false;
	}

	setScope(120);
	setLethality(1);
	setTowerValue(120);
	setRate(3);
	setLevel(0);
	setTowerType(0);



	auto ll = getLevel();
	if( ll == 0 )
	{
		tower= Sprite::createWithSpriteFrameName("tower1.png");
	}
	else if ( ll == 1)
	{
		tower= Sprite::createWithSpriteFrameName("tower2.png");
	}
	else 
	{
		tower= Sprite::createWithSpriteFrameName("tower3.png");
	}
	this->addChild(tower);
	schedule(schedule_selector(ArrowTower::rotateAndShoot), 0.8f);
	return true;
}
Exemplo n.º 2
0
bool ArrowTower::init() {
    setScope(90);
    setLethality(1);
    setRate(2);

    auto baseplate = Sprite::createWithSpriteFrameName("baseplate.png");
    addChild(baseplate);

    rotateArrow = Sprite::createWithSpriteFrameName("arrow.png");
    rotateArrow->setPosition(Vec2(0,baseplate->getContentSize().height/4));
    addChild(rotateArrow);

    schedule(CC_CALLBACK_1(ArrowTower::rotateAndShoot, this),0.5, "shoot");

    return true;
}
Exemplo n.º 3
0
bool AttackTower::init()
{
    if (!TowerBase::init())
	{
		return false;
	}
    
    setScope(90);
	setTowerValue(200);
    setLethality(1);
    setRate(2);
    tower= Sprite::createWithSpriteFrameName("attackTower.png");
    this->addChild(tower);
    
    schedule(schedule_selector(AttackTower::shoot), 0.8f);
	return true;
}
Exemplo n.º 4
0
bool AttackTower2::init()
{
    if (!TowerBase::init())
	{
		return false;
	}
    
    setScope(120);
	setTowerValue(150);
    setLethality(6);
    setRate(2);
	setLevel(0);
	setTowerType(1);
	//add by  
    //tower= Sprite::createWithSpriteFrameName("attackTower.png");
	tower= Sprite::createWithSpriteFrameName("tower2_2.png");
    this->addChild(tower);
    
    schedule(schedule_selector(AttackTower2::shoot), 0.8f);
	return true;
}
Exemplo n.º 5
0
bool ArrowTower::init()
{
    if (!TowerBase::init())
	{
		return false;
	}
    
    setScope(90);
    setLethality(2);
	setTowerValue(250);
    setRate(2);
    auto baseplate = Sprite::createWithSpriteFrameName("baseplate.png");
    addChild(baseplate);
    
    rotateArrow = Sprite::createWithSpriteFrameName("arrow.png");
    rotateArrow->setPosition(0, baseplate->getContentSize().height /4  );
    addChild(rotateArrow);
    
    schedule(schedule_selector(ArrowTower::rotateAndShoot), 0.8f);
	return true;
}