How do I - Have colliding objects slowly move away

Get help using Construct 2

Post » Thu Jul 16, 2015 6:22 am

I want to spawn a few objects, lets say 3, on a certain location.
I then want these objects to slowly give each other space between them.

I tried using "if object is overlapping object, set object X to old.X, Object Y to old.Y, but this just made them never overlap and they just jut away.

I understand I want to somehow make them move away at 1 pixel or so, and away from each other, I just don't understand how I would input this into an action.

I can use "move at angle" , but I don't know what I would input to express "Away from overlapping object"

I think I need to use Pick Nth instance on if overlapping, but how do I write sprite.x, sprite.y, - sprite,x, sprite.y if they are the same sprite?

is there something like (sprite.x, sprite.y)Nth 1 - (sprite.x, sprite.y)Nth 2 ?
B
6
S
2
Posts: 60
Reputation: 1,242

Post » Thu Jul 16, 2015 6:58 am

Heres what I have, I don't know how exactly I "rotate away from" an object.

https://www.dropbox.com/s/2dzufnutmsiy5 ... .capx?dl=0

I wonder how people shorten URLs in posts to simple words...
B
6
S
2
Posts: 60
Reputation: 1,242

Post » Thu Jul 16, 2015 7:56 pm

If anyone could point me to a tutorial that does such a thing, I would be greatly appreciative.


I understand how to move towards an object, but I don't understand what I would need to add as an action to tell said object to

Face towards object, then face directly away from it and shuffle away.

I have sprite - Set angle to sprite, but what expression allows me to face AWAY from it?

"I think I need to use Pick Nth instance on if overlapping, but how do I write sprite.x, sprite.y, - sprite,x, sprite.y if they are the same sprite?

is there something like (sprite.x, sprite.y)Nth 1 - (sprite.x, sprite.y)Nth 2 ?" <---- Still curious about this too.
B
6
S
2
Posts: 60
Reputation: 1,242


Return to How do I....?

Who is online

Users browsing this forum: Lightstone, Resslx, totoe and 29 guests