Skip to content

ashleyrevlett/candy-wars

Repository files navigation

Candy Wars

Homage to Dope Wars in Javascript

Description

Knock-off of the classic Dope Wars DOS/TI-83 game. Developed with TypeScript, Vue.js 3, Vite, and Pinia.

Demo

Check out the demo: https://wonderful-frangollo-ca35d1.netlify.app

Usage

Install and run it locally:

nvm use stable
npm install
npm run dev

Build for production with npm run build

Using Firebase for High Scores

This app uses Google Firebase (with anonymous login) and Firestore for storing high scores. To set it up, create a Firestore database, then update the .env file with your config info.

For the db rules, use:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read: if request.auth != null
      allow create: if request.auth != null &&
        // must have exactly 2 fields with keys 'name', 'score'
        request.resource.data.size() == 2 && request.resource.data.keys().hasAll(['name', 'score']) &&
        // string field must be less than 101 characters
        request.resource.data.name is string && request.resource.data.name.size() < 101 &&
        // score field must be positive int
        request.resource.data.score is int && request.resource.data.score > -1
    }
  }
}

Acknowledgments

About

SFW reboot of Dope Wars, the classic DOS/TI-83 game

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published