HELP - Move Sprite to another object - ADVANCED WAY

Get help using Construct 2

Post » Sun Dec 11, 2016 12:37 am

Hey folks,

I want to have this Fish to move toward the position of the fish on top left (fish counter) every time the sprite touches the fish....

http://imgur.com/a/Z1XUW

This is the event sheet for this part and none of these 2 are working how I want (i dont use both at the same time, just to illustrate)

http://imgur.com/a/cAqav

I prefer not to send the .capx ... If someone can you guide me to set the event right, I would REALLY APPRECIATE !

@plinkie , if you are around, I'm sure you can do this ;^)
B
19
S
9
Posts: 75
Reputation: 1,717

Post » Sun Dec 11, 2016 5:15 am

Maybe you could enabled the Bullet behavior of the fish upon On Collision and have it angle towards the fish in the upper corner?
B
223
S
124
G
8
Posts: 144
Reputation: 22,139

Post » Sun Dec 11, 2016 5:22 am

set angle to angle(fishtarget.x,fishtarget.y,self.x,self.y)

is fish pickedup true = move forward 10 pixels

when the fish collides with the score fish on top just destroy the fish that moves.

you will need to create a boolean on the fish that will be picked and set that bolean to true when it hits the player

CAPX
B
78
S
23
G
69
Posts: 1,353
Reputation: 44,005

Post » Sun Dec 11, 2016 7:37 am

Hello @gamecorpstudio I have just tried your solution and it almost worked for me... I think its relevante to say 2 things to fix it:

1 - the fish is a physics objects and it keeps "jumping" around and sometimes spins, so maybe thats why for me the fish doesnt go on the same direction as yours

2 - the fixed fish on the counter is a different sprite, so maybe those "self" notes on the action might have to be different?

should something be changed?

Thank you a lot for this

http://imgur.com/a/KpBU5
B
19
S
9
Posts: 75
Reputation: 1,717

Post » Sun Dec 11, 2016 7:54 am

farfetchd83 wrote:Hello @gamecorpstudio I have just tried your solution and it almost worked for me... I think its relevante to say 2 things to fix it:

1 - the fish is a physics objects and it keeps "jumping" around and sometimes spins, so maybe thats why for me the fish doesnt go on the same direction as yours

2 - the fixed fish on the counter is a different sprite, so maybe those "self" notes on the action might have to be different?

should something be changed?

Thank you a lot for this

http://imgur.com/a/KpBU5



u forgot to add on collision condition the condition is picked again. check my capx once more ul see it behaves the right way.
B
78
S
23
G
69
Posts: 1,353
Reputation: 44,005

Post » Wed Dec 14, 2016 5:41 pm

Hi again @gamecorpstudio you are right, but which of these conditions should I use?

http://imgur.com/a/DRvai
B
19
S
9
Posts: 75
Reputation: 1,717

Post » Wed Dec 14, 2016 5:54 pm

So I just did a Copy and Paste for the condition in got it, but it's still going to the wrong way, its going left never touching the other fish which is the counter... I will try to change the set angle action...
B
19
S
9
Posts: 75
Reputation: 1,717

Post » Wed Dec 14, 2016 5:56 pm

Oh maybe it is going the right way... but since the Player is always moving and the fish counter is parallax, it might not being able to touch it... i'll try something else
B
19
S
9
Posts: 75
Reputation: 1,717

Post » Wed Dec 14, 2016 6:02 pm

So i have used "Set angle to 225" degrees and now its going the right way, sometimes its not perfect depending on the player position (or the camera) but its good enough for me... Ill still try to make it perfect..

Thank a lot @gamecorpstudio for your guidance
B
19
S
9
Posts: 75
Reputation: 1,717


Return to How do I....?

Who is online

Users browsing this forum: 8tomo8, brunopalermo and 8 guests