How do I Push down one object with another

Just started using Construct 2? Post your questions here

Post » Wed Feb 08, 2017 7:30 am

Hi

I know this is going to be "simple" :) to do but I am trying to apply the effect that when object A drops on top of object B , it pushes object B down and for a period or amount that has been applied, stays with it and then will be destroyed.

This is difficult to explain so I hope I have made some sense of this :)
Regards

TimCS
B
23
S
8
Posts: 130
Reputation: 1,917

Post » Wed Feb 08, 2017 8:21 am

How do you move object A ?
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed Feb 08, 2017 9:37 am

timcs wrote:Hi

I know this is going to be "simple" :) to do but I am trying to apply the effect that when object A drops on top of object B , it pushes object B down and for a period or amount that has been applied, stays with it and then will be destroyed.

This is difficult to explain so I hope I have made some sense of this :)


Object B is getting squashed and destroyed?
One way to do it would be to give Object B an instance variable: HP = 100

Object A [is on top of Obj B.] | Object B HP - 1
^ Many ways to do this.
If Object B HP <= 0 | Destroy Object B

You can also set Object B.Height to: Current_HP*ObjectB.Height / Max_HP
That way it will appear like Object B is getting crushed.
Image Image Image
B
29
S
11
G
27
Posts: 730
Reputation: 17,002

Post » Wed Feb 08, 2017 12:18 pm

99Instances2Go wrote:How do you move object A ?


Physics is off then on click physics is on and it drops down onto of it


Object B is getting squashed and destroyed?


No Object A is destroyed after pushing object B down by X amount of pixels etc does that make a difference to your example ?
Regards

TimCS
B
23
S
8
Posts: 130
Reputation: 1,917

Post » Wed Feb 08, 2017 12:31 pm

Thats gonna be hard to do. With physics. Sorry for retreading.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed Feb 08, 2017 6:24 pm

99Instances2Go wrote:Thats gonna be hard to do. With physics. Sorry for retreading.


@99Instances2Go

Just to make you aware of what I am trying to achieve and perhaps the way I am going about this could be changed. Basically I have an object lets say that is object_A which moves across the screen and moves down by X pixels once it leaves the screen and comes back around. There are a series of objects_C across the screen like buildings but I am currently using coloured boxes for now, when a mouse click is done anyway on the screen object_B is created from an image point of object A and is dropped onto one of the objects_C.

When contact is made with object_b and object_c damage is done to object_c and so on.

I am trying out how things work with Construct 2 and I thought it would be a good idea to base this project on an old 80s game (Not sure if it would be appropriate to release these days but I would anyway due to copyright) called blitz , use to play this on the good old vic 20!!.
Regards

TimCS
B
23
S
8
Posts: 130
Reputation: 1,917

Post » Wed Feb 08, 2017 9:19 pm

Did you know that is on YouTube ?
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed Feb 08, 2017 9:25 pm

99Instances2Go wrote:Did you know that is on YouTube ?


I didn't know this :( as in how to make this game and with the same effect as I am after?
Regards

TimCS
B
23
S
8
Posts: 130
Reputation: 1,917

Post » Wed Feb 08, 2017 9:59 pm

B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed Feb 08, 2017 10:08 pm

timcs wrote:
99Instances2Go wrote:Did you know that is on YouTube ?


I didn't know this :( as in how to make this game and with the same effect as I am after?


I forgot to share the link. Here goes.
https://www.youtube.com/watch?v=Vd1KcL1XzqM
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Next

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests