Need help with collision detection.

Hello,

I have just started playing with Java game development. After reading some articles on the web and following Bucky Roberts tutorial on YouTube this is what I have managed to come up with this amazing game.

It is a 10 x 10 grid with a greed dot representing the player, red dots representing bad guys, and black dots representing impassible terrain.

The player can be moved around using the wasd keys, the red dots move on their own, and the black dots don’t move at all.

The problem I have run into is that the green dot can move on top of the red dots and vice verse, and the red dots can move on top of each other. This should not happen. It is weird because the greed dot can only move onto the red dot on the vertical axis. It seems to work like I want and expect on the horizontal axis.

This is my first post and there is a lot of code… I hope I got it all int the pastebin correctly.