Skip to content

Commit

Permalink
couts removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Nov 2, 2014
1 parent 14043de commit e28a451
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 50 deletions.
2 changes: 1 addition & 1 deletion src/entity/mob/ai/chase_evade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,5 @@ void ChaseEvade::Update(double delta) {
}

void ChaseEvade::Debug() const {
AI::Debug();

}
27 changes: 1 addition & 26 deletions src/entity/mob/ai/follower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,52 +34,27 @@ void Follower::Update(double delta) {
if (not path_)
path_ = PathToEnemy();

std::cout << "Checkpoint 1" << std::endl;
if(path_ && path_->ready) {
std::cout << "Checkpoint 2" << std::endl;
mob_->FollowPath(path_, delta);

std::cout << "Checkpoint 3" << std::endl;
if(not path_->Update(delta) && mob_->Distance(path_->to) > 34) {
std::cout << "Checkpoint 4" << std::endl;
delete path_;
std::cout << "Checkpoint 5" << std::endl;
path_ = PathToEnemy();
std::cout << "Checkpoint 6" << std::endl;
}
}
}
}
}
else{
/*if(not path_)
path_ = PathToPlayer();
if(path_ && path_->ready) {
mob_->FollowPath(path_, delta);
if(not path_->Update(delta) && mob_->Distance(path_->to) > 50) {
delete path_;
path_ = PathToPlayer();
}
}*/
} else{

std::cout << "Checkpoint 8" << std::endl;
if(not path_)
path_ = PathToPlayer();

std::cout << "Checkpoint 9" << std::endl;
if(path_){
std::cout << "Checkpoint 9.1" << std::endl;
if (path_->ready) {
std::cout << "Checkpoint 10" << std::endl;
mob_->FollowPath(path_, delta);
std::cout << "Checkpoint 11" << std::endl;

if(not path_->Update(delta)){
std::cout << "Checkpoint 11.1" << std::endl;
if (mob_->Distance(path_->to) > 50) {
std::cout << "Checkpoint 12" << std::endl;
delete path_;
path_ = PathToPlayer();
}
Expand Down
6 changes: 0 additions & 6 deletions src/map/level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@ Level::Level(const char *map, Hud* hud) :
main_player_(0),
transition_requested_(false)
{
map_->Print();
std::cout << "Checkpoint 0" << std::endl;
nodes_ = std::vector<std::vector<Path::Node*>>(map_->height_pixels / Path::RESOLUTION,
std::vector<Path::Node*>(map_->width_pixels / Path::RESOLUTION, 0));
dynamic_collidables_ = new Quadtree(0, Rectangle(0, 0, map_->width_pixels, map_->height_pixels));

std::cout << "Checkpoint 1" << std::endl;
for(auto& g : map_->object_groups) {
TMX::ObjectGroup& object_group = g.second;

Expand All @@ -50,7 +47,6 @@ Level::Level(const char *map, Hud* hud) :
} else {
Entity* map_object = 0;

std::cout << "Checkpoint 2" << std::endl;
if(object.type == "plant") {
map_object = new Plant(tileset_->sprite(object.gid), object.x, object.y - 16);
} else if(object.type == "key_door") {
Expand Down Expand Up @@ -82,7 +78,6 @@ Level::Level(const char *map, Hud* hud) :
AddCollidable(transition);
}
}
std::cout << "Checkpoint 3" << std::endl;
}

if(not map_->tilesets[0]->music.empty()) {
Expand Down Expand Up @@ -285,7 +280,6 @@ void Level::AddEntity(Entity* entity) {
}

void Level::AddPlayer(Entity* player, std::string location) {
std::cout << "ola k ase" << std::endl;
std::map<std::string, Location*>::iterator it = locations_.find(location);

if(it == locations_.end()) {
Expand Down
3 changes: 0 additions & 3 deletions src/map/tile_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@

TileMap::TileMap(const char* name)
{
std::cout << "Prova1" << std::endl;
std::stringstream path;
path << "res/level/" << name << ".tmx";
std::cout << "Prova2" << std::endl;
map_ = TMX::parse(path.str().c_str());
std::cout << "Prova3" << std::endl;
static_collidables_ = new Quadtree(0, Rectangle(0, 0, map_->width_pixels, map_->height_pixels));
tileset_ = new Tileset(map_->tilesets[0]);

Expand Down
14 changes: 0 additions & 14 deletions src/screen/level_screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,35 +30,21 @@ void LevelScreen::Tick(double delta) {
std::string map;
std::string place;
level->consume_transition(map, place);
std::cout << "Checkpoint level-screen.1" << std::endl;

level->ChangeEffect(new Fade(Fade::OUT, 0.5, [this, map, place]{
std::cout << "Checkpoint level-screen.1.1" << std::endl;

std::vector<Entity*> players(level->players());
std::cout << "Checkpoint level-screen.1.1.1" << std::endl;


Level* old_level = level;
std::cout << "Checkpoint level-screen.1.1.2 " << map.c_str() << std::endl;
level = new Level(map.c_str(), hud);
std::cout << "Checkpoint level-screen.1.2" << std::endl;


for(Entity* player : players){
std::cout << "Checkpoint level-screen.2" << std::endl;

level->AddPlayer(player, place);
}

std::cout << "Checkpoint level-screen.3" << std::endl;

level->ChangeEffect(new Fade(Fade::IN, 0.5, [this, old_level]{
delete old_level;
level->Init();
}));
std::cout << "Checkpoint level-screen.4" << std::endl;

}));
}
}
Expand Down

0 comments on commit e28a451

Please sign in to comment.