I'm guessing from the way your copy-and-pasted code was misformatted, that your indentation on those last three lines is incorrect. They belong to the _process()
function, and so they should be indented one more level (lined up with the other lines, such as the if
statements).
Also, note that you've spelled screensize
wrong in _ready()