Skip to content

Dolphina#120

Merged
ajm19826 merged 5 commits into
mainfrom
dolphina
May 15, 2026
Merged

Dolphina#120
ajm19826 merged 5 commits into
mainfrom
dolphina

Conversation

@ajm19826

Copy link
Copy Markdown
Member

Pull Request

Make sure to see the Contributing Guidelines here.

Description

Please include a summary of the changes and the related issue.

Fixes #(issue)

Type of change

Please delete options that are not relevant.

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactor

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

  • Test A
  • Test B

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Additional notes

Add any other context about the pull request here.

@ajm19826
ajm19826 merged commit 9b6cfd7 into main May 15, 2026
11 of 12 checks passed
@ajm19826
ajm19826 deleted the dolphina branch May 15, 2026 21:05
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new web-based game called "Dolphin Butter Splash," including its core logic in JavaScript, HTML structure, and CSS styling. It also updates the main games page to include a link to the new game. Feedback focuses on fixing HTML syntax errors and accessibility attributes in the game card, as well as optimizing the game's rendering and logic by reducing redundant canvas state changes and streamlining array iterations for item updates and collision detection.

Comment thread games.html
<p>Alge-Blast</p>
</a>
<a class="game-card" href="https://houselearning.org/home/assets/dolphingame/index.html">
<img src="assets/dolphingame/fishygame.png" alt="Alge-Blast">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The alt attribute for the Dolphin Butter game image is incorrectly set to "Alge-Blast". This should be updated to accurately describe the game for better accessibility.

          <img src="assets/dolphingame/fishygame.png" alt="Dolphin Butter">

Comment thread games.html
</a>
<a class="game-card" href="https://houselearning.org/home/assets/dolphingame/index.html">
<img src="assets/dolphingame/fishygame.png" alt="Alge-Blast">
<p>Dolphin Butter</p></p>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

There is an extra closing </p> tag here which should be removed to ensure valid HTML.

Suggested change
<p>Dolphin Butter</p></p>
<p>Dolphin Butter</p>

Comment on lines +58 to +64
for (let i = 0; i < 6; i++) {
ctx.beginPath();
ctx.fillStyle = 'rgba(255, 255, 255, 0.35)';
const waveY = 30 + i * 90 + Math.sin((state.frame + i * 50) / 30) * 12;
ctx.ellipse(450, waveY, 260, 22, 0, 0, Math.PI * 2);
ctx.fill();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The ctx.fillStyle is set to the same value in every iteration of the loop. Moving it outside the loop improves performance by reducing redundant state changes in the canvas context.

Suggested change
for (let i = 0; i < 6; i++) {
ctx.beginPath();
ctx.fillStyle = 'rgba(255, 255, 255, 0.35)';
const waveY = 30 + i * 90 + Math.sin((state.frame + i * 50) / 30) * 12;
ctx.ellipse(450, waveY, 260, 22, 0, 0, Math.PI * 2);
ctx.fill();
}
ctx.fillStyle = 'rgba(255, 255, 255, 0.35)';
for (let i = 0; i < 6; i++) {
ctx.beginPath();
const waveY = 30 + i * 90 + Math.sin((state.frame + i * 50) / 30) * 12;
ctx.ellipse(450, waveY, 260, 22, 0, 0, Math.PI * 2);
ctx.fill();
}

Comment on lines +149 to +154
state.rocks.forEach((rock) => {
const overlap = rock.x < hitbox.x + hitbox.w && rock.x + rock.size > hitbox.x && rock.y < hitbox.y + hitbox.h && rock.y + rock.size > hitbox.y;
if (overlap) {
state.gameOver = true;
}
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The collision check for rocks continues even after a collision is detected. Using Array.prototype.some() is more efficient as it will stop iterating as soon as a collision is found.

  const collision = state.rocks.some((rock) => 
    rock.x < hitbox.x + hitbox.w && rock.x + rock.size > hitbox.x && rock.y < hitbox.y + hitbox.h && rock.y + rock.size > hitbox.y
  );
  if (collision) state.gameOver = true;

Comment on lines +158 to +161
state.butter.forEach((butter) => (butter.x -= butter.speed));
state.rocks.forEach((rock) => (rock.x -= rock.speed));
state.butter = state.butter.filter((butter) => butter.x + butter.size > -20);
state.rocks = state.rocks.filter((rock) => rock.x + rock.size > -20);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The updateItems function iterates over the butter and rocks arrays twice. These operations can be combined into a single filter pass for each array to improve performance.

Suggested change
state.butter.forEach((butter) => (butter.x -= butter.speed));
state.rocks.forEach((rock) => (rock.x -= rock.speed));
state.butter = state.butter.filter((butter) => butter.x + butter.size > -20);
state.rocks = state.rocks.filter((rock) => rock.x + rock.size > -20);
state.butter = state.butter.filter((butter) => {
butter.x -= butter.speed;
return butter.x + butter.size > -20;
});
state.rocks = state.rocks.filter((rock) => {
rock.x -= rock.speed;
return rock.x + rock.size > -20;
});

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.

1 participant