Similization
Member
So what is my problem?
I want my spaceship (or sth like that) from the start of the game move in one direction with a certain speed. I used motion_set() and it works fine for me. But also i have 2 buttons to rotate spaceship (i used image_angle += *angle*). And the next step is that when player press key 'space' (for the example) the motion vector of the spaceship must be changed. And this is the main problem.
I can use motion_add() function, but if spaceship won't change direction and i will press 'space' again and again my speed will be increasing till the max speed and i don't need it.
Of course i can add if, for example:
----------------------------------------------------------
motion_add(dir, speed)
If speed > 4
motion_add(dir, -speed)
----------------------------------------------------------
But this way in different directions max speed of my spaceship will be different too. Also spaceship won't change it direction if deflection angle will be small.
I tried to find code of motion_add function, but I couldn't.
If you know how to solve this problem - please help
I want my spaceship (or sth like that) from the start of the game move in one direction with a certain speed. I used motion_set() and it works fine for me. But also i have 2 buttons to rotate spaceship (i used image_angle += *angle*). And the next step is that when player press key 'space' (for the example) the motion vector of the spaceship must be changed. And this is the main problem.
I can use motion_add() function, but if spaceship won't change direction and i will press 'space' again and again my speed will be increasing till the max speed and i don't need it.
Of course i can add if, for example:
----------------------------------------------------------
motion_add(dir, speed)
If speed > 4
motion_add(dir, -speed)
----------------------------------------------------------
But this way in different directions max speed of my spaceship will be different too. Also spaceship won't change it direction if deflection angle will be small.
I tried to find code of motion_add function, but I couldn't.
If you know how to solve this problem - please help