Skip to content

dakerr/pirate-island-pixijs

Repository files navigation

Pirate Island - A demo game made with Typescript and PixiJS

This project is based from Pixi Open Games. A collection of games to help learn how to make games using PixiJS and its ecosystem of plugins and tools.

firebase deploy

Features

This project utilizes multiple pixi based libraries including:

  • PixiJS a rendering library build for the web.
  • UI for commonly used UI components in PixiJS.
  • AssetPack, a framework agnostic tool for optimizing assets for the web.

Other neat stuff in this project:

  • written in Typescript, with linting and formatting (Eslint and Prettier)
  • package management with Yarn (Fast, consistent, secure)
  • uses GreenSock Animation Platform (GSAP). Wow! Do people know about this?
  • built with Vite, OMG its awesome.
  • hosted with Firebase Hosting
  • deployed to Firebase with Github Actions
  • sends highscores to Cloud Firestore

Purpose

This simple game demonstrates how data could be sent to a separate app, and displayed in real-time.

How?

Both apps (and potentially many others) are connected to the same cloud based database - the NoSQL Firestore Database. The second app here consumes the data in a stream using a React hook and updates the table in real-time!

Firestore APIs used

  • initializeApp
  • getFirestore
  • getAuth
  • signInAnonymously
  • collection
  • addDoc
  • serverTimestamp

Prerequisites

This project needs Node.js and Yarn installed on your system.

Setup

# Clone the repository
git clone http://github.com/dakerr/pirate-island-pixijs
cd ./pirate-island-pixijs

# Install dependencies
yarn

# Start the project
yarn start

* this will let you play the game but the second project is needed to save the high scores

Build

# Assetpack bundles, tsc compiles and vite builds for production.  Output to /dist
yarn build

Demo!

Deployed to Firebase Hosting pushes and merges to main with GitHub Actions.
Have fun!

Known Issues

Until I setup a GitHub Action to Create an .env file, you will need to setup a Firebase config yourself. (Not going to commit secrets to GitHub!) A Firebase API key is required to access the Firestore.

License

MIT License

About

A simple drop-n-catch game made with PixiJS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published