当前位置: 首页>>代码示例>>C++>>正文


C++ AddScore函数代码示例

本文整理汇总了C++中AddScore函数的典型用法代码示例。如果您正苦于以下问题:C++ AddScore函数的具体用法?C++ AddScore怎么用?C++ AddScore使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了AddScore函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: switch

void GameControl::AddCompleteLines(int Lines) {
    m_completeLines += Lines;
    int diffLines = m_completeLines - m_prevLines;

    switch (diffLines) {
        case 1: //single line clear
            AddScore((m_level+1)*40);
            break;
        case 2: //double line clear
            AddScore((m_level+1)*100);
            break;
        case 3: //triple line clear
            AddScore((m_level+1)*300);
            break;
        case 4: //tetris line clear
            AddScore((m_level+1)*1200);
            break;
        default:
            break;
    }

    //increase the level if we've got enough lines and then
    //speed up the drop interval
    m_prevLines = m_completeLines;
    int currentLevel;
    currentLevel = int(m_completeLines / LINES_PER_LEVEL);
    if (currentLevel > GetLevel()) {
        m_level++;
        SetDropInterval(GetDropInterval() - (DROP_INTERVAL_INCREMENT));
        sound->Play(SOUND_LEVEL_UP);
    }
    else
        sound->Play(SOUND_CLEAR_LINE);
}
开发者ID:shiver,项目名称:heavy_metal,代码行数:34,代码来源:gamecontrol.cpp

示例2: Touch_flagonly

void Touch_flagonly( gentity_t *ent, gentity_t *other, trace_t *trace ) {

	if ( !other->client ) {
		return;
	}

	if ( ent->spawnflags & RED_FLAG && other->client->ps.powerups[ PW_REDFLAG ] ) {

		AddScore( other, ent->accuracy ); // JPW NERVE set from map, defaults to 20

		G_Script_ScriptEvent( ent, "death", "" );

		// Removes itself
		ent->touch = 0;
		ent->nextthink = level.time + FRAMETIME;
		ent->think = G_FreeEntity;
	} else if ( ent->spawnflags & BLUE_FLAG && other->client->ps.powerups[ PW_BLUEFLAG ] )   {

		AddScore( other, ent->accuracy ); // JPW NERVE set from map, defaults to 20

		G_Script_ScriptEvent( ent, "death", "" );

		// Removes itself
		ent->touch = 0;
		ent->nextthink = level.time + FRAMETIME;
		ent->think = G_FreeEntity;
	}
}
开发者ID:MAN-AT-ARMS,项目名称:iortcw-archive,代码行数:28,代码来源:g_trigger.c

示例3: HoldNoteScoreToDancePoints

void ScoreKeeperMAX2::HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore )
{
	// update dance points totals
	if( !m_pPlayerStageStats->bFailed )
		m_pPlayerStageStats->iActualDancePoints += HoldNoteScoreToDancePoints( holdScore );
	m_pPlayerStageStats->iCurPossibleDancePoints += HoldNoteScoreToDancePoints( HNS_OK );
	m_pPlayerStageStats->iHoldNoteScores[holdScore] ++;

	// increment the current total possible dance score

	m_pPlayerStageStats->iCurPossibleDancePoints += HoldNoteScoreToDancePoints( HNS_OK );

	if( holdScore == HNS_OK )
		AddScore( TNS_MARVELOUS );
	else if ( holdScore == HNS_NG )
		AddScore( TNS_GOOD ); // required for subtractive score display to work properly

	// TODO: Remove indexing with PlayerNumber
	PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
	NSMAN->ReportScore(
		pn, 
		holdScore+TNS_MARVELOUS, 
        m_pPlayerStageStats->iScore,
        m_pPlayerStageStats->iCurCombo );
}
开发者ID:Prcuvu,项目名称:StepMania-3.95,代码行数:25,代码来源:ScoreKeeperMAX2.cpp

示例4: ObeliskDie

