Game Development Reference
In-Depth Information
The reload action
As reloading modifies the amount of ammunition our soldier has, we can refactor the previ-
ous implementation in order to update the blackboard ammo attribute instead:
SoldierActions.lua :
function SoldierActions_ReloadUpdate(
deltaTimeInMillis, userData)
if (userData.controller:QueueLength() > 0) then
return Action.Status.RUNNING;
end
userData.blackboard:Set(
"ammo", userData.blackboard:Get("maxAmmo"));
return Action.Status.TERMINATED;
end
Search WWH ::




Custom Search