示例#1
0
Asteroid::Asteroid()
    : m_StartPosition(getRandomPosition())
    , m_Velocity(getRandomVelocity())
    , m_RotationSpeed(getRandomRotationSpeed())
    , m_Speed(getRandomSpeed())
    , m_Type(getRandomType())
    , m_HasBeenStruck(false)
{
    setupSprite();
    setupShape();
}
示例#2
0
	Piece::Piece(const boost::shared_ptr<Board>& board, unsigned int row, unsigned int column)
		: mType(Bar), mColumn(column), mRow(row), mBoard(board), mStuck(false)
	{
		mType = getRandomType();
		mRotation = getRandomRotation();
		for(int k=0; k<sNumBlocks; ++k)
		{
			mColors[k] = Block::getRandomColor();
		}
		turnOn();
	}