/*
=======================================================================================================================================
ObeliskDie
=======================================================================================================================================
*/
static void ObeliskDie(gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod) {
	int otherTeam;

	otherTeam = OtherTeam(self->spawnflags);

	self->takedamage = qfalse;
	self->think = ObeliskRespawn;
	self->nextthink = level.time + g_obeliskRespawnDelay.integer * 1000;
	self->activator->s.modelindex2 = 0xff;
	self->activator->s.frame = 2;

	G_AddEvent(self->activator, EV_OBELISKEXPLODE, 0);

	if (self->spawnflags == attacker->client->sess.sessionTeam) {
		AddScore(attacker, self->r.currentOrigin, -CTF_CAPTURE_BONUS);
	} else {
		AddScore(attacker, self->r.currentOrigin, CTF_CAPTURE_BONUS);

		attacker->client->rewardTime = level.time + REWARD_TIME;
		attacker->client->ps.persistant[PERS_CAPTURES]++;
	}

	AddTeamScore(self->s.pos.trBase, otherTeam, 1);
	CalculateRanks();
	Team_CaptureFlagSound(self, self->spawnflags);
	Team_ForceGesture(otherTeam);

	teamgame.redObeliskAttackedTime = 0;
	teamgame.blueObeliskAttackedTime = 0;

	trap_SendServerCommand(-1, va("cp \"%s" S_COLOR_WHITE "\ndestroyed the %s obelisk!\n\"", attacker->client->pers.netname, TeamName(self->spawnflags)));
}
开发者ID:KuehnhammerTobias,项目名称:ioqw,代码行数:37,代码来源:g_team.c

示例5: Touch_flagonly

void Touch_flagonly (gentity_t *ent, gentity_t *other, trace_t *trace) {
	gentity_t* tmp;

	if (!other->client)
		return;
	

	if ( ent->spawnflags & RED_FLAG && other->client->ps.powerups[ PW_REDFLAG ] ) {

		if( ent->spawnflags & 4 ) {
			other->client->ps.powerups[ PW_REDFLAG ] = 0;
			other->client->speedScale = 0;
		}

		AddScore(other, ent->accuracy); // JPW NERVE set from map, defaults to 20
		//G_AddExperience( other, 2.f );

		tmp = ent->parent;
		ent->parent = other;

		G_Script_ScriptEvent( ent, "death", "" );

		G_Script_ScriptEvent( &g_entities[other->client->flagParent], "trigger", "captured" );

		ent->parent = tmp;

		// Removes itself
		ent->touch = NULL;
		ent->nextthink = level.time + FRAMETIME;
		ent->think = G_FreeEntity;
	} else if ( ent->spawnflags & BLUE_FLAG && other->client->ps.powerups[ PW_BLUEFLAG ] ) {

		if( ent->spawnflags & 4 ) {
			other->client->ps.powerups[ PW_BLUEFLAG ] = 0;
			other->client->speedScale = 0;
		}

		AddScore(other, ent->accuracy); // JPW NERVE set from map, defaults to 20

		//G_AddExperience( other, 2.f );

		tmp = ent->parent;
		ent->parent = other;

		G_Script_ScriptEvent( ent, "death", "" );

		G_Script_ScriptEvent( &g_entities[other->client->flagParent], "trigger", "captured" );

		ent->parent = tmp;

		// Removes itself
		ent->touch = NULL;
		ent->nextthink = level.time + FRAMETIME;
		ent->think = G_FreeEntity;
	}
}
开发者ID:BackupTheBerlios,项目名称:et-flf-svn,代码行数:56,代码来源:g_trigger.c

示例6: AddScore

bool Actor::Clicked(const Point p) {
	if(IsValidAddPoint(p)) {
		if (mArea.AddPoint(p)) {
			AddScore(1);
			AddScore(10*World::get_mutable_instance().PointAdded(p, mId));
			return true;
		}
	}
	return false;
}
开发者ID:opatut,项目名称:gamejam,代码行数:10,代码来源:Actor.cpp

示例7: Touch_flagonly_multiple

void Touch_flagonly_multiple(gentity_t * ent, gentity_t * other, trace_t * trace)
{
	gentity_t      *tmp;

	if(!other->client)
	{
		return;
	}

	if(ent->spawnflags & RED_FLAG && other->client->ps.powerups[PW_REDFLAG])
	{

		other->client->ps.powerups[PW_REDFLAG] = 0;
		other->client->speedScale = 0;

		AddScore(other, ent->accuracy);	// JPW NERVE set from map, defaults to 20
		//G_AddExperience( other, 2.f );

		tmp = ent->parent;
		ent->parent = other;

		G_Script_ScriptEvent(ent, "death", "");

		G_Script_ScriptEvent(&g_entities[other->client->flagParent], "trigger", "captured");
#ifdef OMNIBOT
		Bot_Util_SendTrigger(ent, NULL, va("Allies captured %s", ent->scriptName), "");
#endif

		ent->parent = tmp;
	}
	else if(ent->spawnflags & BLUE_FLAG && other->client->ps.powerups[PW_BLUEFLAG])
	{

		other->client->ps.powerups[PW_BLUEFLAG] = 0;
		other->client->speedScale = 0;

		AddScore(other, ent->accuracy);	// JPW NERVE set from map, defaults to 20

		//G_AddExperience( other, 2.f );

		tmp = ent->parent;
		ent->parent = other;

		G_Script_ScriptEvent(ent, "death", "");

		G_Script_ScriptEvent(&g_entities[other->client->flagParent], "trigger", "captured");
#ifdef OMNIBOT
		Bot_Util_SendTrigger(ent, NULL, va("Axis captured %s", ent->scriptName), "");
#endif

		ent->parent = tmp;
	}
}
开发者ID:DerSaidin,项目名称:OpenWolf,代码行数:53,代码来源:g_trigger.c

