Collision in specific point

Get help using Construct 2

Post » Mon Sep 19, 2016 9:01 am

Hi guys,

I have 2 sprite, first jackhammer and second rock, i need when jackhammer collision up the rock start a animation. any can help me?
If i set aimage points called Hit can i use for check that?
B
10
Posts: 53
Reputation: 460

Post » Mon Sep 19, 2016 9:58 am

Have you tried it? Seems like you already know what you're doing.
B
47
S
17
G
81
Posts: 2,221
Reputation: 48,089

Post » Mon Sep 19, 2016 11:04 am

Command:
When jackhammer collision to rock -> set animation
And is OK, but when can I set collision with image point 1 or 2
B
10
Posts: 53
Reputation: 460

Post » Mon Sep 19, 2016 11:21 am

You can use jackhammer is overlapping at offset rock > offset x is jackhammer.imagepointx, offset y is jackhammer.imagepointy
B
47
S
17
G
81
Posts: 2,221
Reputation: 48,089

Post » Mon Sep 19, 2016 4:56 pm

That will move jackhammer to jackhammer.X + (the offset eh)jackhammer.imagepointX and jackhammer.Y + ((the offset)jackhammer.imagepointY, see if it overlaps, true or false, and moves it back to jackhammer.X and jackhammer.Y.

What you really want is ...
Offset at (x) = jackhammer.X - jackhammer.imagepointX
Offset at (y) = jackhammer.Y - jackhammer.imagepointY

Offset = a distance with world zero's at sprite.X and sprite.Y.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Mon Sep 19, 2016 11:30 pm

This is why I shouldn't answer posts before coffee, also I misread what was wanted, I don't even use that method at all. I normally use Pick overlapping object > jackhammer overlapping rock.imagepointx, rock.imagepointy.
B
47
S
17
G
81
Posts: 2,221
Reputation: 48,089

Post » Tue Sep 20, 2016 8:22 am

Me 2 ... a very powerfull condition.

Especialy because. If you use 'overlap at offset' and you want to dedect a object only below that base object (while others can be on the side or on top) it will not work. Unless you size that base object before the overlap and size it back after the overlap.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue Sep 20, 2016 9:10 am

Can you help me with that capx?

http://s000.tinyupload.com/index.php?fi ... 9750383676

the problem is shape of rock
B
10
Posts: 53
Reputation: 460

Post » Tue Sep 20, 2016 5:25 pm

None of your animation frames have the same size, nor a origin on the same place, nor the same imagepoint in every frame.
Cant work that way.

https://www.dropbox.com/s/6hg7wrfoloxf5 ... .capx?dl=0

That solves your collision thingy.
Dont really like the combination drag and drop/physics. Stone flys every way he likes. Drag gets interrupted by grafity.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed Sep 21, 2016 1:48 pm

thanks you, and for you how can i use gravity with drag mode ? because i tried to do that : when jackhammer overlapping arrow scroll to first point ( its one big layout), but drag not work
B
10
Posts: 53
Reputation: 460

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 11 guests