Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic enemy colors to minimap #795

Merged
merged 5 commits into from
Jun 22, 2024

Conversation

redbugz
Copy link
Contributor

@redbugz redbugz commented Jun 16, 2024

Fixes #584.

All players are assigned a color based on their player number. It also changes the color of the units slightly to distinguish them from buildings.

In the future I think it would be nice that each player could choose their color from a list of curated colors that are visually distinctive, and then they would always be consistent across single player or multiplayer views. Or they are assigned a color, but then the UI would need to change in other ways so they would know which color they were assigned. This could be as simple as a color bar next to the their name in the game list, or some other color indicator in the HUD.

I'm just learning Rust and Bevy, so hopefully I did things properly. Let me know if you would like any changes.

Copy link
Collaborator

@Indy2222 Indy2222 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR!

I have left some comments requesting some restructuring of the implementation but it should not be difficult.

crates/controller/src/hud/minimap/fill.rs Outdated Show resolved Hide resolved
crates/controller/src/hud/minimap/fill.rs Outdated Show resolved Hide resolved
crates/controller/src/hud/minimap/fill.rs Outdated Show resolved Hide resolved
crates/controller/src/hud/minimap/fill.rs Outdated Show resolved Hide resolved
crates/controller/src/hud/minimap/fill.rs Outdated Show resolved Hide resolved
@redbugz redbugz requested a review from Indy2222 June 19, 2024 17:21
redbugz added 3 commits June 19, 2024 11:22
Fixes DigitalExtinction#584

The playable player is still always blue, but all other players are
assigned a color based on their player number.
refactor PlayerColors to be easier to re-use
implenting the suggested improvements made the tuple struct faster
than the hashmap lookup
Copy link
Collaborator

@Indy2222 Indy2222 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor formatting note. Otherwise, LGTM. I'll test it later.

crates/controller/src/hud/minimap/fill.rs Show resolved Hide resolved
@Indy2222
Copy link
Collaborator

Also, please note that I have done some important CI related fixes to main. I suggest that you merge main into this branch (if you have not done yet already).

@Indy2222 Indy2222 added this pull request to the merge queue Jun 22, 2024
Merged via the queue into DigitalExtinction:main with commit 09b7042 Jun 22, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Draw entities of each player with different color on the minimap
2 participants