# How to get the movement of the Space Pilot spacecraft?

Show 40 post(s) from this thread on one page
Page 1 of 2 1 2 Last
• 9th November 2021, 01:32 PM
daryuss
How to get the movement of the Space Pilot spacecraft?
Hi.
I tried to do the eight-way "rotary" motion to get the same motion as the space pilot spacecraft:
I almost succeeded, but I can't get it to stop by pressing the diagonal, in the eight retention corners.
Generally degrees are used, but using a counter with the maximum value set at 32 "directions", the 8 reference directions are: 0-4-8-12-16-20-24-28. You should try using the Flags on/off method. Anyone know if there is a similar example to download?
It would also be useful for top view driving games, because the "Race car" movement is too difficult.
• 9th November 2021, 03:36 PM
fredetmumu
like that ?Attachment 30758
• 9th November 2021, 07:11 PM
daryuss
WOW. You are great, but really great. 100000 thanks!
• 9th November 2021, 08:14 PM
fredetmumu
Attachment 30759

this version is better with 90 degree and 180 degree
• 10th November 2021, 05:45 AM
daryuss
@Fredetmumu: Thanks again. Honestly, I wouldn't have gotten there! This will be very useful to me.. (I sent you a p.m.)
• 10th November 2021, 09:26 AM
MuddyMole
That seems a little buggy - rotation towards a diagonal (NE, SE, SW, NW) is twice as quick as rotating towards one of the four cardinal directions (N, E, S, W), and it's also possible to hold an angle other than the main 8 directions. It's also quite complicated.

A useful trick I've found, is to have an invisible, stationary object with an 8-direction movement, and just use that to get the direction the player's direction input - it's so much easier than having loads of similar events checking for different combinations of arrow keys being pressed, and often if the player is holding down several at the same time, you'd want to know which they pressed last, etc.

https://1drv.ms/u/s!Atq7cUIJ7uexsUxT...tG8X3?e=3ONKMT
• 10th November 2021, 12:44 PM
Patrice
Physic movement can do it without any event.
• 10th November 2021, 02:11 PM
fredetmumu
Patrice : zero lignes ! ;D
• 15th November 2021, 06:07 AM
daryuss
@MuddyMole, Patrice: Many thanks, you have been genius. Now I have to study the method to stop the rotation, once reached, of the angles 45, 135, 255, 315 (in practice, the 4 diagonals) when you leave the keys (or the joystick). Angles 0, 90, 180, 270 are now ok. Thanks again.
• 15th November 2021, 03:05 PM
fredetmumu
i just try space pilot and it seems that when you release keys, rotation stop at the actual angle and not at the next diagonal
Show 40 post(s) from this thread on one page
Page 1 of 2 1 2 Last