• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ local类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Initialize

func Initialize()
{
	leftcharge = CreateObject(Compensator_ChargeShower, 7 * GetCalcDir(), 10, NO_OWNER);
	leftcharge->Init(this);
	rightcharge = CreateObject(Compensator_ChargeShower, -6 * GetCalcDir(), 10, NO_OWNER);
	rightcharge->Init(this);
	AddTimer("EnergyCheck", 100);
	return _inherited(...);
}
开发者ID:notprathap,项目名称:openclonk-5.4.1-src,代码行数:9,代码来源:Script.c


示例2: RefreshAnimationPosition

func RefreshAnimationPosition()
{
	var charge = (power_seconds * 100) / Compensator_max_seconds;
	/*var current = GetAnimationPosition(anim);
	var len = GetAnimationLength("Charge");
	SetAnimationPosition(anim, Anim_Linear(current, current, len - (charge * len) / 100, 35, ANIM_Hold));*/
	leftcharge->To(Min(charge, 50)*2);
	rightcharge->To(Max(0, charge-50)*2);
}	
开发者ID:notprathap,项目名称:openclonk-5.4.1-src,代码行数:9,代码来源:Script.c


示例3: HomeCall

func HomeCall()
{
	ClearEffects();
	
	Sound("Ball::ball_call", false, 20);
	
	var eff = AddEffect("HomeCall", this, 1, 1, this);
	eff.x = master->GetX();
	eff.y = master->GetY();
	
	var angle = Angle(GetX(), GetY(), eff.x, eff.y, 10);
	SetVelocity(angle, Speed, 10);
}
开发者ID:TheThow,项目名称:OpenClonk-Stuff,代码行数:13,代码来源:Script.c


示例4: AttackOrder

func AttackOrder(x, y)
{
	ClearEffects();

	Sound("Ball::ball_order", false, 20);
		
	var eff = AddEffect("MoveTo", this, 1, 1, this);
	eff.x = master->GetX() + x;
	eff.y = master->GetY() + y;

	var angle = Angle(GetX(), GetY(), eff.x, eff.y, 10);
	SetVelocity(angle, Speed, 10);
}
开发者ID:TheThow,项目名称:OpenClonk-Stuff,代码行数:13,代码来源:Script.c


示例5: Destruction

func Destruction()
{
	if(partner)
		partner->LoseConnection();
	if(elevator)
		elevator->LostCase();
		
	for(var i = 0; i < 3; ++i)
	{
		var wood = CreateObject(Wood, 0, 0, NO_OWNER);
		wood->Incinerate();
		wood->SetXDir(RandomX(-10, 10));
		wood->SetYDir(RandomX(-2, 0));
	}
}
开发者ID:Meowtimer,项目名称:openclonk,代码行数:15,代码来源:Script.c


示例6: FxFollowMasterTimer

func FxFollowMasterTimer(object target, proplist effect, int time)
{
	if(!master)
	{
		KillBall();
		return -1;
	}

	MoveToPos(master->GetX(), master->GetY() - 15);
	
	
	DrawParticleLine("Flash", 0, 0, ox-GetX(), oy-GetY(), 1, 0, 0, 15, followtrailparticles);
	ox=GetX();
	oy=GetY();
}
开发者ID:TheThow,项目名称:OpenClonk-Stuff,代码行数:15,代码来源:Script.c


示例7: KillBall

func KillBall()
{
	Sound("Ball::ball_die", false, 50);
	if(rangedummy)
		rangedummy->RemoveObject();
	RemoveObject();
}
开发者ID:TheThow,项目名称:OpenClonk-Stuff,代码行数:7,代码来源:Script.c


示例8: FxParticlesDamage

func FxParticlesDamage(object target, proplist effect, int damage, int cause)
{
	if(Master)
		Master->GotDamage(damage);
		
	return 0;
}
开发者ID:TheThow,项目名称:OpenClonk-Stuff,代码行数:7,代码来源:Script.c


示例9: Initialize

