Dead Stop

For questions about using Classic.

Post » Tue Feb 23, 2010 12:59 am

I am using a custom movement, but is there a way to tell if my sprite had drifted to a dead stop after I stop? When I let go of the power it is still gliding.

I want my ship to refuel over a sprite only if it is stopped.
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Post » Tue Feb 23, 2010 3:34 am

That depends on how your movement is setup. Would you mind posting a CAP?
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Tue Feb 23, 2010 4:49 am

[quote="linkman2004":3uihr1yc]That depends on how your movement is setup. Would you mind posting a CAP?[/quote:3uihr1yc]\


Here is an early (lame) verion while I was testing shields. but it has the movement.
http://www.box.net/shared/ds2j6akrtm
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Post » Tue Feb 23, 2010 5:18 am

Check the X and Y velocities from the physics behavior's expressions using the "Compare" condition in the system object. If both are equal to 0, your object has stopped completely.

However, it will take a little while for your ship to actually stop completely, even if it looks like it has done so. You could make it less picky by flooring the velocity values divided by ten, like so:

floor(VelocityX / 10)

I hope this helps. :)
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Tue Feb 23, 2010 5:44 am

[quote="linkman2004":3tpwamc5]

I hope this helps. :)[/quote:3tpwamc5]

I understand the concept but making Construct do it is another matter.

So I have to be over my refuel sprite, and compare both X and Y velocities. Hum....
Sometimes just code owuld be easier. LOL

I have to think about this, I am missing something,
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Post » Tue Feb 23, 2010 5:52 am

Here's an example of it in action:

Yays
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Tue Feb 23, 2010 6:00 am

I was looking for a linking word to join the X & Y you just put both blocks together!
Great example I leaned alot about construct with that. THANKS!
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Post » Tue Feb 23, 2010 4:29 pm

Hmmm. Cool.
I have to recommend, given on how this thing works, that the player would be given a deadstop button. Took a bit too much clicking around to get that ship to a dead spot over refuel.
B
2
G
2
Posts: 13
Reputation: 676

Post » Tue Feb 23, 2010 5:35 pm

Nooo This is perfect for what I needed. linkman2004 knew what I wanted and delivered!

If I wanted a dead stop button all I had to do was make my ship with less coast or just run over the spot.
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Post » Tue Feb 23, 2010 6:23 pm

Oh well. I'm assuming it a precision based exploration game... Am I right?
B
2
G
2
Posts: 13
Reputation: 676

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests