Skip to content

Nikola/light #6

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

Merged
merged 7 commits into from
Jun 27, 2025
Merged

Nikola/light #6

merged 7 commits into from
Jun 27, 2025

Conversation

NikolaJelic
Copy link
Collaborator

  • Extract light into a separate class
  • Add simple score tracking and rendering
  • Conditionally render enemies only if they are in contact with the Light

- move light to separate class
- let light manage its effect on the enemies
- enemies take tick damage
@NikolaJelic NikolaJelic requested a review from karnkaul June 26, 2025 15:47
@NikolaJelic NikolaJelic self-assigned this Jun 26, 2025
- add collision parameters struct
- fix collision calculation
- improve text score handling
- remove redundand initialization of text
@NikolaJelic NikolaJelic requested a review from karnkaul June 27, 2025 17:27
auto [pos, diameter] = enemy.get_pos_diameter();
if (glm::distance(pos, m_sprite.transform.position) < (diameter + m_diameter)) {
auto const [pos, diameter] = enemy.get_collision_params();
if (glm::distance(pos, m_sprite.transform.position) < (diameter + m_diameter) / 2) {
Copy link
Member

Choose a reason for hiding this comment

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

You can avoid square rooting here by comparing square magnitude instead of magnitude.

@karnkaul karnkaul merged commit 35428c8 into feature/actors Jun 27, 2025
6 of 7 checks passed
@karnkaul karnkaul deleted the nikola/light branch June 27, 2025 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants