Scale up and down an ellipse doesn't work within a function

Hallo, jung programmer.

Please, isolate your problem and be more specific with your question. Pasting the whole code and expecting others to read through it is not going to farm you replies.

See Guidelines—Asking Questions