#include "hive.h" #include "vanillahive.h" #include "bee.h" #include "cell.h" VanillaHive::VanillaHive( int w, int h ) :Hive( w, h ) { if ( !w ) w = 100; if ( !h ) h = 100; for ( int a = 0 ; a < 50 ; a++ ) { Cell* cell = new Cell(); cells.append( cell ); cell->setRad( 10 + rand() % 10 ); cell->setCharge( 3 ); switch ( a % 4 ) { case 0: cell->setPos( -40, rand() % h ); break; case 1: cell->setPos( w + 40, rand() % h ); break; case 2: cell->setPos( rand() % w, -40 ); break; case 3: cell->setPos( rand() % w, h + 40 ); break; } } for ( int a = 0 ; a < 173 ; a++ ) { Bee* bee = new Bee( this ); allbees.append( bee ); switch ( a % 4 ) { case 0: bee->setPos( -40, rand() % h ); break; case 1: bee->setPos( w + 40, rand() % h ); break; case 2: bee->setPos( rand() % w, -40 ); break; case 3: bee->setPos( rand() % w, h + 40 ); break; } } b = c = 0; } VanillaHive::~VanillaHive(void) { } void VanillaHive::doEvent() { allbees.at(b++)->setTargetCell(cells.at(c++)); b %= allbees.size(); c %= cells.size(); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 5899 | Sam Stafford |
Pushed a little more information into Settings and made graphics quality configurable. Want to see if that makes it run better on old machines... |
||
#2 | 5898 | Sam Stafford |
Added a quick and dirty settings file, and with it, a bit of configurability. Still tweaking the numbers on maximum velocity and acceleration for the bees. |
||
#1 | 5893 | Sam Stafford | Check in work to date on "hive". |