Added Double Jump

gdt_s03_jumping

#1

While I was working on limiting the infinite jump problem, I thought it would be fun to arrange the platforms in different heights and have a double jump instead, not sure if this is the right way but here is how I did it:

const GRAVITY = 3500
var jumps = 0
const MAX_JUMPS = 2

func jump():
	if Input.is_action_just_pressed("ui_up") and jumps < MAX_JUMPS:
		motion.y = JUMP_SPEED
		jumps += 1
	elif is_on_floor():
		jumps = 0

#2

Nice job. That is almost exactly how I implemented double jump for my charecter as well. Id say that there isn’t really a wront way to do something as long as you get the functionality you are looking for, and it doesn’t create any bugs in your program!

Happy Godoting,
Greg