void warren::start_level() { clean(); set_counters(); for (unsigned int i=0; i<world->bars.size(); i++) { int num = 0; if (world->level_index < 1) { num = ran1_int(0, 3); } else if (world->level_index < 2) { num = ran1_int(0, 4); } else if (world->level_index < 3) { num = ran1_int(1, 5); } else { num = ran1_int(3, 5); } // printf("creating %i critter\n", num); for (int j=0; j<num; j++) { add_displaced(world->bars[i], j); // critters.back()->pos += j * (critters.back()->vel.unit() * TILE_SIZE); } } if (critters.size() == 0) { printf("adding at least 1 critter\n"); bar * b = world->bars[ran1_int(0, world->bars.size())]; add_displaced(b, 0); } }
/*----------------------------------------------------------------------- | createPS(int arrayDim) | create the acode for the Pulse Sequence. +-----------------------------------------------------------------------*/ void createPS(int arrayDim) { int i; if (ra_flag) { ra_inovaacqparms(ix); } set_counters(); /* code for HSrotor? */ new_lcinit_arrayvars(); if ( ix == getStartFidNum() ) { /* * We may have a monitor system (ILI, ISI, ...) and * we might have an MTS Grad Power Amp attached * * SAFETY CHECK & setupcode */ } /* Do initialization for RF , DDR & Gradient that happens for each FID setRF(); */ postInitScanCodes(); /* if (ix == getStartFidNum()) { ifzero(initflagrt); reset_pgdflag(); initHSlines(); endif(initflagrt); } */ arrayedshims(); /* if shims arrayed, set them again, load will be */ /* set to 'y' in arrayfuncs */ if (vttemp != oldvttemp) /* change vt setting only if it changed */ { /* why?, (because it takes time) */ setvt(); /* And it includes fifoStop/Sync */ wait4vt(); /* And this includes fifoStop/Sync */ } oldvttemp = vttemp; /* if arrayed, vttemp will get new value */ if (spin != oldspin) /* chag spin setting only if it changed */ { /* why?, (because it takes time) */ setspin(); /* And it includes fifoStop/Sync */ wait4spin(); /* And this includes fifoStop/Sync */ } oldspin = spin; /* capture elapsed time prior to pad and nt looping */ preNextScanDuration(); ifzero((oph-8)); preacqdelay(padactive); endif((oph-8)); /* ###################################################################### */ nextscan(); /* nt looping reset to this point. */ /* ###################################################################### */ loadtablecall = -1; /* initializes loadtablecall variable */ inittablevar(); /* initialize all internal table variables */ initparms_img(); /* does getval on many variables */ enableHDWshim(); /* config done internally */ setAmpBlanking(); /* if unblank mode, restore unblank */ if ( doSampling() ) { zerofid=0; pulsesequence(); /* generate Acodes from USER Pulse Sequence */ initializeSeq = 0; } else { zerofid=1; sendzerofid(arrayDim); } /* reset tables between array elements */ for (i = 0; i < MAXTABLE; i++) { tmptable_order[i] = table_order[i]; if (Table[i]->reset) reset_table(Table[i]); } return; }