Skip to content

Tag: collision

Java Collision detection between different classes

I am making a simple game about shooting enemies and avoiding obstacles, but I have a problem with detecting collisions because I’ve got a lot of classes for every type of game object (player,enemy,obstacle,drop,bullet, etc.). And it won’t work because a doesn’t have ‘pos’, etc, so how can I do it so it works for every class? I’ve read about