Added enemy class and put input and check input into one function