I've been on a combat system where an object would pop up, the player has to click on it within a time limit or else loose an inventory item, a stand-in for health.
I made up a mock code for a target, I was wondering if this will work. If you have tips to make this better I would be thankful.
function {
SetTimer(1,200):
oObjectX.Visible = true;
oObjectX.Animate(1, 2, eOnce, eNoBlock); //shows how much time player has left
if (IsTimerExpired(1) == 1) {
oObjectX.Visible = False
Character.LoseInventory(InventoryItem ItemX);
}
}
You would execute this statement in repeatedly_execute or repeatedly_execute_always:
if (IsTimerExpired(1) == 1) {
oObjectX.Visible = False
Character.LoseInventory(InventoryItem ItemX);
}
Otherwise it seems logically sound to me.