Skip to content

Instantly share code, notes, and snippets.

@Lexxicon
Last active November 18, 2021 20:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Lexxicon/0ed7ce6125f6c00d52ed8104c63ffa9d to your computer and use it in GitHub Desktop.
Save Lexxicon/0ed7ce6125f6c00d52ed8104c63ffa9d to your computer and use it in GitHub Desktop.
Simple Flecs TD
/**
Copyright <2021> <Lexxicon Studios LLC.>
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included in all copies
or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**/
#include <vector>
#include "flecs.h"
const int TD_LOG_INFO = 0;
struct Position
{
float x;
float y;
};
struct Health
{
float current;
};
struct MaxHealth
{
float value;
};
struct Cooldown
{
float remainingTime;
};
struct Attack
{
flecs::entity_view payload;
float cooldown;
};
struct PayloadType{};
struct Damage
{
float amount;
};
struct KnockBack
{
float x;
float y;
};
struct Target
{
flecs::entity_view entity;
};
struct Team{};
int main()
{
flecs::world ecs;
ecs_tracing_color_enable(false);
ecs.system("Tick Printer")
.kind(flecs::PreFrame)
.iter([](flecs::iter& iter)
{
ecs_trace(TD_LOG_INFO, "\n--- Tick[%d] time[%f] ---", iter.world().get_tick(), iter.world_time());
ecs_log_push();
});
ecs.system("Post Tick")
.kind(flecs::PostFrame)
.iter([](flecs::iter& iter)
{
ecs_log_pop();
ecs_trace(TD_LOG_INFO, "--- End Tick ---");
});
ecs.observer<>()
.term(flecs::IsA).object(flecs::Wildcard)
.event(flecs::OnAdd)
.each([](flecs::entity e)
{
ecs_trace(TD_LOG_INFO, "New Instance: %s [%s]", e.str().c_str(), e.type().str().c_str());
});
ecs.observer<MaxHealth>("Init Health")
.term<Health>().oper(flecs::Not)
.event(flecs::OnSet)
.each([](flecs::entity e, MaxHealth& maxHealth)
{
ecs_trace(TD_LOG_INFO, "Init health for %s to %f", e.str().c_str(), maxHealth.value);
e.set<Health>({maxHealth.value});
});
ecs.system<Cooldown>("Tick Cooldown")
.arg(1).object(flecs::Wildcard) // <- Cooldown is actually a pair type with anything
.iter([](flecs::iter& iter, Cooldown* cooldowns)
{
auto obj = iter.term_id(1).object();
for(auto i : iter)
{
cooldowns[i].remainingTime -= iter.delta_system_time();
if(cooldowns[i].remainingTime <= 0)
{
ecs_trace(TD_LOG_INFO, "%s<%s> off cooldown", iter.entity(i).str().c_str(), obj.str().c_str());
iter.entity(i).remove<Cooldown>(obj);
}
}
});
ecs.observer<Health>()
.event(flecs::OnSet)
.each([](flecs::entity e, Health& hp)
{
if(hp.current <= 0)
{
ecs_trace(TD_LOG_INFO, "Killing %s", e.str().c_str());
e.destruct();
}
});
ecs.system<Position>()
.each([](flecs::entity e, Position& p)
{
ecs_trace(TD_LOG_INFO, "%s located at [%f, %f]", e.str().c_str(), p.x, p.y);
});
ecs.observer<Health, Damage>("Apply Damage")
.event(flecs::OnSet)
.iter([](flecs::iter it, Health* healths, Damage* damages)
{
if(it.event_id() != it.world().component<Damage>())
{
return;
}
for(auto i : it)
{
auto e = it.entity(i);
auto maxHealth = e.get<MaxHealth>();
healths[i].current -= damages[i].amount;
it.entity(i).modified<Health>();
ecs_trace(TD_LOG_INFO, "Damaged %s for %f %f/%f", e.str().c_str(), damages[i].amount, healths[i].current, maxHealth->value);
}
});
ecs.observer<Position, KnockBack>("Apply Knock Back")
.arg(1)
.event(flecs::OnSet)
.iter([](flecs::iter it, Position* positions, KnockBack* knockBacks)
{
if(it.event_id() != it.world().component<KnockBack>())
{
return;
}
for(auto i : it)
{
ecs_trace(TD_LOG_INFO, "Knocking %s for [%f,%f]", it.entity(i).str().c_str(), knockBacks[i].x, knockBacks[i].y);
positions[i].x += knockBacks[i].x;
positions[i].y += knockBacks[i].y;
it.entity(i).modified<Position>();
}
});
ecs.system<Attack, Target>("Send Attack")
.term<Cooldown>().object<Attack>().oper(flecs::Not)
.each([](flecs::entity e, Attack& attack, Target& target)
{
if(!target.entity.is_alive())
{
ecs_trace(TD_LOG_INFO, "%s target is dead", e.str().c_str());
e.remove<Target>();
return;
}
ecs_trace(TD_LOG_INFO, "Sending payload from %s to %s", e.str().c_str(), target.entity.str().c_str());
ecs_log_push();
attack.payload.each([&](flecs::id TypeID)
{
if(TypeID.has_relation(TypeID.world().component<PayloadType>()))
{
auto payloadType = TypeID.object();
ecs_trace(TD_LOG_INFO, "%s", payloadType.str().c_str());
target.entity.mut(e).set_ptr(payloadType, attack.payload.get(TypeID));
}
});
ecs_log_pop();
e.set<Cooldown, Attack>({attack.cooldown});
});
auto TeamOne = ecs.entity("PlayerTeam");
auto TeamTwo = ecs.entity("Creeps");
auto FindAllCreeps = ecs.query_builder<>()
.term<Position>()
.term<Health>()
.term(TeamTwo).set(flecs::Self | flecs::SuperSet)
.build();
ecs.system("Find New Targets")
.term<Attack>()
.term<Target>().oper(flecs::Not)
.term(TeamOne)
.each([FindAllCreeps](flecs::entity e)
{
std::vector<flecs::entity> FoundCreeps;
FindAllCreeps.each([&](flecs::entity Creep)
{
FoundCreeps.emplace_back(Creep);
});
if(FoundCreeps.size() == 0)
{
ecs_trace(TD_LOG_INFO, "%s found no more creeps", e.str().c_str());
e.world().quit();
}else
{
auto Picked = FoundCreeps[rand() % FoundCreeps.size()];
ecs_trace(TD_LOG_INFO, "%s now targeting %s", e.str().c_str(), Picked.str().c_str());
e.set<Target>({Picked});
}
});
auto BaseCreep = ecs.prefab("BaseCreep")
.add(TeamTwo)
.set_override<Position>({0, 0});
auto WeakCreep = ecs.prefab("WeakCreep")
.is_a(BaseCreep)
.set<MaxHealth>({3});
auto StrongCreep = ecs.prefab("StrongCreep")
.is_a(BaseCreep)
.set<MaxHealth>({20});
auto BaseTurret = ecs.prefab("TurretBase")
.add(TeamOne);
auto FastDamageTurret = ecs.prefab("FastDamageTurret")
.is_a(BaseTurret)
.set<Attack>({
ecs.entity().set<PayloadType, Damage>({1}),
1});
auto MedTeleportTurret = ecs.prefab("MedTeleportTurret")
.is_a(BaseTurret)
.set<Attack>({
ecs.entity().set<PayloadType, KnockBack>({1, 0}),
2});
auto SlowSuperTurret = ecs.prefab("SlowSuperTurret")
.is_a(BaseTurret)
.set<Attack>({
ecs.entity().set<PayloadType, KnockBack>({0, 1})
.set<PayloadType, Damage>({5}),
3});
ecs.entity("Creep").scope([&]{
ecs.entity().is_a(WeakCreep);
ecs.entity().is_a(StrongCreep);
ecs.entity().is_a(StrongCreep);
});
ecs.entity("Turret").scope([&]{
ecs.entity().is_a(FastDamageTurret);
ecs.entity().is_a(FastDamageTurret);
ecs.entity().is_a(MedTeleportTurret);
ecs.entity().is_a(SlowSuperTurret);
});
ecs_trace(TD_LOG_INFO, "Begin");
ecs.set_target_fps(1);
while(!ecs.should_quit())
{
ecs.progress();
}
ecs_trace(TD_LOG_INFO, "Done");
}
info: scratch.cpp:93: New Instance: Creep.436 [Position,(ChildOf,Creep),(IsA,WeakCreep)]
info: scratch.cpp:101: Init health for Creep.436 to 3.000000
info: scratch.cpp:93: New Instance: Creep.437 [Position,(ChildOf,Creep),(IsA,StrongCreep)]
info: scratch.cpp:101: Init health for Creep.437 to 20.000000
info: scratch.cpp:93: New Instance: Creep.438 [Position,(ChildOf,Creep),(IsA,StrongCreep)]
info: scratch.cpp:101: Init health for Creep.438 to 20.000000
info: scratch.cpp:93: New Instance: Turret.440 [(ChildOf,Turret),(IsA,FastDamageTurret)]
info: scratch.cpp:93: New Instance: Turret.441 [(ChildOf,Turret),(IsA,FastDamageTurret)]
info: scratch.cpp:93: New Instance: Turret.442 [(ChildOf,Turret),(IsA,MedTeleportTurret)]
info: scratch.cpp:93: New Instance: Turret.443 [(ChildOf,Turret),(IsA,SlowSuperTurret)]
info: scratch.cpp:277: Begin
info: scratch.cpp:78:
--- Tick[0] time[1.000000] ---
info: | scratch.cpp:134: Creep.436 located at [0.000000, 0.000000]
info: | scratch.cpp:134: Creep.437 located at [0.000000, 0.000000]
info: | scratch.cpp:134: Creep.438 located at [0.000000, 0.000000]
info: | scratch.cpp:228: Turret.440 now targeting Creep.438
info: | scratch.cpp:228: Turret.441 now targeting Creep.438
info: | scratch.cpp:228: Turret.442 now targeting Creep.437
info: | scratch.cpp:228: Turret.443 now targeting Creep.437
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:78:
--- Tick[1] time[2.031005] ---
info: | scratch.cpp:134: Creep.436 located at [0.000000, 0.000000]
info: | scratch.cpp:134: Creep.437 located at [0.000000, 0.000000]
info: | scratch.cpp:134: Creep.438 located at [0.000000, 0.000000]
info: | scratch.cpp:185: Sending payload from Turret.440 to Creep.438
info: | | scratch.cpp:192: Damage
info: | scratch.cpp:185: Sending payload from Turret.441 to Creep.438
info: | | scratch.cpp:192: Damage
info: | scratch.cpp:185: Sending payload from Turret.442 to Creep.437
info: | | scratch.cpp:192: KnockBack
info: | scratch.cpp:185: Sending payload from Turret.443 to Creep.437
info: | | scratch.cpp:192: Damage
info: | | scratch.cpp:192: KnockBack
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:152: Damaged Creep.438 for 1.000000 19.000000/20.000000
info: scratch.cpp:152: Damaged Creep.438 for 1.000000 18.000000/20.000000
info: scratch.cpp:167: Knocking Creep.437 for [1.000000,0.000000]
info: scratch.cpp:152: Damaged Creep.437 for 5.000000 15.000000/20.000000
info: scratch.cpp:167: Knocking Creep.437 for [0.000000,1.000000]
info: scratch.cpp:78:
--- Tick[2] time[3.056674] ---
info: | scratch.cpp:115: Turret.440<Attack> off cooldown
info: | scratch.cpp:115: Turret.441<Attack> off cooldown
info: | scratch.cpp:134: Creep.436 located at [0.000000, 0.000000]
info: | scratch.cpp:134: Creep.437 located at [1.000000, 1.000000]
info: | scratch.cpp:134: Creep.438 located at [0.000000, 0.000000]
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:78:
--- Tick[3] time[4.113907] ---
info: | scratch.cpp:115: Turret.442<Attack> off cooldown
info: | scratch.cpp:134: Creep.436 located at [0.000000, 0.000000]
info: | scratch.cpp:134: Creep.437 located at [1.000000, 1.000000]
info: | scratch.cpp:134: Creep.438 located at [0.000000, 0.000000]
info: | scratch.cpp:185: Sending payload from Turret.440 to Creep.438
info: | | scratch.cpp:192: Damage
info: | scratch.cpp:185: Sending payload from Turret.441 to Creep.438
info: | | scratch.cpp:192: Damage
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:152: Damaged Creep.438 for 1.000000 17.000000/20.000000
info: scratch.cpp:152: Damaged Creep.438 for 1.000000 16.000000/20.000000
info: scratch.cpp:78:
--- Tick[4] time[5.158010] ---
info: | scratch.cpp:115: Turret.443<Attack> off cooldown
info: | scratch.cpp:115: Turret.440<Attack> off cooldown
info: | scratch.cpp:115: Turret.441<Attack> off cooldown
info: | scratch.cpp:134: Creep.436 located at [0.000000, 0.000000]
info: | scratch.cpp:134: Creep.437 located at [1.000000, 1.000000]
info: | scratch.cpp:134: Creep.438 located at [0.000000, 0.000000]
info: | scratch.cpp:185: Sending payload from Turret.442 to Creep.437
info: | | scratch.cpp:192: KnockBack
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:167: Knocking Creep.437 for [1.000000,0.000000]
info: scratch.cpp:78:
--- Tick[5] time[6.169840] ---
info: | scratch.cpp:134: Creep.436 located at [0.000000, 0.000000]
info: | scratch.cpp:134: Creep.437 located at [2.000000, 1.000000]
info: | scratch.cpp:134: Creep.438 located at [0.000000, 0.000000]
info: | scratch.cpp:185: Sending payload from Turret.440 to Creep.438
info: | | scratch.cpp:192: Damage
info: | scratch.cpp:185: Sending payload from Turret.441 to Creep.438
info: | | scratch.cpp:192: Damage
info: | scratch.cpp:185: Sending payload from Turret.443 to Creep.437
info: | | scratch.cpp:192: Damage
info: | | scratch.cpp:192: KnockBack
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:152: Damaged Creep.438 for 1.000000 15.000000/20.000000
info: scratch.cpp:152: Damaged Creep.438 for 1.000000 14.000000/20.000000
info: scratch.cpp:152: Damaged Creep.437 for 5.000000 10.000000/20.000000
info: scratch.cpp:167: Knocking Creep.437 for [0.000000,1.000000]
info: scratch.cpp:78:
--- Tick[6] time[7.211511] ---
info: | scratch.cpp:115: Turret.442<Attack> off cooldown
info: | scratch.cpp:115: Turret.440<Attack> off cooldown
info: | scratch.cpp:115: Turret.441<Attack> off cooldown
info: | scratch.cpp:134: Creep.436 located at [0.000000, 0.000000]
info: | scratch.cpp:134: Creep.437 located at [2.000000, 2.000000]
info: | scratch.cpp:134: Creep.438 located at [0.000000, 0.000000]
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:78:
--- Tick[7] time[8.267222] ---
info: | scratch.cpp:134: Creep.436 located at [0.000000, 0.000000]
info: | scratch.cpp:134: Creep.437 located at [2.000000, 2.000000]
info: | scratch.cpp:134: Creep.438 located at [0.000000, 0.000000]
info: | scratch.cpp:185: Sending payload from Turret.442 to Creep.437
info: | | scratch.cpp:192: KnockBack
info: | scratch.cpp:185: Sending payload from Turret.440 to Creep.438
info: | | scratch.cpp:192: Damage
info: | scratch.cpp:185: Sending payload from Turret.441 to Creep.438
info: | | scratch.cpp:192: Damage
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:167: Knocking Creep.437 for [1.000000,0.000000]
info: scratch.cpp:152: Damaged Creep.438 for 1.000000 13.000000/20.000000
info: scratch.cpp:152: Damaged Creep.438 for 1.000000 12.000000/20.000000
info: scratch.cpp:78:
--- Tick[8] time[9.311009] ---
info: | scratch.cpp:115: Turret.443<Attack> off cooldown
info: | scratch.cpp:115: Turret.440<Attack> off cooldown
info: | scratch.cpp:115: Turret.441<Attack> off cooldown
info: | scratch.cpp:134: Creep.436 located at [0.000000, 0.000000]
info: | scratch.cpp:134: Creep.437 located at [3.000000, 2.000000]
info: | scratch.cpp:134: Creep.438 located at [0.000000, 0.000000]
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:78:
--- Tick[9] time[10.356709] ---
info: | scratch.cpp:115: Turret.442<Attack> off cooldown
info: | scratch.cpp:134: Creep.436 located at [0.000000, 0.000000]
info: | scratch.cpp:134: Creep.437 located at [3.000000, 2.000000]
info: | scratch.cpp:134: Creep.438 located at [0.000000, 0.000000]
info: | scratch.cpp:185: Sending payload from Turret.443 to Creep.437
info: | | scratch.cpp:192: Damage
info: | | scratch.cpp:192: KnockBack
info: | scratch.cpp:185: Sending payload from Turret.440 to Creep.438
info: | | scratch.cpp:192: Damage
info: | scratch.cpp:185: Sending payload from Turret.441 to Creep.438
info: | | scratch.cpp:192: Damage
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:152: Damaged Creep.437 for 5.000000 5.000000/20.000000
info: scratch.cpp:167: Knocking Creep.437 for [0.000000,1.000000]
info: scratch.cpp:152: Damaged Creep.438 for 1.000000 11.000000/20.000000
info: scratch.cpp:152: Damaged Creep.438 for 1.000000 10.000000/20.000000
info: scratch.cpp:78:
--- Tick[10] time[11.399392] ---
info: | scratch.cpp:115: Turret.440<Attack> off cooldown
info: | scratch.cpp:115: Turret.441<Attack> off cooldown
info: | scratch.cpp:134: Creep.436 located at [0.000000, 0.000000]
info: | scratch.cpp:134: Creep.437 located at [3.000000, 3.000000]
info: | scratch.cpp:134: Creep.438 located at [0.000000, 0.000000]
info: | scratch.cpp:185: Sending payload from Turret.442 to Creep.437
info: | | scratch.cpp:192: KnockBack
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:167: Knocking Creep.437 for [1.000000,0.000000]
info: scratch.cpp:78:
--- Tick[11] time[12.414394] ---
info: | scratch.cpp:134: Creep.436 located at [0.000000, 0.000000]
info: | scratch.cpp:134: Creep.437 located at [4.000000, 3.000000]
info: | scratch.cpp:134: Creep.438 located at [0.000000, 0.000000]
info: | scratch.cpp:185: Sending payload from Turret.440 to Creep.438
info: | | scratch.cpp:192: Damage
info: | scratch.cpp:185: Sending payload from Turret.441 to Creep.438
info: | | scratch.cpp:192: Damage
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:152: Damaged Creep.438 for 1.000000 9.000000/20.000000
info: scratch.cpp:152: Damaged Creep.438 for 1.000000 8.000000/20.000000
info: scratch.cpp:78:
--- Tick[12] time[13.442084] ---
info: | scratch.cpp:115: Turret.443<Attack> off cooldown
info: | scratch.cpp:115: Turret.442<Attack> off cooldown
info: | scratch.cpp:115: Turret.440<Attack> off cooldown
info: | scratch.cpp:115: Turret.441<Attack> off cooldown
info: | scratch.cpp:134: Creep.436 located at [0.000000, 0.000000]
info: | scratch.cpp:134: Creep.437 located at [4.000000, 3.000000]
info: | scratch.cpp:134: Creep.438 located at [0.000000, 0.000000]
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:78:
--- Tick[13] time[14.486403] ---
info: | scratch.cpp:134: Creep.436 located at [0.000000, 0.000000]
info: | scratch.cpp:134: Creep.437 located at [4.000000, 3.000000]
info: | scratch.cpp:134: Creep.438 located at [0.000000, 0.000000]
info: | scratch.cpp:185: Sending payload from Turret.443 to Creep.437
info: | | scratch.cpp:192: Damage
info: | | scratch.cpp:192: KnockBack
info: | scratch.cpp:185: Sending payload from Turret.442 to Creep.437
info: | | scratch.cpp:192: KnockBack
info: | scratch.cpp:185: Sending payload from Turret.440 to Creep.438
info: | | scratch.cpp:192: Damage
info: | scratch.cpp:185: Sending payload from Turret.441 to Creep.438
info: | | scratch.cpp:192: Damage
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:152: Damaged Creep.437 for 5.000000 0.000000/20.000000
info: scratch.cpp:127: Killing Creep.437
info: scratch.cpp:152: Damaged Creep.438 for 1.000000 7.000000/20.000000
info: scratch.cpp:152: Damaged Creep.438 for 1.000000 6.000000/20.000000
info: scratch.cpp:78:
--- Tick[14] time[15.516481] ---
info: | scratch.cpp:115: Turret.440<Attack> off cooldown
info: | scratch.cpp:115: Turret.441<Attack> off cooldown
info: | scratch.cpp:134: Creep.436 located at [0.000000, 0.000000]
info: | scratch.cpp:134: Creep.438 located at [0.000000, 0.000000]
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:78:
--- Tick[15] time[16.546555] ---
info: | scratch.cpp:115: Turret.442<Attack> off cooldown
info: | scratch.cpp:134: Creep.436 located at [0.000000, 0.000000]
info: | scratch.cpp:134: Creep.438 located at [0.000000, 0.000000]
info: | scratch.cpp:185: Sending payload from Turret.440 to Creep.438
info: | | scratch.cpp:192: Damage
info: | scratch.cpp:185: Sending payload from Turret.441 to Creep.438
info: | | scratch.cpp:192: Damage
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:152: Damaged Creep.438 for 1.000000 5.000000/20.000000
info: scratch.cpp:152: Damaged Creep.438 for 1.000000 4.000000/20.000000
info: scratch.cpp:78:
--- Tick[16] time[17.591400] ---
info: | scratch.cpp:115: Turret.443<Attack> off cooldown
info: | scratch.cpp:115: Turret.440<Attack> off cooldown
info: | scratch.cpp:115: Turret.441<Attack> off cooldown
info: | scratch.cpp:134: Creep.436 located at [0.000000, 0.000000]
info: | scratch.cpp:134: Creep.438 located at [0.000000, 0.000000]
info: | scratch.cpp:180: Turret.442 target is dead
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:78:
--- Tick[17] time[18.648335] ---
info: | scratch.cpp:134: Creep.436 located at [0.000000, 0.000000]
info: | scratch.cpp:134: Creep.438 located at [0.000000, 0.000000]
info: | scratch.cpp:185: Sending payload from Turret.440 to Creep.438
info: | | scratch.cpp:192: Damage
info: | scratch.cpp:185: Sending payload from Turret.441 to Creep.438
info: | | scratch.cpp:192: Damage
info: | scratch.cpp:180: Turret.443 target is dead
info: | scratch.cpp:228: Turret.442 now targeting Creep.438
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:152: Damaged Creep.438 for 1.000000 3.000000/20.000000
info: scratch.cpp:152: Damaged Creep.438 for 1.000000 2.000000/20.000000
info: scratch.cpp:78:
--- Tick[18] time[19.663305] ---
info: | scratch.cpp:115: Turret.440<Attack> off cooldown
info: | scratch.cpp:115: Turret.441<Attack> off cooldown
info: | scratch.cpp:134: Creep.436 located at [0.000000, 0.000000]
info: | scratch.cpp:134: Creep.438 located at [0.000000, 0.000000]
info: | scratch.cpp:185: Sending payload from Turret.442 to Creep.438
info: | | scratch.cpp:192: KnockBack
info: | scratch.cpp:228: Turret.443 now targeting Creep.436
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:167: Knocking Creep.438 for [1.000000,0.000000]
info: scratch.cpp:78:
--- Tick[19] time[20.704914] ---
info: | scratch.cpp:134: Creep.436 located at [0.000000, 0.000000]
info: | scratch.cpp:134: Creep.438 located at [1.000000, 0.000000]
info: | scratch.cpp:185: Sending payload from Turret.440 to Creep.438
info: | | scratch.cpp:192: Damage
info: | scratch.cpp:185: Sending payload from Turret.441 to Creep.438
info: | | scratch.cpp:192: Damage
info: | scratch.cpp:185: Sending payload from Turret.443 to Creep.436
info: | | scratch.cpp:192: Damage
info: | | scratch.cpp:192: KnockBack
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:152: Damaged Creep.438 for 1.000000 1.000000/20.000000
info: scratch.cpp:152: Damaged Creep.438 for 1.000000 0.000000/20.000000
info: scratch.cpp:127: Killing Creep.438
info: scratch.cpp:152: Damaged Creep.436 for 5.000000 -2.000000/3.000000
info: scratch.cpp:127: Killing Creep.436
info: scratch.cpp:78:
--- Tick[20] time[21.735649] ---
info: | scratch.cpp:115: Turret.442<Attack> off cooldown
info: | scratch.cpp:115: Turret.440<Attack> off cooldown
info: | scratch.cpp:115: Turret.441<Attack> off cooldown
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:78:
--- Tick[21] time[22.751541] ---
info: | scratch.cpp:180: Turret.442 target is dead
info: | scratch.cpp:180: Turret.440 target is dead
info: | scratch.cpp:180: Turret.441 target is dead
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:78:
--- Tick[22] time[23.796064] ---
info: | scratch.cpp:115: Turret.443<Attack> off cooldown
info: | scratch.cpp:222: Turret.442 found no more creeps
info: | scratch.cpp:222: Turret.440 found no more creeps
info: | scratch.cpp:222: Turret.441 found no more creeps
info: scratch.cpp:86: --- End Tick ---
info: scratch.cpp:283: Done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment