FreezingMoon / AncientBeast

The Turn Based Strategy Game/eSport. Master your beasts! 🐺
https://AncientBeast.com
GNU Affero General Public License v3.0
1.67k stars 585 forks source link

animate healthboxes on unit hover [bounty: 5 XTR] #2241

Closed DreadKnight closed 1 year ago

DreadKnight commented 1 year ago

Hovering over a unit should smoothly raise its health box a little in order to better indicate which one belongs to the unit.

verz0 commented 1 year ago

Hey, I'm new to open source and I'd like to make my first contribution to this issue. Could you please tell me in which file the code is present so that I can work on it. Thank you

DreadKnight commented 1 year ago

@verz0 Heya! I've assigned you to the issue.

Did some searching, this should be the code that deals with the health indicator:

https://github.com/FreezingMoon/AncientBeast/blob/01d7fe4fb429a15300d911a22dba2a6fe4c5e79b/src/creature.ts#L319

https://github.com/FreezingMoon/AncientBeast/blob/01d7fe4fb429a15300d911a22dba2a6fe4c5e79b/src/animations.js#L246

verz0 commented 1 year ago

ty. I'll try to make it work asap and make a pr

verz0 commented 1 year ago

@DreadKnight hey, i tried solving the issue by adding event listener to sprite so when somebody hovers over it, the health box raises up but few hexagons become un-clickable and you cannot attack the enemy unit by directly clicking on it (using space bar works though). Adding event listener to health indicator group works fine but you will have to hover over the health box to make it rise up. Will that be alright?

DreadKnight commented 1 year ago

@DreadKnight hey, i tried solving the issue by adding event listener to sprite so when somebody hovers over it, the health box raises up but few hexagons become un-clickable and you cannot attack the enemy unit by directly clicking on it (using space bar works though). Adding event listener to health indicator group works fine but you will have to hover over the health box to make it rise up. Will that be alright?

@verz0 To clear up some confusion: when we say hovering an unit we don't really mean the unit sprite itself, but the hexagons representing the unit. Hovering over the healthbox itself serves no purpose.

verz0 commented 1 year ago

@DreadKnight I've created a pr. Can you pls look into it and let me know

DreadKnight commented 1 year ago

@DreadKnight I've created a pr. Can you pls look into it and let me know

@verz0 I've noticed (I get several notifications). Will check out the new PRs soon.