pandemonium_demo_projects/2d/pong/logic/ceiling_floor.gd

8 lines
185 B
GDScript

extends Area2D
export var _bounce_direction = 1
func _on_area_entered(area):
if area.name == "Ball":
area.direction = (area.direction + Vector2(0, _bounce_direction)).normalized()