From 936e7fc06959752865f8c2a6b9d86f9c99c7b9f4 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 21 Apr 2019 20:50:20 +0200 Subject: [PATCH] rogueviz::flocking:: flock shape can now be changed via command line --- rogueviz-flocking.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rogueviz-flocking.cpp b/rogueviz-flocking.cpp index b6a2ff74..6f95d72d 100644 --- a/rogueviz-flocking.cpp +++ b/rogueviz-flocking.cpp @@ -67,6 +67,8 @@ namespace flocking { ld check_range = 2.5; + char shape = 'b'; + vector > lines; // parameters of each boid @@ -112,7 +114,7 @@ namespace flocking { vd.name = its(i+1); vd.cp = dftcolor; vd.cp.color2 = ((hrand(0x1000000) << 8) + 0xFF) | 0x808080FF; - vd.cp.shade = 'b'; + vd.cp.shade = shape; vd.m->vel = ini_speed; } @@ -306,6 +308,11 @@ namespace flocking { else if(argis("-flockfollow")) { shift(); follow = argi(); } + else if(argis("-flockshape")) { + shift(); shape = argcs()[0]; + for(int i=0; i