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

Firing Feature Improved #167

Merged

Conversation

Archisman141
Copy link
Contributor

@Archisman141 Archisman141 commented Oct 8, 2024

What does this PR do?

The firing feature of the game is not working properly, so I fix this issue, now every time the space bar clicked firing feature will work.

Fixes #143

Alien.Invasion.Defense.-.Personal.-.Microsoft_.Edge.2024-10-08.12-13-44.1.1.1.mp4

Everytime we hit the space bar the firing feature is working

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How should this be tested?

  • Manual Testing

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

In this PR, I have enhanced the firing mechanics of the player by implementing a mouse click-based firing system. Below is a breakdown of the improvements made and the rationale behind them:

Changes Implemented:
Improving Firing Feature:

Previously, bullets not fired using the keyboard (spacebar). I have changed a feature which will able to firing the bullet everytime I hit the space bar.
The fireBullet() function now accepts mouse coordinates to determine the trajectory, adding more flexibility to the gameplay.

The Bullet class was updated to accept and change bullet speed.
Game Balance and Speed Adjustments:

To ensure that the new firing system does not overpower the player, bullet speed and other gameplay dynamics were tweaked for balance.
Self-Review:
Functionality: Tested the click-based firing mechanism thoroughly. Bullets are fired accurately on click, and there are no noticeable bugs or glitches.
Code Quality: The event handling is efficient and lightweight, with no performance issues or unnecessary computation.
Readability: The code follows standard practices, is well-commented, and uses meaningful variable names. Functions are modular, which improves readability and maintainability.
Testing: Verified the changes on different screen sizes to ensure the bullet direction calculation is consistent, even when the canvas size changes.
These improvements significantly enhance the player experience by introducing a more dynamic and skill-based firing system.

Copy link

netlify bot commented Oct 8, 2024

Deploy Preview for thunderous-starlight-9c463d ready!

Name Link
🔨 Latest commit 8b4cae5
🔍 Latest deploy log https://app.netlify.com/sites/thunderous-starlight-9c463d/deploys/67058998a4a2670008f605ed
😎 Deploy Preview https://deploy-preview-167--thunderous-starlight-9c463d.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@github-actions github-actions bot 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 @Archisman141 for your contribution! Your pull request has been submitted successfully. A maintainer will review it as soon as possible. We appreciate your support in making this project better

Copy link

netlify bot commented Oct 8, 2024

Deploy Preview for alienid ready!

Name Link
🔨 Latest commit 8b4cae5
🔍 Latest deploy log https://app.netlify.com/sites/alienid/deploys/670589986100ef000895cfcf
😎 Deploy Preview https://deploy-preview-167--alienid.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@YadavAkhileshh YadavAkhileshh merged commit 5cc23ad into YadavAkhileshh:main Oct 8, 2024
9 checks passed
@YadavAkhileshh YadavAkhileshh added gssoc-ext New feature or request hacktoberfest-accepted Hacktoberfest level1 labels Oct 8, 2024
@Archisman141
Copy link
Contributor Author

@YadavAkhileshh you have given level 3 in my issue but in PR you have assigned level 1 please assign it to level 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gssoc-ext New feature or request hacktoberfest-accepted Hacktoberfest level3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improving the firing feature of the game
2 participants