PONG-Godot/Main.gd

14 lines
244 B
GDScript3
Raw Permalink Normal View History

2022-08-20 15:22:38 +01:00
extends Node2D
const ball := preload("res://Ball.tscn")
onready var ball_position : Vector2 = $"%Ball".position
func reset_ball():
yield(get_tree().create_timer(.5), "timeout")
$"%Ball".reset_speed()
$"%Ball".position = ball_position