Exemplo n.º 1
0
Arquivo: block.c Projeto: smorimura/ne
SHELL	void	op_block_start()
{
	csr_leupdate();

	if (blck.blkm!=BLKM_none)
		BlockInit(); else
		{
		 blck.blkm= BLKM_x;
		 blck.y_st= GetLineOffset();
		 blck.y_ed= GetLineOffset();
		 blck.x_st= csrle.lx;
		 blck.x_ed= csrle.lx;
		}
}
Exemplo n.º 2
0
int
VMBlockInitControlOps(void)
{
   int ret;

   ret = BlockInit();
   if (ret < 0) {
      Warning("VMBlockInitControlOps: could not initialize blocking ops.\n");
      return ret;
   }

   ret = SetupProcDevice();
   if (ret < 0) {
      Warning("VMBlockInitControlOps: could not setup proc device.\n");
      BlockCleanup();
      return ret;
   }

   return 0;
}
Exemplo n.º 3
0
int
_init(void)
{
   int error;

   error = mod_install(&VMBlockModlinkage);
   if (error) {
      Warning("Could not install vmblock module.\n");
      return error;
   }

   error = BlockInit();
   if (error) {
      Warning("Could not initialize blocking.\n");
      mod_remove(&VMBlockModlinkage);
      return error;
   }

   return 0;
}
Exemplo n.º 4
0
void ToTitleScreen(const bool start)
{
	countdownMs = -1;
	ResetMovement();
	MusicSetLoud(false);
	BackgroundsInit(&BG);
	Start = start;
	if (Start)
	{
		sprintf(
			WelcomeMessage,
			"%s to pause\n%s to exit",
			GetPausePrompt(), GetExitGamePrompt());
	}
	else
	{
		// Find out the result of the game
		int maxScore = 0;
		for (int i = 0; i < MAX_PLAYERS; i++)
		{
			if (players[i].Score > maxScore) maxScore = players[i].Score;
		}
		winners = 0;
		for (int i = 0; i < MAX_PLAYERS; i++)
		{
			if (!players[i].Enabled) continue;
			if (players[i].Score == maxScore)
			{
				winnerIndices[winners] = i;
				winners++;
			}
		}
		if (PlayerEnabledCount() == 1)
		{
			sprintf(
				WelcomeMessage,
				"Your score was %d!\n%s to exit",
				maxScore, GetExitGamePrompt());
		}
		else if (winners == 1)
		{
			sprintf(
				WelcomeMessage,
				"Wins with score %d!\n%s to exit",
				maxScore, GetExitGamePrompt());
		}
		else
		{
			sprintf(
				WelcomeMessage,
				"Tied with score %d!\n%s to exit",
				maxScore, GetExitGamePrompt());
		}
		HighScoresAdd(maxScore);
	}

	HighScoreDisplayInit(&HSD);

	CArrayClear(&Particles);
	SpaceReset(&space);
	// Add bottom edge so we don't fall through
	SpaceAddBottomEdge(&space);

	// Initialise players here
	for (int i = 0; i < MAX_PLAYERS; i++)
	{
		PlayerInit(&players[i], i, cpv(
			(i + 1) * FIELD_WIDTH / (MAX_PLAYERS + 1),
			FIELD_HEIGHT * 0.75f));
		playersEnabled[i] = false;
	}

	// Add platforms for players to jump off
	for (int i = 0; i < MAX_PLAYERS; i++)
	{
		BlockInit(
			&blocks[i],
			(i + 1) * FIELD_WIDTH / (MAX_PLAYERS + 1) - BLOCK_WIDTH / 2,
			BLOCK_Y,
			BLOCK_WIDTH);
	}

	GatherInput = TitleScreenGatherInput;
	DoLogic     = TitleScreenDoLogic;
	OutputFrame = TitleScreenOutputFrame;
}
Exemplo n.º 5
0
Arquivo: Block.cpp Projeto: Dzzirt/TP
Block* CreateBlock(float x, float y, int number)
{
	Block* block = new Block();
	BlockInit(*block, x, y, number);
	return block;
}