How do I combine "And" vs "Or" blocks in an event?

Get help using Construct 2

Post » Fri Sep 15, 2017 10:56 am

I was trying to do something similar to the following:
Code: Select all
(hitboxPlay.Bullet.speed = 100 & hitboxPlay.Bullet.distanceTravelled = 500) 
OR
(hitboxPlayer Platform is on floor & hitboxPlayer.value =200)
OR
(hitboxPlayer Is overlapping endPoint & hitboxPlayer Platform is falling )
[do something]

Image

but I can not find any document or tutorial for this. Any way to combine "AND" vs "Or"?
B
38
S
19
G
19
Posts: 69
Reputation: 12,634

Post » Fri Sep 15, 2017 11:42 am

First two conditions on your screenshot can be written as an expression and combined into one condition.
Code: Select all
System ->Compare two values -> (hitboxPlay.Bullet.speed = 100 & hitboxPlay.Bullet.distanceTravelled = 500)  = 1


Unfortunately you can't do this with your other two AND blocks. (You probably know all this already)
So no, this isn't possible. I face the same issues in my game and have to use workarounds like boolean variables or something else.
Check out my awesome game Doptrix
B
17
S
9
G
51
Posts: 852
Reputation: 28,513


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 11 guests