Set force towards Image Point?

For questions about using Classic.

Post » Mon May 25, 2009 5:18 pm

Hello!

I'm working on a game using physics.
I just wonder how to use Set Force Towards Position to an image point. (if that's possible)

Scenario : A thruster game. I have an image point on the nose of my spacecraft. And when I steer,
I want it to add force towards the position the nose is pointing by pressing thrust key (Up arrow).

Any help would be thankfully recieved :)
B
7
G
4
Posts: 32
Reputation: 1,596

Post » Mon May 25, 2009 6:03 pm

I found the solution, Or something that works for me.

I'm making another object. Then I attach it to the spaceships image Point 1. (Calling the new object Pointer)

Making Pointer invisible on start.
Then in add force towards angle, I put

Pointer.X
Pointer.Y


And voila!
In case someone else gets this problem.
B
7
G
4
Posts: 32
Reputation: 1,596

Post » Mon May 25, 2009 6:06 pm

Even though you solved the problem, I just thought I should mention that you can get the image point locations with this:

object.ImagePointX("imagepoint")
object.ImagePointY("imagepoint")

You could use this so you don't need a dummy object.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Mon May 25, 2009 6:19 pm

Just chiming in to say that linkman's solution is a good one, I use it all the time.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon May 25, 2009 6:34 pm

Ohh, ok that sounds easyer! I alwais have a way of finding the moust difficult ways doing things:)
Thanks to both of you for you're answers!
B
7
G
4
Posts: 32
Reputation: 1,596


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests