kunjgit / GameZone

This open source repository contains collection of games build on basic tech stacks in web development . Use your creativity and build your own game and contribute to the repository by making PR 🎮
https://kunjgit.github.io/GameZone/
Apache License 2.0
570 stars 830 forks source link

[New game]: Duck Hunt #3671

Closed Anshika-17 closed 4 months ago

Anshika-17 commented 5 months ago

🎮 Game Request

Game logic and basic description

Duck Hunt

Game Description

Duck Hunt is a classic shooting game where the player uses a light gun (or mouse/keyboard controls) to shoot at ducks that appear on the screen. The game takes place in a rural hunting environment, with the player positioned in a hunting blind or field.

The objective of the game is to shoot as many ducks as possible within the given time limit. Ducks of various colors and patterns fly across the screen, and the player must quickly aim and shoot at them to score points.

The game features the following modes:

  1. Single Duck Mode: One duck appears on the screen at a time, and the player must shoot it.
  2. Double Duck Mode: Two ducks appear simultaneously, requiring the player to quickly switch targets.
  3. Rabbit Mode: A rabbit appears and runs across the screen, adding a different challenge.

The game becomes progressively more challenging as the player advances through levels, with faster-moving ducks, more ducks appearing simultaneously, and additional obstacles or hazards introduced.

Game Logic

  1. Initialize the Game:

    • Create an HTML canvas element to serve as the game's main display.
    • Set up the initial game state, including the player's score, time remaining, and the number of ducks to be spawned.
    • Load and prepare any necessary assets, such as images for the ducks, the hunting blind, and the background.
  2. Spawn Ducks:

    • Implement a function to randomly generate the appearance of ducks on the screen.
    • Randomize the position, size, and speed of each duck to create a varied and unpredictable gameplay experience.
    • Store the duck objects in an array to keep track of them.
  3. Handle Player Input:

    • Listen for mouse or keyboard events to detect when the player shoots.
    • Implement a function to check if the player's shot intersects with the position of any of the ducks in the array.
    • If a duck is hit, update the player's score and remove the duck from the array.
  4. Game Loop:

    • Create a game loop that continuously updates the game state and renders the canvas.
    • Within the game loop:
      • Clear the canvas to prepare for the next frame.
      • Update the position of each duck in the array based on their speed and direction.
      • Draw the ducks, the hunting blind, and any other game elements on the canvas.
      • Check for player input and update the game state accordingly.
      • Render the current score, time remaining, and any other UI elements.
      • Request the next frame of the game loop.

Point down the features

Game points

Select program in which you are contributing

GSSoC24

Code of Conduct

Anshika-17 commented 5 months ago

/assign

kunjgit commented 5 months ago

Hey @Anshika-17 ! Thank you for raising an issue 💗 You can self assign the issue by commenting /assign in comment 😀 Make sure you follow CODE OF CONDUCT and CONTRIBUTING GUIDELINES 🚀 Don’t Forget to ⭐ our GameZone🎮 Make sure you join our Discord🕹️

Anshika-17 commented 5 months ago

/assign

kunjgit commented 5 months ago

Hey @Anshika-17 ! , This issue is already assigned to @Anshika-17. 💗 You can work on other issues 🚀 If there is anything wrong you can contact us on Discord🕹️👀

kunjgit commented 4 months ago

Hey @Anshika-17 ! Thank you so much for your raising the issue💗 It’s all yours, you can come anytime again and make some contributions! 🚀 Alone, we can do little, but together we can do so much! 😇