Making an object move towards where it is facing

For questions about using Classic.

Post » Tue May 06, 2008 11:12 pm

http://machriderx.googlepages.com/spacesim.cap

I'm trying to make a physics based spacecraft movement but I can't seem to figure out how to thrust the "spaceship" towards (or away from) the direction it is facing. Right now, it is just moving straight up or down rather than the direction the ship is rotated towards. I tried to use coodinate of bottom edge and top edge, but that didn't work. I tried to add detectors and add force to those but that did nothing. Argh, I seem to be missing something, something very simple, yet I can't figure it out.
B
2
S
2
G
4
Posts: 153
Reputation: 1,756

Post » Tue May 06, 2008 11:34 pm

+ Key W is down
> Add force 10 * cos(.angle), 10 * sin(.angle)

+ Key S is down
> Add force 10 * cos(.angle+180), 10 * sin(.angle+180)
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518

Post » Tue May 06, 2008 11:38 pm

Ah, it was math related. I wish Math wasn't my weak point. No wonder I was stumped. Thank you so much, Ashley. I guess I really need to brush up on my Math skills, heh.
B
2
S
2
G
4
Posts: 153
Reputation: 1,756

Post » Wed May 21, 2008 9:30 pm

I made a movement like that! Instead of my math skills i used my very well developed work-around skills! I gave the spaceship an image point in the front, and added force towards that point of itself!

Have a look in the .cap! you might find other useful things!

viewtopic.php?f=4&t=738
B
8
S
2
G
5
Posts: 744
Reputation: 3,288


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest