Collision Detection between two images in Java

I think your problem is that you are not using good OO design for your player and enemies. Create two classes: Your Player should have X,Y,Width,and Height variables. Your enemies should as well. In your game loop, do something like this (C#): To speed things up, don’t bother checking if the enemies coords are offscreen.