Separating angle of sprite and imagepoint.

Get help using Construct 2

Post » Tue Oct 23, 2012 9:02 pm

I'm manually setting the frame of my sprite according to the direction of movement, but in order for my bullets to spawn according to the frame, I have to adjust the angle of the imagepoint. The only problem is: I can't seem to do this without changing the angle of the frame!

So: Any way to separate the angle of the sprite and the angle of the imagepoint?
Posts: 9
Reputation: 418

Post » Tue Oct 23, 2012 9:14 pm

You can, however, instead of an imagepoint, store a position using instance variables.

if you give the sprite two extra instance variables and name them, for example: "pointX" and "pointY"

     -> set sprite.pointX to sprite.X + cos(B)*C
     -> set sprite.pointY to sprite.Y + sin(B)*C

Where B is the desired angle of the point from the origin, and C is the desired distance of the point from the origin.keepee2012-10-23 21:18:34
Posts: 469
Reputation: 4,683

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 15 guests