mirror of
https://github.com/brmlab/brmlife.git
synced 2025-08-02 09:53:38 +02:00
Track agent energy
Base energy, move energy
This commit is contained in:
parent
4fe552a79e
commit
93882f79b9
5 changed files with 22 additions and 6 deletions
4
agent.cc
4
agent.cc
|
@ -19,6 +19,8 @@ agent::put_at(class tile &t)
|
|||
bool
|
||||
agent::move_dir(int dir_x, int dir_y)
|
||||
{
|
||||
energy -= world::move_cost;
|
||||
|
||||
class tile *t2 = &tile->tile_in_dir(dir_x, dir_y);
|
||||
if (!t2->on_agent_enter(*this))
|
||||
return false;
|
||||
|
@ -54,7 +56,7 @@ agent::on_senses_update(void)
|
|||
tile->tile_in_dir(0, 1).symbol(),
|
||||
tile->tile_in_dir(-1, 0).symbol(),
|
||||
};
|
||||
conn->senses(tick_id, around);
|
||||
conn->senses(tick_id, energy, around);
|
||||
}
|
||||
|
||||
agent::~agent()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue