Spaceship movement by Fimbul

Get help using Construct 2

Post » Tue Oct 30, 2012 2:48 pm

If anybody is using this behaviour plugin, I need a bit of help. It's ideal for my game - I was attempting to use car movement for my spaceship but it's not really right. So I tried this and I like it, but I have a problem.

For my game, my ship is always staying at the centre of the screen. Instead of moving the ship, all the objects around the ship are moved instead to give the illusion of movement. I just group them into a family and move them in the opposite direction and speed as the ship.

This worked fine when using the car movement, but there's something about the spaceship behaviour I don't understand. Not sure if it's a bug or intentional or what to do about it.

When you point your ship to the right and move right, you have a facing of 0 degrees, but a movement angle of 180 degrees (i.e the opposite direction). Similarly, when you move left, you face 180 degrees and move at 0 degrees. I think this is similar to some of the platform behaviour built in too. In other words, the movement angle isn't the direction you moved in, but the direction you came from.

That would be no problem, except with the spaceship movement, when you move up or down, it's not reversed. When you move up, you have a facing of -90 (or 270) degrees and also a movement angle of -90. Down is 90 facing and 90 movement degrees.

So I don't know how to translate this to my objects. I can't just move them in the opposite direction or the same direction as my ship as neither translates correctly.

Any advice would be appreciated :)
B
25
S
5
G
3
Posts: 446
Reputation: 5,633

Post » Tue Oct 30, 2012 5:57 pm

Just to say that I've solved this. In case anybody has similar problems, the vectors are accessible, so you can use those directly. So in my case, I can move my background objects in the opposite direction as the vectors, which has the same result. E.G Set position of each object to 'Self.X-Ship.SpaceShip.VectorX' and the same for the Y coordinate.
B
25
S
5
G
3
Posts: 446
Reputation: 5,633

Post » Wed Oct 31, 2012 4:56 am

Thanks, Helped me!
B
18
S
1
G
1
Posts: 34
Reputation: 1,661


Return to How do I....?

Who is online

Users browsing this forum: jobel, Timedoor Indones and 24 guests