How do I make a object hurt when hit in a specific way

Get help using Construct 2

Post » Sun Jun 14, 2015 4:23 am

so i want to make a object only when it is hit in a specific way the specific way is

Hurt
||||||
||||||Safe

Safe
_______
_______ Hurt
_______

For those who did not understand i wnt the player to get hurt only when he hits the top of the object
B
5
S
1
Posts: 60
Reputation: 495

Post » Sun Jun 14, 2015 7:40 am

Hey Ash,

you could compare the Y value of the object colliding when the event triggers, If the object is above a certain height then proceed with the action, if not then nothing will happen.
ImageImage
B
130
S
23
G
7
Posts: 1,078
Reputation: 13,280

Post » Tue Jun 16, 2015 11:12 am

@GenkiGenga
Hang on i did not understand could you write down the events or put a capx pls
B
5
S
1
Posts: 60
Reputation: 495

Post » Tue Jun 16, 2015 11:45 am

Give you a little hint, you know it from school, 5. year.

Image
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
11
S
4
G
1
Posts: 158
Reputation: 1,328

Post » Tue Jun 16, 2015 2:19 pm

@deathangel1479 I think that made even less sense.

In mario, they would check if the player was falling. if they were you could assume they are hitting from the top.
B
47
S
14
G
7
Posts: 603
Reputation: 8,141

Post » Tue Jun 16, 2015 2:25 pm

There is a much easier technique than all the maths above :P

Just use Overlapping with Offset. Suppose if sprite A is to be hit by sprite B from top. Then:

--------------------------------------------------------------------------
[A] On Collision with [B]
[A] is overlapping with [B] with offset (X: 0, Y: -2)
---------------------------------------------------------------------------

This way, once A gets collided with B, it will check 2 pixels above it if B is there or not.
B
10
S
2
Posts: 109
Reputation: 982

Post » Tue Jun 16, 2015 8:12 pm

EncryptedCow wrote:@deathangel1479 I think that made even less sense.

In mario, they would check if the player was falling. if they were you could assume they are hitting from the top.


Y, made even less sense....
capx
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
11
S
4
G
1
Posts: 158
Reputation: 1,328


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 19 guests