(solved)How do I use overlapping at offset correctly?

Get help using Construct 2

Post » Wed May 06, 2015 8:53 am

It seems that what ever i do, it works only in the left and top sides of the sprite, but i need to have the offset area all around the object... :/
Last edited by sorbias on Wed May 06, 2015 1:24 pm, edited 1 time in total.
B
11
S
1
Posts: 63
Reputation: 658

Post » Wed May 06, 2015 10:19 am

You can also use negative values for the offset check, maybe that way you can make it work for the other two sides. But without looking at the code it is hard to know what the problem is.

Is overlapping another object
Is overlapping at offset
True if any instance is overlapping any instance of another object. The collision polygons are taken in to account if set, as well as the object's size and rotation. The 'offset' variant will test for an overlap at an offset from the first object. For example, testing for an overlap at an offset of (100, 0) will temporarily move the object to the right 100 pixels, test for the overlap, then move it back again.
B
6
S
2
Posts: 15
Reputation: 589

Post » Wed May 06, 2015 12:58 pm

this is my "code" Image
B
11
S
1
Posts: 63
Reputation: 658

Post » Wed May 06, 2015 1:23 pm

Is there any reason you are using overlapping at offset, instead of the normal one or the in build collision detection?

What that code is doing is internally moving Dexter origin position 30px to the right and down. Then checking if the two object polygons overlap, Dexter (moved) and ydinjate in its current position. That is why it fires up when the object comes from the top left.
B
6
S
2
Posts: 15
Reputation: 589

Post » Wed May 06, 2015 1:24 pm

Ok, i figured it out. Thans for rf900. :)

This program is lagging for some good documentation. I would give few hours easily for some good video tutorials.

edit: the reason why am i using offset is that i need to simulate "radiation" of that nuclear pollution sprite. So it kills you slowly from little away.
B
11
S
1
Posts: 63
Reputation: 658

Post » Wed May 06, 2015 2:35 pm

You should do a distance check then, much simpler. Use System's "Pick by comparison", select object "waste barrel", distance(Dexter.X, Dexter.Y, barrel.X, barrel.Y), comparison <= 30. If the picking operation select at least one barrel, it'll execute the actions.

Moreover, instead of the wait 0.4 second, you should add a "every 0.4 second", I believe that will behave more like you intended.
B
75
S
31
G
27
Posts: 1,000
Reputation: 20,735


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 29 guests