diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2011-11-29 15:14:18 +0100 |
---|---|---|
committer | Dominique Martinet <asmadeus@codewreck.org> | 2011-11-29 15:14:18 +0100 |
commit | 49d47e8256467c1c01bba34058c40e660b9b0070 (patch) | |
tree | 65b02b09476f0d8a6e746e0a51d1feec4fb8631c /Game.cpp | |
parent | fa22bba8c675945ecfb3161401c575aee3b38045 (diff) |
better AI, removed debug
Diffstat (limited to 'Game.cpp')
-rw-r--r-- | Game.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -27,14 +27,14 @@ Game::Game(int width, int height, PlayerNumber num): }
m_vPlayers[i].setCoordinates(Coordinates(x,y));
- m_vPlayers[i].setVelocityVector(velocity);
+ m_vPlayers[i].setVelocity(velocity);
m_vPlayers[i].setNumber(i);
m_vPlayers[i].revive();
m_Field.getCell(Coordinates(x,y)).setState(PLAYER);
m_Field.getCell(Coordinates(x,y)).setPlayer(&m_vPlayers[i]);
// create AI
- AIController* cont = new AIController(m_vPlayers[i], m_Field, 5);
+ AIController* cont = new AIController(m_vPlayers[i], m_Field, 3);
m_vPlayers[i].setController(cont);
}
}
@@ -78,9 +78,11 @@ void Game::updateGame(uint timeElapsedMs) { // ask the AI if they wanna change something?
for(std::vector<Player>::iterator player = m_vPlayers.begin(); player != m_vPlayers.end(); ++player) {
- if (player->getController()) {
- player->getController()->think();
- }
+ if (player->isAlive()) {
+ if (player->getController()) {
+ player->getController()->think();
+ }
+ }
}
// move everyone and update cells
|