[Bug]: Enemy Projectiles are handled as green Dinos
đ Please confirm the following
- [x] I agree to follow the Code of Conduct that this project adheres to.
- [x] I checked the current issues for duplicate bugs.
â Current Behavior
If you shoot a enemy Projectile it has the same behavior as a green dino. Because the levelsystem is based on how much enemys are killed, you can get to the next level very easily/ without killing any dino. Also the projectile can drop coins too.
â Expected Behavior
If you shoot a projectile it should hav its own behavior.
đŠ Steps To Reproduce
- Start the Game
- shoot just projectiles
- get to the next level
đģ Environment
- OS: Windows 11
- Game version: 1.2.0
âšī¸ Additional information
Maybe this isn't a bug and is intended but i thought it is not how the game works.
đ Hello @Johann4002herti, thank you for your interest in Dinosaur Exploder đĻ! Please visit our âī¸ Discord server if you need help about something.
If this is a đ Bug Report, please provide a minimum reproducible example to help us debug it. If this is a đ feature request, please provide all your ideas, or better yet: a model of what you'd like to improve in the game.
- â Verify that you have well fill out the different checkboxes in the issue template.
Oh woaw, you're right, thanks for this bug issue !! @Johann4002herti
Hi, I think it is the same issue we talked about before (in the issue #169), so it will be solved when the pr #186 will be merged !
hii, i am interested in this issue. can you assign me this issue.
Last activity was in july, so I am assuming no one is working on this issue right now. I'd like to contribute here!
Hello, yes you can work on it ! Thanks !! @azure-glades
So if I've understood this correctly, the issue says that Projectile-EnemyProjectile collisions behave as intended (i.e both are removed from the world) but this also increments the total enemies killed and this causes the level to increase (hence, "shoot just projectiles, get to the next level")
After investigating, the problem appears to have been non-existent or resolved by a recent update. I performed some stuff (i've outlined them below) and could not trigger the behavior.
Here is what I have tried.
Levelling is handled by adjustLevel() which is called by isLevelUpAfterHitDino() in CollisionHandler class. It calls incrementDefeatedEnemies() from LevelManager which is responsible for updating the number of defeated enemies.
Defeated enemies can only be updated by this function.
Now, isLevelUpAfterHitDino() is only called by ProjectileGreenDinoCollision and NOT ProjectileEnemyProjectileCollision. The former handles player_projectile, dino collision and the latter handles player_projectile, dino_projectile collision. So it appears that the levelling is not affected by Projectile-EnemyProjectile collision in any way.
To check the behaviour, I also modified the shouldAdvanceLevel().
Old :
public boolean shouldAdvanceLevel() {
return defeatedEnemies >= enemiesToDefeat;
}
Modified:
public boolean shouldAdvanceLevel() {
return defeatedEnemies >= 2;
}
just to observe behaviour. (the enemiesToDefeat value is modified only during leveling up)
Again, I did not observe leveling up even when I only killed enemy projectiles.
So, yeah. It appears this issue doesnt exist or has been fixed in a previous update.
@jvondermarck what should i do next đ
Oh yes thanks for your amazing investigation ! Indeed, indeed, I tried the game now, and it looks like it has been resolved in a last update, probably during the big refactor we did ! Thanks so much for your contribution and I will close this issue, thanks so much @azure-glades