I am taking the tutorial for the game "Dodge The Creeps" and i have encountered an error in scripting that i can't seem to solve. I saw where someone else had encountered a similar error and they got a reply, but i still cannot get it right. I think the tutorial should have a section where it shows the whole script like in the lesson before it, so you can see what they did and solve your problems without posting a question here.
Anyway, here is the code:
export (int) var SPEED
var Velocity = vector2
screensize = get_viewport_rect().size
velocity = Vector2()
velocity.x += 1
velocity.x -= 1
velocity.y += 1
velocity.y -= 1
if velocity.length() > 0:
velocity = velocity.normalized() * SPEED
position += velocity * delta
position.x = clamp(position.x, 0, screensize.x)
position.y = clamp(position.y, 0, screensize.y)
For some reason the program is telling me that the end bit where the position is updated has unproper indenting. I don't know why and i have tried several variations, but they all give the same error. What am i doing wrong?
Sorry for the kinda stupid question, but i'm obviously completely new to Godot and GDscript.