help with function

Thanks for your help, you’re right. What I was trying to do was to avoid having to re-write 10 levels of my game but I realize that it needs to be done to avoid problems in the future.