コード例 #1
0
ファイル: Blocks.cpp プロジェクト: 4an70m/FallingBlocks
int Blocks::RandomRotation()
{
	int rotationChooser = RandomIntBetween(0,3);
	switch(rotationChooser)
	{
	case 0: return 0;
	case 1: return 90;
	case 2: return 180;
	case 3: return 270;
	}
}
コード例 #2
0
void WaldoAttack::Throw() 
    {	
	if(throws == throwsInterval)
	{
   		Location * pWl = new Location();
		pWl->X = pWaldo->GetLocation()->X;
		pWl->Y = pWaldo->GetLocation()->Y + (pWaldo->GetLocation()->height/2);
		
		MessageQueue::Instance()->SendMessage(CM_SOUND_EVENT,(WPARAM)(LPCTSTR)"res/Waves/fireball.wav", 0);
		if(pWaldo->GetLocation()->X < pWaldo->GetPengyLocation()->X)
			Weapon * weapon = new Weapon(pWl, GadgetView::GadgetImage::RottenFish, Direction::Right, 0.3, 300, Character::Instance());
		else
			Weapon * weapon = new Weapon(pWl, GadgetView::GadgetImage::RottenFish, Direction::Left, 0.3, 300, Character::Instance());
		
		throws = 0;
		throwsInterval = RandomIntBetween(800, 1000);
	}
	else
		throws++;
}
コード例 #3
0
ファイル: Blocks.cpp プロジェクト: 4an70m/FallingBlocks
int Blocks::pickABonus()
{
	return RandomIntBetween(101, 101 + NUMBER_OF_BONUS);
}
コード例 #4
0
ファイル: Blocks.cpp プロジェクト: 4an70m/FallingBlocks
Blocks::BlockType Blocks::pickABlock()
{
	return BlockType(RandomIntBetween(0, NUMBER_OF_BLOCKS));
}