Skip to content

haswelldev/birbhunter

Repository files navigation

Birb Hunter

Deploy to GitHub Pages

Play the game here: https://haswelldev.github.io/birbhunter/

Birb Hunter is a mobile game developed using the Apache Cordova framework and PixiJS for high-performance 2D graphics. This project is optimized for both Android and iOS devices.

Table of Contents

Overview

Birb Hunter is an interactive 2D mobile game featuring bird hunting mechanics, complete with animations, sound effects, and music. The project is structured as a Cordova-based web application with bundled assets and JavaScript.

Key Features

  • High-performance 2D rendering with PixiJS.
  • Cross-platform support for Android, iOS, and Browser.
  • Multi-charge Time Stop System: Accumulate time stop charges and use them strategically.
  • Dynamic Difficulty: Multiple difficulty levels (Easy, Medium, Hard, Nightmare) with scaling speed and spawn rates.
  • Visual Notifications: Floating health (+1/-1 HP) and time stop charge notifications.
  • Atmospheric Backgrounds: Multiple pixelated dark forest backgrounds selected randomly at start.
  • Comprehensive Sound System: Immersive background music and sound effects (SFX).
  • In-game Menu: Pause, resume, and adjust volumes on the fly.

Tech Stack

  • Framework: Apache Cordova / PhoneGap
  • Graphics Engine: PixiJS
  • Programming Language: JavaScript / TypeScript (indicated by bundled source maps)
  • Module Bundler: Webpack
  • Testing: Jasmine 1.2.0

Project Structure

.
├── assets/                 # Source game assets
├── css/                    # Source stylesheets
├── img/                    # Source image resources
├── manifest.json           # Source web application manifest
├── res/                    # Cordova platform resources (icons and splash screens)
├── plugins/                # Cordova plugins
├── spec/                   # Jasmine test specifications
├── src/                    # Source code (TypeScript)
│   ├── models/             # Game models
│   ├── service/            # Game services
│   ├── application.ts      # Main game application logic
│   ├── index.ts            # Entry point
│   ├── inversify.config.ts # InversifyJS configuration
│   └── types.ts            # Dependency injection types
├── www/                    # Compiled and bundled web assets (generated by Webpack)
│   ├── assets/             # Game assets (copied)
│   ├── css/                # Stylesheets (copied)
│   ├── img/                # Image resources (copied)
│   ├── bundle.js           # Compiled application bundle
│   ├── vendors~main.bundle.js # Vendor dependencies bundle
│   ├── index.html          # Main application entry point (generated)
│   ├── cordova.js          # Cordova core script (copied from platform)
│   ├── platform.js         # Platform-specific script (copied from platform)
│   ├── exec.js             # Cordova execution script (copied from platform)
│   ├── confighelper.js     # Cordova config helper (copied from platform)
│   └── manifest.json       # Web application manifest (copied)
├── config.xml              # Cordova configuration
├── tsconfig.json           # TypeScript configuration
├── webpack.config.js       # Webpack configuration
└── templates/              # HTML templates for Webpack
    └── index.html          # Template for generating index.html

Requirements

Makefile Commands

A Makefile is provided for convenience to manage common tasks:

  • make install: Install project dependencies using npm install.
  • make build-android: Build for Android.
  • make build-ios: Build for iOS.
  • make build-browser: Build for browser (outputs to www/).
  • make run-browser: Run the browser version using a local server.
  • make run-android: Run on Android emulator/device.
  • make run-ios: Run on iOS emulator/device.
  • make serve: Alias for run-browser.
  • make test: Run Jasmine tests.
  • make clean: Remove build artifacts and platforms/plugins.

Setup and Installation

1. Clone the repository

git clone <repository-url>
cd birb

2. Install dependencies

npm install

Note: This will install all necessary Node.js dependencies and Cordova plugins/platforms.

3. Add mobile platforms (Optional)

Platforms are automatically added during build if you use the Makefile or npm scripts, but you can add them manually:

cordova platform add android
cordova platform add ios

4. Build the project

cordova build android
# or
cordova build ios

Scripts and Commands

Running the App

To run the app on an emulator or a connected device:

cordova run android
# or
cordova run ios

To run in a browser for rapid prototyping:

npm run run:browser
# or
make run-browser

This will start a local development server (http-server) and open the app in your default browser.

Source Code Development

Source files are located in the src/ directory. The project uses TypeScript and InversifyJS for dependency injection. Webpack is used to bundle the application and manage index.html generation.

To build the source code:

npm run webpack

This will compile the TypeScript files and generate all build artifacts (bundles, index.html, and copied assets) in the www/ directory.

To build the entire project (Webpack + Cordova):

npm run build

Tests

Testing is handled by Jasmine 1.2.0. Test specifications are located in the spec/ directory.

To run tests:

npm test
  • Alternatively, open spec/runner.html (if available) in a browser.

Deployment

GitHub Pages

The project is configured to automatically deploy to GitHub Pages on every push to the main branch via GitHub Actions.

Repository URL: https://github.com/haswelldev/birbhunter

Environment Variables

TODO: No specific environment variables detected. Document any required API keys or environment-specific configurations here.

License

TODO: No license file found at the root. Specify the project's license here.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors