Game Development Reference
In-Depth Information
local currentState =
self.asms["soldier"]:GetCurrentStateName();
if (_stance == SoldierController.Stances.STAND) then
-- Slow movement to blend to a shooting pose.
if (Soldier_IsMoving(agent)) then
Soldier_SlowMovement(agent, deltaTimeInMillis);
end
-- Only request the STAND_FIRE state if not
currently
-- playing.
if (currentState ~=
Soldier.SoldierStates.STAND_FIRE) then
self.asms["soldier"]:RequestState(
Soldier.SoldierStates.STAND_FIRE);
elseif (#self.commands > 0) then
-- Continue executing till a new command is
queued.
_ClearExecutingCommand(self);
end
else
-- Slow movement at twice the rate to blend to a
shooting
-- pose.
if (Soldier_IsMoving(agent)) then
Soldier_SlowMovement(agent, deltaTimeInMillis,
2);
end
-- Only request the CROUCH_FIRE state if not
currently
-- playing.
if (currentState ~=
Soldier.SoldierStates.CROUCH_FIRE) then
self.asms["soldier"]:RequestState(
Soldier.SoldierStates.CROUCH_FIRE);
elseif (#self.commands > 0) then
Search WWH ::




Custom Search