My code is not working it pops up an error is Expected Intented Block After Function Declared

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Unireket Games

extends Area2D

Called when the node enters the scene tree for the first time.

func _ready():

Called every frame. ‘delta’ is the elapsed time since the previous frame.

func _process(delta):
var velocity = Vector2.ZERO

var speed = 400

var screen_size

screen_size = get_viewport_rect().size

if Input.is_action_pressed("right"):
	velocity.x += 1
if Input.is_action_pressed("left"):
	velocity.x -= 1
if Input.is_action_pressed("up"):
	velocity.y -= 1
if Input.is_action_pressed("down"):
	velocity.y -= 1

if velocity.length() > 0:
	velocity = velocity.normalized() * speed

position += velocity * delta
position.x = clamp(position.x, 0, screen_size.x)
position.y = clamp(position.y, 0, screen_size.y)
:bust_in_silhouette: Reply From: jgodfrey

Looks like your ready() function is empty, which is not valid. Either remove it or add a pass to it.

That second suggestion looks like this:

func _ready():