E
Erutan Egaro
Guest
(I am french, excuse the potential grammar errors)
Hi, I recently installed GMS2 and I went through the tutorial videos to learn how to make Space Rock with the GML. Before moving on to other videos, I wanted to polish the controls a little bit, because as good as the tutorial is, I wasn't satisfied with the clumsiness of the controls I got.
To reach this goal, my biggest issue was to create a speed "ceiling", so that the ship wouldn't go to light speed each time I held the forward key more than 3 seconds, I also wanted to reduce the speed over time so that the ship would stop if he was left without any acceleration for a time.
Here is my code for the ship object controls, those controls are in a step event. I use an azerty keyboard, those controls are mapped for ZQSD:
I tried to toy with the speed variable so far, and I haven't really been able to do anything useful.
I tried to use functions like
which worked. But once the ship reached 0 speed, the program continued to reduce it, leading to some sick reverse and an uncontrollable ship.
Does anyone has a solution? Thanks in advance.
Hi, I recently installed GMS2 and I went through the tutorial videos to learn how to make Space Rock with the GML. Before moving on to other videos, I wanted to polish the controls a little bit, because as good as the tutorial is, I wasn't satisfied with the clumsiness of the controls I got.
To reach this goal, my biggest issue was to create a speed "ceiling", so that the ship wouldn't go to light speed each time I held the forward key more than 3 seconds, I also wanted to reduce the speed over time so that the ship would stop if he was left without any acceleration for a time.
Here is my code for the ship object controls, those controls are in a step event. I use an azerty keyboard, those controls are mapped for ZQSD:
Code:
if(keyboard_check(ord("Q"))){
image_angle = image_angle+5;
}
if(keyboard_check(ord("D"))){
image_angle = image_angle-5;
}
if(keyboard_check(ord("Z"))){
motion_add (image_angle, 0.05);
}
if(keyboard_check(ord("S"))){
{
motion_add (image_angle, -0.05);
}
}
I tried to toy with the speed variable so far, and I haven't really been able to do anything useful.
I tried to use functions like
Code:
if(speed<= 8) { speed -=5;}
Does anyone has a solution? Thanks in advance.