It is indeed not the nicest way. If I press the "W"-key. The entity suddenly go up. But I want to speed up to a maximum speed. This is the function right now:

Code:
function up() {
	while(height <= 1531 && !key_x) {
		height += 2*time_step;
		wait(1);
	}
}


The 2 is the maximum speed which is needed.

I hope you understand me.

Thanks in advance.