The code shown has only one problem: it is written by a non-programmer who is probably not even trying to became one. Even a very bad programmer will never write down 29 lines of code which are nearly identical. You are simply not getting what is programming for. It is all about abstraction.
Now, it looks like you have identical school assignment for a group (see below). If this is so, what kind of school is that?
Anyway, I saw an identical questions here at CodeProject and answered in detail, please see:
How to make the eyes move according to the cursor of the mouse?[
^].
You need a radical change in how you approach to learning programming or maybe a different kind of career. Maybe your school does not help you, but the attempt shown in this post is not good enough even if you had no school. Sorry for not very encouraging words, but I really would like to help you.
—SA