Indeed that is usefull. But being a newb i cant use it that well yet.
What i want to do, as stated above, is:
"when hes jumping hes going up with a constant speed. It would be much better if he started fast and the slowed down ONLY when he reaches max altitude!"
If you could help me with this I would be very thankfull!
Thank you for your help until now!
My gravity is 7 and because the negative numbers go up it cant be less then 0
I'll just show you
const UP = Vector2(0, -100)
const ACCELERATION = 500
const MAX_SPEED = 800
var motion = Vector2()
var GRAVITY= 20
var FRICTION = false
if Input. is_action_pressed("ui_right"):
motion.x = min(motion.x + ACCELERATION, MAX_SPEED)
$player.flip_h = false
elif Input. is_action_pressed("ui_left"):
motion.x = max(motion.x - ACCELERATION, -MAX_SPEED)
$player.flip_h = true
motion.x = lerp(motion.x, 0, 0.1)
FRICTION = false
motion.y += 7
if Input. is_action_just_pressed("ui_up"):
motion.y = -450
if motion.y < 0:
motion.y += GRAVITY