Open bruhmoent opened 1 month ago
I think this is a pretty nice feature, but is it possible that the air_bubble-*.png files are missing? Maybe some idea: What about using std::array for m_bubble_particles? This would make it easier to iterate over the array or do a check for bounds (e.g. when picking a random bubble).
Oh you're right, I forgot to push the bubbles.
Looks pretty nice so far. Some comments from my side:
I like the effect of them "popping" in the air. And for the bubbles not being emitted at the right place, I'm aware - but I don't know what to do about it - sometimes the sprite rotation gets registered improperly - At-least that's what I've observed.
Some suggestions:
Thanks for the suggestions!
No problem. I really like this feature, but I think there are two small tweaks to be done:
It would be great if you could have a look at these two things.
@bruhmoent Why did you not use the .sprite file I send you?
Also, I think the bubbles vertical speed could be increased by quite a bit
@bruhmoent Why did you not use the .sprite file I send you?
I just used the images - I found the .sprite file to be unnecessary? Idk how does it matter really
Sorry, but I have to slightly update my suggestion regarding how to determine the direction. From the swim sprite logic, I saw that the following code is used:
std::abs(m_swimming_angle) <= math::PI_2 ? Direction::RIGHT : Direction::LEFT
This seems to work more reliable, because it takes also negative angles into account.
While this looks nice and cartoony, I (random passerby) should warn that cartoons are often wrong, and actual penguins probably don't breathe out underwater. (Nor should any species that can't breathe in underwater, except if very close to the surface :-)
Instead of emitting periodic bubbles from their beaks, penguins might produce them through:
Therefore: I would suggest emitting the bubbles more irregularly in space and time; from the main body instead of from the beak; and maybe progressively reduce the bubble rate the longer Tux stays underwater.
SuperTux is not aimed to replicate realistic behaviours. This is just a little visual effect. This is out of scope for this PR - and this might be adjusted in the future.
SuperTux is not aimed to replicate realistic behaviours. This is just a little visual effect. This is out of scope for this PR - and this might be adjusted in the future.
Agreed. While I think foundations in reality are nice to have, in the end art and gameplay are what matter.
The bubbles are still not animated despite the sprite file having 2 action of animation. One for bigger bubbles and one for smaller ones.
This pr adds a visual effect - when Tux is underwater, he will emit bubble particles that will follow a sine pattern until they reach the water surface.
Make sure to test.