Need help on some logic - invert y position?

Get help using Construct 2

Post » 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.

Image

Thanks in advance for any replies.

Regards R
B
13
S
7
G
4
Posts: 143
Reputation: 3,581

Post » 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

Post » Mon Aug 22, 2016 4:50 pm

try

Image
Image
B
65
S
23
G
7
Posts: 1,503
Reputation: 10,892

Post » 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?

Image

Am going to try your way too korbaach, thanks!!
B
13
S
7
G
4
Posts: 143
Reputation: 3,581


Return to How do I....?

Who is online

Users browsing this forum: Anonnymitet, SashikLV, unxcellent and 7 guests