# Need help on some logic - invert y position?

Get help using Construct 2

### » Mon Aug 22, 2016 4:13 pm

Hiya,

Does this piece of coding make sense?

Basically, if B17 (player) drops bombs (space) while it is within the event 40's y coordinates, it should add 10 points to Score. That part works.

But if you drop a bomb outside the y coordinates (event 41) it should subtract 10 points from Score. For some reason 'nothing' happens, the score just stays the same.

Thanks in advance for any replies.

Regards R
B
14
S
7
G
4
Posts: 145
Reputation: 3,610

### » Mon Aug 22, 2016 4:40 pm

hi I think the problem is that you have to make an OR condition
line 40 = do something if between 40 and 120
line 41 = do something if smaller then 40 AND larger then 120 (so never)

should work if you make a blank sub event and move your two b17 lines into it and make it an OR block (right mouse button)
then move the action "subtract" into the or condition.

• System > On start of layout | system > load game from slot "brain"
• System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707

### » Mon Aug 22, 2016 4:50 pm

try

B
67
S
24
G
7
Posts: 1,519
Reputation: 11,104

### » Mon Aug 22, 2016 4:56 pm

I think it works fm4FfanAT! Thanks so much! I'm learning something new every day.

You mean like this right?

Am going to try your way too korbaach, thanks!!
B
14
S
7
G
4
Posts: 145
Reputation: 3,610