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

(REVIEW ONLY) Jeremy bubble exercises #1

Closed
wants to merge 4 commits into from

Conversation

Rezmason
Copy link

@Rezmason Rezmason commented Dec 8, 2023

Don't merge! But feedback appreciated. Things of note:

  • Do we ever operate on local transforms instead of transforms, for performance reasons?
  • Is the local bubbles array getting populated and then merged the right approach?
  • Is .slice() necessary to guarantee iterator stability? ie., do we routinely look out for mutating data structures we're in the middle of looping over?
  • Do we avoid Array map/filter/reduce in our engine? What about in non-engine projects, like examples we share with the community?

Copy link

cla-bot bot commented Dec 8, 2023

Thank you for your pull request and welcome to the Ethereal Engine developer community!

We require contributors to sign our Copyright Assignment Agreement, and we don't seem to have you on file.

In order for us to review and merge your code, please sign the agreement at https://forms.gle/15ENsSAJGKf2ozvB7

The agreement has not been signed by users: @Rezmason.

After signing the agreement, you can ask me to recheck this PR by posting @cla-bot check as a comment to the PR :)

Copy link
Contributor

@DanielBelmes DanielBelmes left a comment

Choose a reason for hiding this comment

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

Sorry it has taken so long to go over this. Nice job. Very clean and consise. Hope it helped get your feet wet.

@@ -92,21 +93,31 @@ export const BubbleEmitterComponent = defineComponent({
// Spawning a single bubble as an example
// [Exercise 1]: Using this system. Spawn multiple bubbles with varying x,z Localtransform positons
// [Exercise 3]: Remove them if they are too old(bubble.age > N seconds)[This can be done in a couple ways(reactively and within this sytem synchronosly)]
if(emitterComponent.bubbleEntities.value!.length < 1) { //For example ensuring there is only one bubble being added
const bubbles: Array<Entity> = []
Copy link
Contributor

Choose a reason for hiding this comment

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

using emitterComponent.bubbleEntities was enough to track the bubbles.

if(emitterComponent.bubbleEntities.value!.length < 1) { //For example ensuring there is only one bubble being added
const bubbles: Array<Entity> = []
const numExistingBubbles = emitterComponent.bubbleEntities.value!.length
const numBubbles = 10
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer this constant to actually be at the top of the file or configured withing the emitter component

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