Object slide away

Get help using Construct 2

Post » Thu Oct 08, 2015 12:17 am

How to create objects for a top down game in which when the player collides with them, they just bounce off to a certain distance? And other one : How to push objects away when u collide with them?
Burry me with my empty hands sticking out the ground, so that all can see, that the one who had the world on his hands, died with them empty.
B
19
S
4
G
4
Posts: 135
Reputation: 3,074

Post » Thu Oct 08, 2015 2:23 am

There are Physics objects. And also there is a Custom movement behaviors with a "Push out solid". Tinker with them and you may come up with something.

You might use a bullet behavior, and have it enabled for a few seconds after the player collides with it. Once the player collides with it, have it enable bullet, and the bullet set angle -180 degrees from the players angle. leave bounce off solids enabled, and after the timer is up, disable the bullet so it eventually stops. You can use the bullet distance traveled to start a fadeout, or just destroy them too.
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Thu Oct 08, 2015 11:08 am

Tried using bullet as you explained and I tried using push out solid, neither worked for me, thanks anyway.
Burry me with my empty hands sticking out the ground, so that all can see, that the one who had the world on his hands, died with them empty.
B
19
S
4
G
4
Posts: 135
Reputation: 3,074

Post » Thu Oct 08, 2015 2:51 pm

I guess you'd have to creat a player on collision with object event..
If you want the player to bounce of of the object, using the bullet behaviour as described above should work perfectly, if implemented right..
Another way would be to use any other kind of movement behaviour, or even code your own movement..
Just be sure to disable user input for the normal behaviour..

to push something on collision, you could add the pin behaviour..
Adding an is pinned, player set speed to 0.5 * the normal speed or something..

There are so many ways to achieve the wanted results, depending on your needs and wishes, you'd have to be more precise as to what you want and how your events are set up right now, to get a better explanation..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Oct 08, 2015 3:50 pm

Here ya go: @DeRock


UPDATED BELOW

Sorry for the -180 thing. I dont know what I was thinking.

You can do the same concept with a physics object. Make sure you disable them when you dont actually need them, so the CPU can do other things in the game.

The best design would have static Proxy balls that the player triggered, then the proxy Destroys and the bullet spawns... When it gets too slow it spawns another proxy and destroys itself.

Can make a neat soccer/football game with the above template. There is a lot of great controls for the bullet.

This method is also great because the player is not a Solid, or a physics object! This is a MAJOR mistake new people make.

Like @LittleStain was explaining, there are lots of ways to get the look you are after. The hard part is picking the right one for your situation.
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Thu Oct 08, 2015 7:31 pm

@DeRock

OK here is an update!
https://mega.nz/#!pZ5HxYDS!LOhvtXixVcuJ ... Whfi-RT-Us

I added boxes with an "avoidance" script. All of the things it avoids are in the NoOverlap family.

The balls also do an avoidance to No-Overlap. This makes a really CPU cheap fake physics system.

The boxes are not solid, nor are they Physics objects or Bullets.

You can use collision at offset too, but that gets really expensive , really fast.

@LittleStain That Pin thing is brilliant! I am going to use it sometime :)
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Fri Oct 09, 2015 12:47 am

@jojoe Thanks man for everything, but unfortunately it says that the link above is broken :(
Burry me with my empty hands sticking out the ground, so that all can see, that the one who had the world on his hands, died with them empty.
B
19
S
4
G
4
Posts: 135
Reputation: 3,074

Post » Fri Oct 09, 2015 2:02 am

Crap, no idea what went wrong, here is a new link:
https://mega.nz/#!FMAmjABQ!TCDEeNrkPNK2 ... vp9F3ONIjM

Let me know if that works for you @DeRock
B
29
S
8
G
4
Posts: 767
Reputation: 5,985


Return to How do I....?

Who is online

Users browsing this forum: draiza and 8 guests