From 296f4148d31d484890528e3e9522c484d7d2f261 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Sun, 27 Nov 2011 02:34:28 +0100 Subject: [PATCH] Introduce sun energy (on-tick gain) --- agent.cc | 1 + world.h | 1 + 2 files changed, 2 insertions(+) diff --git a/agent.cc b/agent.cc index 0688e00..4f016e1 100644 --- a/agent.cc +++ b/agent.cc @@ -42,6 +42,7 @@ agent::on_action_takes(void) void agent::on_tick(void) { + energy += world::sun_energy; } void diff --git a/world.h b/world.h index 41d91f4..dbfad88 100644 --- a/world.h +++ b/world.h @@ -4,6 +4,7 @@ struct world { const static int newborn_energy = 500; const static int move_cost = 10; + const static int sun_energy = 1; }; #endif