本文整理汇总了C++中object::SetXDir方法的典型用法代码示例。如果您正苦于以下问题:C++ object::SetXDir方法的具体用法?C++ object::SetXDir怎么用?C++ object::SetXDir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类object
的用法示例。
在下文中一共展示了object::SetXDir方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CatchBlow
func CatchBlow(int iLevel, object pObj) {
if (GetCategory(pObj) & C4D_Object && GetOCF(pObj) & OCF_Collectible && ObjectDistance(pObj)*10 < 8*Sqrt(GetDefWidth(GetID())*GetDefHeight(GetID())) ) {
pObj->~Hit();
// Reduces object speed by 90%
if (pObj) {
pObj->SetXDir(GetXDir()*5, 0, 100);
pObj->SetYDir(GetYDir()*5, 0, 100);
}
}
return _inherited(iLevel, pObj);
}
示例2: ControlUse
public func ControlUse(object clonk, int x, int y)
{
x = LandscapeWidth() / 2 + 100;
y = baseHeight - 20;
DrawParticleLine("Flash", 0,0,-GetX()+x,-GetY()+y, 3, 0, 0, 8, {Prototype = Particles_Flash(), Size = 20, R = 50, G = 50, B = 255});
// Make sure the clonk loses the attach procedure.
var action = clonk->GetAction();
if (action && clonk.ActMap[action].Procedure == DFA_ATTACH)
clonk->SetAction("Jump");
clonk->SetPosition(x, y);
clonk->SetXDir(0);
clonk->SetYDir(-5);
RemoveObject();
return 1;
}
示例3: FxLaraWalkingTimer
func FxLaraWalkingTimer(object c, proplist fx, int time)
{
var speed_factor = 50;
// Interrupted by dialogue?
if (FrameCounter() < this.anim_continue_frame) return FX_OK;
// No player joined? Stay in place for proper scenario saving.
if (!GetPlayerCount()) return FX_OK;
// Busy lifting/dropping?
if (GetEffect("IntLiftHeavy", c)) return FX_OK;
if (GetEffect("IntDropHeavy", c)) return FX_OK;
// Do we have something to carry?
if (!fx.carry_obj)
{
// Relax for a random time...
if (!Random(10))
// ...and search new work after
fx.carry_obj = fx.last_barrel = Lara_FindCarryObj(c, fx);
}
if (fx.carry_obj)
{
// need to pick it up?
if (fx.carry_obj->Contained() != c)
{
// need to walk there?
var dist = Abs(fx.carry_obj->GetX() - c->GetX());
if (dist < 10)
{
// pick up!
c->SetCommand("None");
c->SetComDir(COMD_Stop);
// short break - then pick up.
if (c->GetXDir()) return FX_OK;
c->SetXDir();
fx.carry_obj->Enter(c);
// find a target
fx.target_pos = [[220+Random(11), 311], [495+Random(51),358]][fx.carry_obj->GetX() < 350];
}
else
{
// we're close. slow down.
if (dist < 40) speed_factor = 30;