GithubHelp home page GithubHelp logo

samuelfolledo / fufight Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 1.5 GB

Fu Fight is a turn-based multiplayer fighting game inspired from rock-paper-scissor shoo game but with a twist

License: MIT License

Swift 93.79% Python 6.21%

fufight's Introduction

FuFight

Multiplayer turn-based 3D fighting game for iOS

This project is my attempt to use the best and newest practices in Swift and popular third party libraries; Combine, Firebase (Firestore, Authentication, Storage, Crashlytics), and uses MVVM pattern.

Technologies

  1. Collada (.dae files) for 3D models and animations. Animations were downloaded from Adobe's Mixamo by uploading the character's .fbx file

  2. Swift

    • App is mostly in SwiftUI, however, UIKit is required for SceneKit
    • SceneKit is Apple's 3D rendering engine
    • Combine is Apple's framework to handle asynchronous events declaratively
    • MVVM pattern, common SwiftUI pattern
    • Router pattern in charge of handling navigations and creating views which allows flexibility and testability
    • Codable mapping JSON or dictionaries into a Swift object
    • async and try await handling background tasks asynchronously
    • Result for error handling
  3. Firebase

    • Firebase Firestore for database
      • Used Firebase's new property wrappers @DocumentID, @ServerTimestamp, @FirestoreQuery
    • Firebase Authentication for authenticating users. This app also features:
      • Register and log in accounts
      • Forgot email and password
      • Email/username authentication
      • Assign profile picture
      • Update unique username
      • Remember email/username and password
      • Reonboard unfinished account registration
    • Firebase Storage for storing user's photo and other files

Set up

  1. Download repo
  2. Download Swift Packages by going to File -> Add Packages and paste the links below
  3. Add GoogleService-Info.plist to the Xcode project by either:
    1. Contact [email protected] for a copy of the file
    2. Create your own Firebase project here and download its GoogleService-Info.plist into your Xcode project. Ensure to enable Firestore, Storage, and Authentication for email and password in the Firebase project

Game Demo

Game Rules

  1. Each round before the timer runs out, both players can select up to 1 attack and 1 defense move
  2. When the current round's timer runs out, damage is applied to opposing enemy's HP depending on each player's selected moves. Selected moves also goes into cooldown at the end of the round
  3. Attack rules:
    1. There are 3 types of attack: light, medium, and hard.
    2. Light type of attacks are faster but does lesser damage, meanwhile hard type of attacks does more damage but are slower. Cooldown are also longer for hard attacks compared to light attacks.
    3. Landing an attack first gives the attacker a slight speed boost for next round and reduce incoming damage based on attack type. Hard attacks will reduce incoming damage much more than light attacks
    4. Some attacks can boost the damage of attacks that are not on cooldown for the next round indicated with fire
    5. Each attack type can land either left or right
  4. Defense rules
    1. There are 4 types of defense: left, right, up, down
    2. Defense type: left or right defense move can dodge an attack and receiving 0 damage
    3. Defense type: up will increase your speed, increase damage dealt, and damage received
    4. Defense type: back will reduce your speed and reduce incoming damage
  5. The game ends when one of the player’s HP reduces to 0
  6. This game will never result to tie


Authentication Demo

Account Creation

  • Uses Firebase’s Authentication for authentication
  • Account creation requires a unique username, unique email, and password. Profile picture is optional
  • Email or username along with a password can be used to authenticate
  • Account created but incomplete (i.e. user name was not set), after logging in, the app will transition to finishing account creation
  • User’s data are stored in Firebase Firestore and profile picture in Firebase Storage

Account Deletion

  • Deleting accounts gets their Firebase Firestore’s data, Firebase Storage’s profile picture, and Firebase Authentication’s account permanently deleted
  • Locally stored account data and remembered email/password are permanently deleted
  • Account deletion requires a recent authentication before performing
Account Creation Account Deletion

Account Log In With Email or Username

  • Username authentication fetches the user’s email using the unique username, then use that email along with the password to authenticate
  • Logging in fetches user’s data from Firebase Firestore, user’s profile picture from Firebase Storage, and store cache them locally
  • With remember email and password feature which gets updated when updating the user’s username
Log In With Email Log In With Username

Account Update Username and Password

  • Recent authentication is required in order to update account
  • Update email and profile picture is also supported
Update Username Update Password

Important Links

License under MIT License

fufight's People

Contributors

samuelfolledo avatar

Watchers

 avatar  avatar

Forkers

sbui503

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.