Here are some problems for you to fix.

1. Your main is 400+ lines longs, contains multiple deeply nested loops and is generally impossible to read.

2. Object GameObject[7][15];
Create #define...