func Initialize()
{
	AddEffect("CheckAutoMoveTo", this, 1, 30, this);
	AddEffect("ElevatorUpperLimitCheck", this, 1, 1, this);
	AddEffect("FetchVehicles", this, 1, 10, this);
	
	case_speed = ElevatorCase_move_speed;
	case_speed_automatic = 2 * case_speed;
	
	partner_was_synced = false;
	
	front = CreateObject(Elevator_Case_Front, 0,13, GetOwner());
	back = CreateObject(Elevator_Case_Back, 0,13, GetOwner());
	
	front->SetAction("Attach", this);
	back->SetAction("Attach", this);
}
开发者ID:Meowtimer,项目名称:openclonk,代码行数:17,代码来源:Script.c


示例10: Timer

func Timer()
{
	var pDead2, pNewTarget;
	if(!pTarget)
	{
	for(var pDead in FindObjects(Find_Action("Dead"), Find_Distance(100)))
	{
		if(GetPhase(pDead) < 4)
			if(PathFree(GetX(), GetY(), pDead->GetX(), pDead->GetY()))
			{
				pDead2 = pDead;
				break;
			}
	}
	pDead = pDead2;
	if(pDead)
	{
		for(pNewTarget in FindObjects(Find_OCF(OCF_Alive), Find_Distance(100), Find_Hostile(GetOwner(pDead))))
		{
			if(PathFree(GetX(), GetY(), pNewTarget->GetX(), pNewTarget->GetY()))
			{
				iTimer = 0;
				pTarget = pNewTarget;
			}
		}
	}
	}
	if(pTarget)
	{
		iTimer++;
		if(iTimer%10 != 0) return;
		if(iTimer > 100) pTarget = 0;
		else if(!PathFree(GetX(), GetY(), pTarget->GetX(), pTarget->GetY()) && !pTarget->Contained()) pTarget = 0;
		if(!pTarget) return;
		Message("Töte niemanden an diesem heiligen Ort!", this);
		DrawLightning(GetX(),GetY(),pTarget->GetX(), pTarget->GetY());
		Punch(pTarget, 5);
	}
}
开发者ID:Froggit,项目名称:Data_Project1_Repos2,代码行数:39,代码来源:Script.c


示例11: Check

func Check()
{
	if(!target) return RemoveObject();
  if(!update)
  {
   if(temp > 100)
   {
    Break();
   }
  }
  else
  {
   if(temp > 200)
   {
    Break();
   }
  }
  SetPosition(target->GetX()+55,target->GetY()+40);
  if(target->~IsPegasusGate() && !update)
  {
  	Update();
  }
  return(1);
}
开发者ID:maxmitti,项目名称:SGGP,代码行数:24,代码来源:Script.c


示例12: EditCursorDeselection

func EditCursorDeselection(object new_selection)
{
	// If new selection is neither this nor the taget object, ensure target removes any editor markers
	if (cb_obj && new_selection != cb_obj) cb_obj->EditCursorDeselection(new_selection);
	return true;
}
开发者ID:TheBlackJokerDevil,项目名称:openclonk,代码行数:6,代码来源:Script.c


示例13: OnMoved

func OnMoved()
{
	lx = GetX(); ly = GetY();
	if (!cb_obj) return RemoveObject();
	return cb_obj->Call(cb_fn, cb_par, lx, ly);
}
开发者ID:TheBlackJokerDevil,项目名称:openclonk,代码行数:6,代码来源:Script.c


示例14: Initialize

