Skip to content

Commit

Permalink
Buggy ignition of swamp tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
baylej committed Aug 25, 2015
1 parent d094d00 commit 394209f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/objects/villager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,24 @@ void Flame::update() {
auto ptr = shared_from_this();

if ((long)(al_get_time() * 1000) > this->startTime + 4000) {
glm::vec2 dir = getUnitDirectionVector();

glm::vec2 pos = position + dir * 20.f;
Tile *t = game.map_.pwhat(pos.x, pos.y);
if (!t->ignited()) t->ignite(1000);

pos = position + dir * 40.f;
t = game.map_.pwhat(pos.x, pos.y);
if (!t->ignited()) t->ignite(1000);

this->game.removeObject(ptr);
}
}

// ----

ALLEGRO_BITMAP* Villager::sprite = NULL;
TriObject Villager::fov(10*32., 5*32., PI);
TriObject Villager::fov(6*32., 5*32., PI);

Villager::Villager(glm::vec2 spawnPosition, Game &game): Character(glm::vec2(30, 30), game) {
this->position = spawnPosition;
Expand Down

0 comments on commit 394209f

Please sign in to comment.