How do you make a sine sprote move towards you?

Get help using Construct 2

Post » Sun Nov 15, 2015 12:04 pm

I made a sine sprite that moved horizontically left and rigth. I gave it the bullet behavior and set it to disabled. I made the event every 10 seconds set Sine inactive set bullet enabled and bullet angle of motion to Player.Angle.
After ten seconds has passed the sprite just moves to the rigth instead of moving against the player. What's wrong here?
B
11
S
2
Posts: 262
Reputation: 1,309

Post » Sun Nov 15, 2015 2:41 pm

I'm guessing player.angle = 0
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 Nov 15, 2015 2:44 pm

You don't want to use player.angle for it is the angle of the player-object..

What you want is the angle from the position of your object to the position of the player..
One way of getting that would be to use this expression:

angle(object.x,object.y,player.x,player.y)
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


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 2 guests