示例8: AddScore

void CObject::CheckHitRect(CBullet &bullet, CBoss &boss)
{
	for(int i = 0;i < BULLET_MAX;i++)
	{
		if(bullet.Flag[i])
		{	
			if(boss.IsExist && boss.counter > 200)
			{
				if(HitCheck(bullet.HitRect[i], boss.HitRect) )
				{
					bullet.Flag[i] = FALSE;
					
					bullet.IsRefrect[i] = FALSE;
					
					bullet.SetPosition(i);
					
					boss.CalcDamage(bullet.Attack, boss.Defence);
					
					AddScore(boss.Score);
					
				}
			}
		}
		
	}

}
开发者ID:Taka03,项目名称:Nolfeus,代码行数:27,代码来源:object.cpp

示例9: CheckShipBulletCollision

// Check if the ship's bullet has hit an invader
void CheckShipBulletCollision()
{
	for ( int i = 0; i < INVADER_ROW_COUNT; i++ )
	{
		for ( int j = 0; j < INVADER_ROW_POPULATION; j++ )
		{
			invader_t *invader = &invaders[i][j];

			if ( !invader->alive )
				continue;

			if ( bullety >= invader->y && bullety <= invader->y + invader->h )
			{
				if ( bulletx >= invader->x && bulletx <= invader->x + invader->w )
				{
					firing = false;

					invader->alive = false;

					killcount++;

					AddScore( KILLPOINTS );
					
					if ( killcount >= INVADER_ROW_COUNT * INVADER_ROW_POPULATION )
						gameover = true;

					return;
				}
			}
		}
	}	
}
开发者ID:Fraaaan14,项目名称:christopherthorne,代码行数:33,代码来源:main.cpp

示例10: Use_Target_Score

/*QUAKED target_score (1 0 0) (-8 -8 -8) (8 8 8)
"count" number of points to add, default 1

The activator is given this many points.
*/
void Use_Target_Score (gentity_t *ent, gentity_t *other, gentity_t *activator) {

	/* LQ3A */
	UNREFERENCED_PARAMETER(other);

	AddScore( activator, ent->r.currentOrigin, ent->count );
}
开发者ID:monoknot,项目名称:loaded-q3a,代码行数:12,代码来源:g_target.c

示例11: if

//分析单只
void CAndroidAI::AnalyseOne()
{
	BYTE byCard;
	int nScore;
	int nMin = 33;
	for(int i = 0;i < m_byRemainTwoCount;i++ )	//找出最差的一张牌
	{
		byCard = m_byRemainTwo[i];

		if( byCard >= 27 )						//如果是字
		{
			nScore = 2;
		}
		else if( byCard%9 == 0 || byCard%9 == 8 )	//如果是一或者九
		{
			nScore = 6;
		}
		else 
		{
			nScore = 10;
		}

		nScore += AddScore(byCard);
		if( nScore < nMin )
		{
			nMin = nScore;
			m_byBadlyCard = byCard;
		}
	}
}
开发者ID:Michael-Z,项目名称:qipai-game,代码行数:31,代码来源:AndroidAI.cpp

示例12: ObeliskTouch

