Git Product home page Git Product logo

opentriad's Introduction

Welcome to OpenTriad

This project is a reimplementation of the great card game called "Triple Triad" originally developed by Squaresoft for the Playstation 1 title "Final Fantasy 8".

Architecture

The project is separated into the following subprojects:

  • engine - Contains the core components and mechanics for the actual game.
  • terminalApp - Contains the terminal implementation (used for implementation purposes, but also for testing)
  • fxApp - Contains the JavaFX implementation (because why not?)
  • android - Contains the refactored android implementation

Engine

The projects core is the 'engine'-submodule. It consists of various interfaces and default implementations. The engine itself isn't runnable (well the tests are) instead there are different implementations provided.

Model:

  • Card - A pojo which contains a name and four values (top, right, bottom, left).
  • Deck - Model which contains five cards.
  • Player - Simple POJO which contains a name.
  • Battlefield - Contains a two-dimensional array of cards and a "GameFinish"-flag.

Controller:

  • BattlefieldController - Contains the actual game loop.
  • PlayerController - Contains the Player-Entity and the MoveDelegate.

Persistence:

  • CardParser - Enables the parsing of cards.
    • LocalJsonParser - Parses JSON-files from the hard-drive.

View:

  • No view, these are implemented in the corresponding submodules (terminalApp, fxApp, android).

Interfaces / Implementations:

  • CardChooser - Callbacks in order to choose cards before the actual game happens.
    • PreselectedCardChooser - Simply returns a list with five test cards.
    • TerminalCardChooser - Lets a user select five cards via terminal-input.
  • BattlefieldDelegate - Callbacks for events during the game.
    • DefaultBattlefieldDelegate - Dummy implementation (for testing purposes) - doesnt actually do anything
    • The other subprojects make use of this.
  • MoveDelegate - Callbacks for (engine-events) in order to provide a runtime-independent player-turn. This is needed for telling the engine which card a player sets on the battlefield.
    • RandomMoveDelegate - Mimics the turn of a player by randomly setting cards on the battlefield.
    • TerminalMoveDelegate - Allows a user to input card-, x- and y- information in order to set a card.

Screenshots

Screenshots - Terminal

(outdated) Screenshots - Android

Screenshots - JavaFX

  • Coming soon...

Development

How to build & deploy

  • Clone this repository: git clone https://github.com/benjaminfoo/OpenTriad.git
  • Open IntelliJ IDEA, Select "Open Project" and within the FileDialog, choose the build.gradle file at the project-root - OR - cd into the project and execute "gradle build".
  • Install project on emulator or mobile device.
  • Thats it!

How to add custom cards

  1. Add an entry to the file '/opentriad/engine/src/main/resources/cards.json' like
   {
      "name": "MyCustomCard",
       "topPower": "5",
       "leftPower": "3",
       "rightPower": "1",
       "bottomPower": "1"
    }
  1. Within '/OpenTriad/app/src/main/assets/cards/', create an image (jpg!) if your custom card. The name must be the same as you've used in the json file (e.g. for this card, an image called "MyCustomCard.jpg" has to be saved.)
  2. Have fun playing with your custom card!

Used Software / Libraries

  • Java
  • Gradle
  • Gson
  • JUnit

Note

Final Fantasy, Triple Triad, and all subject material are property of Square-Enix. I am not the owner / maker / author of the provided images / names or trademarks used within this project.

opentriad's People

Contributors

benjaminfoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.