func Initialize()
{
	SetAction("Travel");
	SetRDir(10);
	SetObjectLayer(nil);
	//AddEffect("MoveTo", this, 1, 1, this);
	
	ox=GetX();
	oy=GetY();
	
	rangedummy = CreateObject(Dummy, 0, 0, GetOwner());
	rangedummy.Visibility = VIS_Owner;
	rangedummy->SetAction("HangOnto", this);
		var props =
		{
			R = 255,
			G = 0,
			B = 0,
			Alpha = 40,
			Size = 70,
			BlitMode = GFX_BLIT_Additive,
			Rotation = PV_Step(10, 0, 1),
			Attach = ATTACH_Back | ATTACH_MoveRelative
			
		};
	rangedummy->CreateParticle("Shockwave2", 0, 0, 0, 0, 0, props, 1);
	
	moveparticle =
	{
		Alpha = 100,
		Size = AttackSize * 2,
		R = pR,
		G = pG,
		B = pB,
		Rotation = PV_Random(0,360),
		BlitMode = GFX_BLIT_Additive,
	};
	
	moveparticle2 =
	{
		Size = PV_Linear(2,0),
		BlitMode = GFX_BLIT_Additive,
		R = pR,
		G = pG,
		B = pB,
		Attach=ATTACH_Back,
	};
	
	movetrailparticles =
	{
		Size = PV_Linear(5,0),
		BlitMode = GFX_BLIT_Additive,
		R = pR,
		G = pG,
		B = pB,
		Attach=ATTACH_Back,
	};
	
	followtrailparticles =
	{
		Size = PV_Linear(5,0),
		BlitMode = GFX_BLIT_Additive,
		R = 50,
		G = 50,
		B = 50,
		Attach=ATTACH_Back,
	};
	
	hometrailparticles =
	{
		Size = PV_Linear(5,0),
		BlitMode = GFX_BLIT_Additive,
		R = 0,
		G = 255,
		B = 255,
		Attach=ATTACH_Back,
	};
	
	hometrailparticles2 =
	{
		Size = PV_Linear(2,0),
		BlitMode = GFX_BLIT_Additive,
		R = 0,
		G = 255,
		B = 255,
		Attach=ATTACH_Back,
	};
	
	
}
开发者ID:TheThow,项目名称:OpenClonk-Stuff,代码行数:90,代码来源:Script.c


示例15: FxHomeCallTimer

func FxHomeCallTimer(object target, proplist fx, int time)
{
	if(!master)
	{
		KillBall();
		return -1;
	}	
	
	if(GetEffect("Blocked", this))
	{
		ox=GetX();
		oy=GetY();
		return;
	}
	
	DrawParticleLine("Flash", 0, 0, ox-GetX(), oy-GetY(), 1, 0, 0, 15, hometrailparticles);
	
	if(time%7 == 0)
	{
		for(var i = 0; i < 360; i+=5)
		{
			CreateParticle("Flash", Sin(i, 3), -Cos(i, 5), 0, 0, 10, hometrailparticles2, 2);
		}
	}

	fx.x = master->GetX();
	fx.y = master->GetY();
	var angle = Angle(GetX(), GetY(), fx.x, fx.y, 10);
	var txdir = Sin(angle, Speed + 12, 10);
	var tydir = -Cos(angle, Speed + 12, 10);
	SetXDir((GetXDir() + (txdir - GetXDir())/2));
	SetYDir((GetYDir() + (tydir - GetYDir())/2));
	
	CheckForEnemies(HomeCallSize);
	
	ox=GetX();
	oy=GetY();
	
	var dst = Distance(GetX(), GetY(), fx.x, fx.y);
	if(dst < 8)
	{
		AddShield(master);
		Sound("Ball::ball_shield", false, 20);
		
		var particles =
		{
			Prototype = Particles_Glimmer(),
			R = pR,
			G = pG,
			B = pB,
			Alpha = 255,
			Size = PV_Linear(10, 0),
			OnCollision = PC_Bounce(),
		};
		CreateParticle("StarSpark", 0, 0, PV_Random(-60,60), PV_Random(-60, 60), 25, particles, 5);
		
		var particle =
		{
			Alpha = PV_Linear(255, 0),
			Size = 50,
			R = pR,
			G = pG,
			B = pB,
			BlitMode = GFX_BLIT_Additive,
		};
		master->CreateParticle("StarSpark", 0, 0, 0, 0, 7, particle, 4);
		
		FollowMaster();
		return -1;
	}
}
开发者ID:TheThow,项目名称:OpenClonk-Stuff,代码行数:71,代码来源:Script.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ local_date_time类代码示例发布时间:2022-05-31
下一篇:
C++ llvm类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap