コード例 #1
0
ファイル: ItemLadderLR.cpp プロジェクト: dalechngame/mygame
bool ItemLadderLR::init(CCDictionary* dict)
{
	Item::init();
	_type = Item::IT_LadderLR;

	setPositionByProperty(dict);

	// 梯子的显示
	CCTexture2D* texture = CCTextureCache::sharedTextureCache()->addImage("ladder.png");
	setTexture(texture);
	setTextureRect(CCRectMake(0, 0, texture->getContentSize().width, texture->getContentSize().height));

	Common::moveNode(this, ccp(-texture->getContentSize().width / 2, 0));

	// 属性
	_LorR = 1-dict->valueForKey("LorR")->intValue();  // 一开始向左还是向右
	_ladderDis = dict->valueForKey("ladderDis")->intValue();  // 摆动的幅度

	// 梯子一个回合已经移动过的距离
	_dis = 0;
	// 梯子移动速度
	_speed = 20;
	// 标记mario在我这个梯子上
	_marioOnThisLadder = false;

	return true;
}
コード例 #2
0
ファイル: ItemDarkCloud.cpp プロジェクト: dalechngame/mygame
bool ItemDarkCloud::init(CCDictionary* dict)
{
	Item::init();
	_type = Item::IT_mushroom;

	setPositionByProperty(dict);



	// ͼƬ
	setDisplayFrameWithAnimationName("MushroomMoving", 0);


	return true;
}
コード例 #3
0
ファイル: ItemTortoise.cpp プロジェクト: dalechngame/mygame
bool ItemTortoise::init(CCDictionary* dict)
{
	Item::init();
	_type = Item::IT_tortoise;

	setPositionByProperty(dict);
	
	_dir = Common::LEFT;
	_speed = 50;
	_speedAcc = _speedDown = 10;

	_status = NORMAL;

	runAnimation("TortoiseMoveLeft");
	return true;
}
コード例 #4
0
ファイル: ItemFlagPoint.cpp プロジェクト: dalechngame/mygame
bool ItemFlagPoint::init(CCDictionary* dict)
{
	Item::init();
	_Flag = this;

	_type = Item::IT_flagpoint;

	setPositionByProperty(dict);

	CCTexture2D* texture = CCTextureCache::sharedTextureCache()->addImage("flag.png");
	setTexture(texture);
	setTextureRect(CCRect(0, 0, texture->getContentSize().width, texture->getContentSize().height));

	Common::moveNode(this, ccp(-texture->getContentSize().width / 2, 0));

	return true;
}
コード例 #5
0
bool ItemTortoiseRound::init(CCDictionary* dict)
{
	Item::init();
	_type = Item::IT_tortoiseRound;

	setPositionByProperty(dict);
	_speed = 50;
	_speedAcc = _speedDown = 10;

	_dir = Common::LEFT;
	_status = NORMAL;

	_roundDis = dict->valueForKey("roundDis")->intValue();// 巡逻的距离
	_rightMost = getPositionX();
	_leftMost = _rightMost - _roundDis;

	updateStatus();

#if 0
	<object name = "enemy" type = "tortoise_round" x = "1664" y = "112">
コード例 #6
0
ファイル: ItemBoss.cpp プロジェクト: dalechngame/mygame
bool ItemBoss::init(CCDictionary* dict)
{
    Item::init();
    _type = Item::IT_boss;

    setPositionByProperty(dict);

    _speedDown = _speedAcc = 10;
    _speed = 50;
    _left = getPositionX() - 7 * 16;
    _right = getPositionX() + 2 * 16;
    _status = NORMAL;
    _dir = Common::LEFT;

    updateStatus();

    _Boss = this;

    return true;
}
コード例 #7
0
bool ItemFireString::init(CCDictionary * dict)
{
	Item::init();
	_type = IT_FIRESTRING;
	setPositionByProperty(dict);

	CCTexture2D * bossBullet = CCTextureCache::sharedTextureCache()->addImage("bossBullet.png");
	setTexture(bossBullet);
	setTextureRect(CCRectMake(0, 0, bossBullet->getContentSize().width, bossBullet->getContentSize().height));
	setScale(.6f);

	setAnchorPoint(ccp(0, 0.5f));

	int begAngle  = dict->valueForKey("begAngle")->intValue();
	setRotation(begAngle);
	int time = dict->valueForKey("time")->intValue();
	runAction(CCRepeatForever::create(CCRotateBy::create(time, 360)));

	return true;
}
コード例 #8
0
bool ItemTortoiseFly::init(CCDictionary* dict)
{
	Item::init();
	_type = Item::IT_tortoiseFly;

	setPositionByProperty(dict);

	_status = NORMAL;
	_dir = Common::LEFT;

	_flyDis = dict->valueForKey("flyDis")->intValue();
	_right = getPositionX();
	_left = _right-_flyDis;

	_speed = 50;
	_speedDown = _speedAcc = 10;

	updateStatus();

	return true;
}