Code Monkey home page Code Monkey logo

mtg-life-counter's Introduction

MTG Life Counter

demo1 demo2 demo3

About

Track the scores of 2-4 players in a game of Magic the Gathering if you don't have any D20s. My friend asked if I could make this for him since we both like MTG, and I figured this would be relatively simple to make with SwiftUI; indeed it was. If you like this app or found it useful, I would appreciate if you starred it or even shared it with your friends. I also don't expect to work on this too much more, as I am quite satisfied with the end result.

Usage

The default number of players is two, but long pressing on the top and/or bottom section unhides the another players. Everyone starts with 20 health. Swipe up to increase health by one, and down to decrease by one. Once a player hits zero, there will be an alert asking to restart or not. Doing so resets everyone's health back to 20. But the coolest feature by far is the ability to rotate each player's score so that you can simply place the device on a table or playing surface, and everyone can read their own scores. The swipe directions also update with the rotation, so whatever is "up" always increases score and "down" decreases. To rotate, tap the score itself.

Installation

  1. Clone this repository or download it as a zip folder and uncompress it.
  2. Open up the .xcodeproj file, which should automatically launch Xcode.
  3. You might need to change the signing of the app from the current one.
  4. Click the Run button near the top left of Xcode to build and install.

Prerequisites

Hopefully this goes without saying, but you need Xcode, which is only available on Macs.

Notes

You can run this app on the Xcode simulator or connect a physical device.
The device must be either an iPhone or iPad running iOS 17.0 or newer.

SDKs

  • SwiftUI - Helps you build great-looking apps across all Apple platforms.

Bugs

If you find one, feel free to open up a new issue or even better, create a pull request fixing it.

Resolved

  • If a player hits zero, and then presses cancel in the restart dialogue, any subsequent swipes will also invoke the dialogue. Fixed by storing an array of players who have lost and skipping them in the check for other player who have hit zero.
  • If a player keeps on trying to decrease their score below zero, it will take that many swipes to bring it back up, even though the text would still say 0. Fixed by simply not allowing that.

Change Log

  • v1.0 - initial release
  • v1.1 - more player support
  • v1.2 - restart bug fix
  • v1.3 - negative score fix

Contributors

Sachin Agrawal: I'm a self-taught programmer who knows many languages and I'm into app, game, and web development. For more information, check out my website or Github profile. If you would like to contact me, my email is [email protected].

License

This package is licensed under the MIT License.

mtg-life-counter's People

Contributors

sachinsagrawal avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.