How do I make a sprite to fly around the player

Get help using Construct 2

Post » Sun Sep 28, 2014 8:06 am

Hi im trying to make an object fly around the player and move off to attack enemies when they come into range. I only able to set the object to face and move towards the player but the object will stop right at the point of origin of the player.

Can anyone help ?
B
7
Posts: 30
Reputation: 333

Post » Sun Sep 28, 2014 8:36 am

As always there are multiple ways to do this, some involve a lot of math and some are pretty easy..

Easiest way I would know of is giving the object rotate behaviour, putting the origin outside it's image and pinning it to the player..
when wanting to move it to attack, just spawn a new object with the same animation but different behaviour and destroy the rotating one..

While this is probably the easiest way, it might not be the best performance-wise..
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 » Sun Sep 28, 2014 9:03 am

I would look into the Pin behavior, the Line of Sight Behavior, as well as the Sine Wave behavior. You should be able to do what you are looking for with those three behaviors and a little elbow grease.

Pin
https://www.scirra.com/manual/99/pin

Sine
https://www.scirra.com/manual/103/sine

LOS
https://www.scirra.com/manual/163/line-of-sight
Image
B
45
S
17
G
2
Posts: 201
Reputation: 4,471


Return to How do I....?

Who is online

Users browsing this forum: el3um4s, TylerJS and 9 guests