Files
pong/scenes/playground/racket/Racket.gd
T
2024-03-12 14:41:35 +01:00

12 lines
271 B
GDScript

extends RigidBody2D
const SPEED = 300.0
func _physics_process(delta):
if Input.is_action_pressed(get_meta("UP_KEY")):
move_and_collide(Vector2.UP * SPEED * delta)
if Input.is_action_pressed(get_meta("DOWN_KEY")):
move_and_collide(Vector2.DOWN * SPEED * delta)