本文整理汇总了C++中TileLayer::getNumColumns方法的典型用法代码示例。如果您正苦于以下问题:C++ TileLayer::getNumColumns方法的具体用法?C++ TileLayer::getNumColumns怎么用?C++ TileLayer::getNumColumns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TileLayer
的用法示例。
在下文中一共展示了TileLayer::getNumColumns方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
void Level::update()
{
ObjectLayer * pObjects;
for (int i = 0; i < m_layers.size(); ++i)
{
if (m_pPlayer->getPosition()->getX() + m_pPlayer->getWidth() > 635)
{
TileLayer * pTile = dynamic_cast<TileLayer*>(m_layers[i]);
if (pTile && pTile->getNumColumns() + pTile->getColumnIncrement() < pTile->getTileIDs().at(0).size())
{
pTile->setColumns(20);
m_pPlayer->setPosition(Vector2D(10, 330));
BulletHandler::Instance()->clearAll();
scrollObjects();
}
else
{
m_pPlayer->setVelocity(Vector2D(0.0, 0.0));
}
}
m_layers[i]->update();
pObjects = dynamic_cast<ObjectLayer*>(m_layers[i]);
if (pObjects)
{
CollisionManager::Instance()->checkEnemyPlayerBulletCollision(BulletHandler::Instance()->getBulletPlayer(), pObjects->getObjects());
}
}
CollisionManager::Instance()->checkPlayerEnemyBulletCollision(m_pPlayer, BulletHandler::Instance()->getBulletEnemy());
BulletHandler::Instance()->update();
if (m_pPlayer->isDead())
{
Game::Instance()->getStateMachine()->changeState(new GameOverState());
}
}