Example #1
0
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;
	}
}
Example #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++;
}
Example #3
0
int Blocks::pickABonus()
{
	return RandomIntBetween(101, 101 + NUMBER_OF_BONUS);
}
Example #4
0
Blocks::BlockType Blocks::pickABlock()
{
	return BlockType(RandomIntBetween(0, NUMBER_OF_BLOCKS));
}