static void ObeliskTouch( gentity_t *self, gentity_t *other, trace_t *trace ) {
	int			tokens;

	if ( !other->client ) {
		return;
	}

	if ( OtherTeam(other->client->sess.sessionTeam) != self->spawnflags ) {
		return;
	}

	tokens = other->client->ps.generic1;
	if( tokens <= 0 ) {
		return;
	}

	PrintMsg(NULL, "%s" S_COLOR_WHITE " brought in %i skull%s.\n",
					other->client->pers.netname, tokens, tokens ? "s" : "" );

	AddTeamScore(self->s.pos.trBase, other->client->sess.sessionTeam, tokens);
	Team_ForceGesture(other->client->sess.sessionTeam);

	AddScore(other, self->r.currentOrigin, CTF_CAPTURE_BONUS*tokens);

	// add the sprite over the player's head
	other->client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP );
	other->client->ps.eFlags |= EF_AWARD_CAP;
	other->client->rewardTime = level.time + REWARD_SPRITE_TIME;
	other->client->ps.persistant[PERS_CAPTURES] += tokens;
	
	other->client->ps.generic1 = 0;
	CalculateRanks();

	Team_CaptureFlagSound( self, self->spawnflags );
}
开发者ID:DingoOz,项目名称:Quake3-GLES-for-armv7,代码行数:35,代码来源:g_team.c

示例13: m_game

ScoreboardSurface::ScoreboardSurface(GameSurface& gameSurface)
	: m_game(gameSurface)
	, m_titleFont(nullptr, TTF_CloseFont)
	, m_font(nullptr, TTF_CloseFont)
	, m_title(nullptr, SDL_FreeSurface)
	, m_timeTitle(nullptr, SDL_FreeSurface)
	, m_timeText(nullptr, SDL_FreeSurface)
	, m_scoreTitle(nullptr, SDL_FreeSurface)
	, m_scoreText(nullptr, SDL_FreeSurface)
	, m_defaultColor({ 0xFF, 0xFF, 0x00, 0xFF })
{
	TTF_Init();
	m_titleFont.reset(TTF_OpenFont(k_font.c_str(), 48));
	SDL_assert(m_titleFont);
	m_font.reset(TTF_OpenFont(k_font.c_str(), 30));
	SDL_assert(m_font);
	m_title.reset(TTF_RenderText_Solid(m_titleFont.get(), "Grid Miner",
		SDL_Color{ 0x00, 0x00, 0x00, 0xFF }));
	SDL_assert(m_title);

	m_timeTitle.reset(TTF_RenderText_Solid(m_font.get(), "Time", 
		m_defaultColor));
	m_scoreTitle.reset(TTF_RenderText_Solid(m_font.get(), "Score", 
		m_defaultColor));
	AddScore(0);
}
开发者ID:jsfdez,项目名称:gridminer,代码行数:26,代码来源:scoreboardsurface.cpp

示例14: list

bool CScore::LoadHighScore () {
	CSPList list (520);

	Scorelist.resize(Course.CourseList.size());

	if (!list.Load (param.config_dir, "highscore")) {
		Message ("could not load highscore list");
		return false;
	}

	for (size_t i=0; i<list.Count(); i++) {
		const string& line = list.Line(i);
		string course = SPStrN (line, "course", "unknown");
		TCourse* cidx = Course.GetCourse(course);

		TScore score;
		score.player = SPStrN (line, "plyr", "unknown");
		score.points = SPIntN (line, "pts", 0);
		score.herrings = SPIntN (line, "herr", 0);
		score.time = SPFloatN (line, "time", 0);

		AddScore (cidx, score);
	}
	return true;
}
开发者ID:pseuudonym404,项目名称:tuxracer-touch,代码行数:25,代码来源:score.cpp

示例15: ObeliskDie

static void
ObeliskDie(Gentity *self, Gentity *inflictor, Gentity *attacker,
	   int damage,
	   int mod)
{
	int otherTeam;

	otherTeam = OtherTeam(self->spawnflags);
	AddTeamScore(self->s.pos.base, otherTeam, 1);
	Team_ForceGesture(otherTeam);

	CalculateRanks();

	self->takedamage = qfalse;
	self->think = ObeliskRespawn;
	self->nextthink = level.time + g_obeliskRespawnDelay.integer * 1000;

	self->activator->s.modelindex2 = 0xff;
	self->activator->s.frame = 2;

	G_AddEvent(self->activator, EV_OBELISKEXPLODE, 0);

	AddScore(attacker, self->r.currentOrigin, CTF_CAPTURE_BONUS);

	/* add the sprite over the player's head */
	attacker->client->ps.eFlags &=
		~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET |
		  EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP);
	attacker->client->ps.eFlags |= EF_AWARD_CAP;
	attacker->client->rewardTime = level.time + REWARD_SPRITE_TIME;
	attacker->client->ps.persistant[PERS_CAPTURES]++;

	teamgame.redObeliskAttackedTime = 0;
	teamgame.blueObeliskAttackedTime = 0;
}
开发者ID:icanhas,项目名称:yantar,代码行数:35,代码来源:team.c


注:本文中的AddScore函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。