RamsesCaesar / CatAmongBirds

A game where you hunt birds as a cat.
MIT License
4 stars 1 forks source link

Fix Bird movement #37

Open RamsesCaesar opened 2 years ago

RamsesCaesar commented 2 years ago

The wandering behavior of the birds is too simple. There is a bug where birds hover near the player and get stuck.

Both should be fixed.

RamsesCaesar commented 2 years ago

I worked on this today. Still no solution for the hovering bug. I will keep looking at it.

RamsesCaesar commented 2 years ago

i'm still working on this. No solution is in sight yet. On a meta-level, this shows that I need to learn 2D movement in Godot a lot better. Since this entire project is meant to show that I understand the underlying mechanics rather than just following a tutorial, learning this is far more important than reskinning the sprites, for example.

RamsesCaesar commented 1 year ago

I suspect that this code block in Bird.gd (line 58) is responsible for the bug: if softCollision.is_colliding(): velocity += softCollision.get_push_vector() * delta * 400 What it does is push the bird back when the areas collide. Apparently this happens too soon when the bird comes from above. I will do some testing and see if tweaking the area shape helps.

RamsesCaesar commented 1 year ago

This issue has been fixed with update 032273376967e67dea2e757b426287688e3836e7.

RamsesCaesar commented 1 year ago

I just noticed that it was not the Player Hurtbox at all that I modified, but instead it was the ItemSnatcher. The true cause of the bug seem to be overlapping Area2Ds that trigger the birds being repelled too early without scoring a hit. This will need further investigation.

RamsesCaesar commented 1 year ago

image I believe that I have finally found the issue. The bird's position is a lot lower than the hitbox. I will come up with a way to fix this.

RamsesCaesar commented 1 year ago

My last comment was correct. I'm 99% certain that this issue was fixed now with commit number 569dd782f9b7f78465450a6482111c1dab74d5e1.

RamsesCaesar commented 1 year ago

This issue is not actually resolved. The bird movement is still wonky, as they will harmlessly float beneath the player sometimes.