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

Randomized Enemy Sizes #3321

Merged
merged 2 commits into from Nov 5, 2023

Conversation

aMannus
Copy link
Contributor

@aMannus aMannus commented Oct 22, 2023

Copy link
Contributor

@briaguya-ai briaguya-ai left a comment

Choose a reason for hiding this comment

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

This is awesome and was a ton of fun to see in the chaos race!

:shipit:

float randomNumber;
float randomScale;

uint8_t bigActor = rand() % 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

I've seen pushback on PRs calling rand() a few times but for something like this I think rand() works perfectly. There are other "on the fly" random things that use rand() throughout the codebase - random fuse timer for bombs for example

// Set random fuse timer with a minimum of 10. Do the sound and scale immediately,
// otherwise the bomb is invisible until the timer hits the "normal" amount.
uint32_t randomTimer = (rand() % 150) + 10;

Copy link
Contributor

Choose a reason for hiding this comment

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

My next project is to get rid of ALL rand() calls, so those existing ones are living on borrowed time :) What I'd prefer you to do here is use the Random function from 3drando if for no other reason than this is a C++ file, so we should be using C++ functionality, although no matter what you do here, it will be changed by me soon anyway. The 3drando header is already included in this file, so it should be a trivial substitution.

float randomNumber;
float randomScale;

uint8_t bigActor = rand() % 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

My next project is to get rid of ALL rand() calls, so those existing ones are living on borrowed time :) What I'd prefer you to do here is use the Random function from 3drando if for no other reason than this is a C++ file, so we should be using C++ functionality, although no matter what you do here, it will be changed by me soon anyway. The 3drando header is already included in this file, so it should be a trivial substitution.

@garrettjoecox garrettjoecox merged commit 13a8a1a into HarbourMasters:develop Nov 5, 2023
8 checks passed
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.

None yet

4 participants