Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Grand |
See image.
At the beginning of the game I want the white and red circle to accelerate upwards to a set speed and then maintain that speed for the rest of the game. How can I achieve this?
Try setting a variable like game_running
to an initial value of False, and change it to True in the _ready()
function.
Then, in the _physics_process(delta)
function, have an IF statement that will check for ‘game_running’ to be True. if game_running == true:
Then, we can accelerate. We’ll need a Vector2 with a negative Y value.
We can use the clamp()
method to keep the speed within a specific range.
System_Error | 2020-04-07 16:15