Trigger once with more than one other condtion

Get help using Construct 2

Post » Sun Nov 17, 2013 3:44 am

Okk, I hope I can explain well as I can't upload a capx file for now!

In my game there are friends an enemies. Player is penelised (reduce his score) when friends are attacked (double clickj). However when friend are attacked they are not destroyed like the enemies, so the player can click the same friend twice and get penalised twoce. I don't want this. I only want to penaluse the player once. How can I achielve this.
Couldn't use the trigger once cos I had like 3 condtions to test to determine friend and thwn couldn't aDd trigger once to the condition again. Help would be apprecited
B
15
S
4
Posts: 138
Reputation: 2,003

Post » Sun Nov 17, 2013 3:52 am

Use an instance variable on the friends, a boolean will work fine. Set it to false initially, and whenever player attacks friend, compare if that boolean is set (=TRUE). If so, ignore the penalty, if not (=FALSE), reduce the score and set the boolean to TRUE.tulamide2013-11-17 03:53:11
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests

cron