示例#1
0
void makeElimination(elim_area_p areas, int num_areas)
{
	fprintf(flog,"makeElimination start\n");
	for(int i=0;i<num_areas;i++)
	{
		elim_area area = areas[i];
		checkExplosion(area.horiz_indices,area.num_horiz);
		checkExplosion(area.verti_indices,area.num_verti);
		fprintf(flog,"area.num_horiz:%d\n",area.num_horiz);
		fprintf(flog,"area.num_verti:%d\n",area.num_verti);
		// *(jewels+area.orgin) = 0;
		if(area.num_horiz > 4 || area.num_verti > 4)//diamond
		{
			*(jewels+area.orgin) |= JEWEL_DIAMOND;
		}
		else if(area.num_horiz > 2 && area.num_verti > 2)
		{
			*(jewels+area.orgin) |= JEWEL_BOMB;
			*(jewels+area.orgin) |= JEWEL_DIR_NONE;
		}
		else if(area.num_horiz > 3)
		{
			*(jewels+area.orgin) |= JEWEL_BOMB;
			*(jewels+area.orgin) |= JEWEL_DIR_VERTI;
			fprintf(flog,"JEWEL_DIR_VERTI\n");
		}
		else if(area.num_verti > 3)
		{
			*(jewels+area.orgin) |= JEWEL_BOMB;
			*(jewels+area.orgin) |= JEWEL_DIR_HERIZ;
			fprintf(flog,"JEWEL_DIR_HERIZ\n");
		}
		else
		{
			*(jewels+area.orgin) = 0;
		}
		fprintf(flog,"area.orgin:%d\n",area.orgin);
	}
	//fillEmpty();
}
示例#2
0
// This is invoked in response to a timer interrupt.
// This code is used for everything that needs to
// use precise timing. It is split into many function
// for readability.
void timer_interrupt_handler() {

	// Increment the following counters:
	fit_timer_count++;
	debounce_timer_count++;
	alien_explosion_count++;

	checkGameOver();			// Check to see if the aliens have reached the bottom.
	alienBulletsCreate();		// Create a new alien bullet, if possible.
	saucerUpdate();				// Move the saucer.
	debounceButtons();			// Debounce the push buttons, and then move the tank and/or fire.
	checkExplosion();			// Handle alien explosions.
	updateAllBullets();			// Update both the tank and alien bullets.
	updateAlienBlock();			// Update the alien block position.
	updateSaucerFlashing();		// Update if the saucer is hit and should be flashing.
	updateTankFlashing();		// Update if the tank is hit and should be flashing.
	resetDebouncer();			// Reset the debouncer timer if no buttons are pressed.
}
示例#3
0
 void Explosion::update(float dt){
	 ++ticks;
	 spawnTime -= dt;
	 changeFrame();
	 checkExplosion();
}