Offset and Rotation [Resolved]

For questions about using Classic.

Post » Sun May 16, 2010 9:09 pm

How would I go about spawning an object (in my case, a projectile) with an offset, but the offset is affected by rotation?

To clarify, I mean making a bullet spawn on a certain spot on an object using offsets that would work no matter the object's rotation.

I can't use imagepoints because I want dynamic spots for weapons to spawn at, and I'm not even sure you can make imagepoints in-game.

B
3
S
1
G
4
Posts: 37
Reputation: 1,299

Post » Sun May 16, 2010 9:25 pm

You can use the 'move at angle' action for this. Basically, find out what angle and what distance to move the created object when the base object is at angle zero, then add the main object's angle to the angle to move the created object.

Create sprite2 at sprite.x, sprite.y
move sprite2 at angle: initalamount+sprite.angle
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Sun May 16, 2010 9:30 pm

Ah, thanks! I am very glad I don't have to use trigonometry.
B
3
S
1
G
4
Posts: 37
Reputation: 1,299

Post » Sun May 16, 2010 9:34 pm

You do know you can have multiple image points, right?
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests