Hey i want to make an object bounce when it reaches the ceiling. I know about pre defined methods, i want to make it manually.

I stuck at the point, that my object wont come back when hit the ceiling. (I used global_position, because this node is nested inside player node)

extends Area2D

var speed = 100

func _process(delta):
	if global_position.y < 0:
		global_position.y += speed * delta
	else:
		global_position.y -= speed * delta

You have to do someting a little more like this:

func _process(delta):
	if global_position.y < 0:
		speed = 100
	elif global_position.y > 500:
		speed = -100
	global_position.y += speed * delta
10 days later

the easiest way to do a reflect-bounce against an ideal flat surface, is to reverse velocity x or y(depending on the surface wall is horizontal or vertical).

e.g:
velocity.x = -velocity.x

    The easy solution by MagickPanda worked pretty well with stationary borders.

    While i am trying to figure out the mathematical approach of award , i try to reflect (bounce) several Area2D's from eachother when touching each other.
    Reverse the velocity (x & y) didnt worked out.