I don't really know how to title it, but this is my problem. In my PlayerShotPlain class (the actor for the projectile the player shoots) I have the following method
When I try to compile it says "cannot find symbol - method damageEnemy(double)".
I believe this is because "Enemy.class" is not actually anything, it is just the superclass for all of the enemies. I thought that when I got the intersecting object it would return the specific type of enemy.
I see three solutions:
1. Figure out how to make it find the specific type of enemy and damage it
2. Make multiple if statements, one for each type of enemy (which would add versatility)
3. Make a new superclass called "Projectiles" that will hold this method, then each type of shot doesn't need the method.
I'm going to work on solution 3, but if solution 1 is possible, please tell me :D!
private void checkHitEnemy() { if(getOneIntersectingObject(Enemy.class) != null) { enemy = (Enemy) getOneIntersectingObject(Enemy.class); enemy.damageEnemy(1 * stats.damageLevel); } }