Target Combat coding

Started by Furwerkstudio, Sat 19/08/2017 23:21:57

Previous topic - Next topic

Furwerkstudio

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.

Code: ags

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);
}
}

Kitty Trouble

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.

SMF spam blocked by CleanTalk