# How do I destroy?

Get help using Construct 2

### » Wed Jul 29, 2015 9:54 pm

hey guys,

we all know that a square has 4 sides I will call them 1 2 3 and 4

I have a ball that will collide with this square what I want to happen is this:

if ball collides with side 1 3 destroy ball

B
11
S
2
G
1
Posts: 84
Reputation: 852

### » Wed Jul 29, 2015 10:40 pm

if the ball if significantly smaller than the square, compare their positions when they collide : you'll see of which side the ball is nearest.
you can also do this if the ball is bigger, but you'll have to take in account the speed of the ball : you determine the position of the "front" of the ball then you compare it to the position of the square.
B
8
S
1
Posts: 76
Reputation: 628

### » Wed Jul 29, 2015 10:47 pm

sounds good thank you!!
B
11
S
2
G
1
Posts: 84
Reputation: 852

### » Thu Jul 30, 2015 5:46 am

On ball collision with square
(sub event) compare 2 values ball.x > square.x -> destroy ball 3
(sub event) compare 2 values ball.x < square.x -> destroy ball 1
B
91
S
44
G
17
Posts: 1,012
Reputation: 18,562