Code Monkey home page Code Monkey logo

monster-battle's Introduction

Monster-Battle

An augmented reality battle game integrated with Watson SDK for AI capabilities

Monster Battle

Getting started

  1. Sign up for an IBM Cloud account
  2. Sign up for a Vuforia account
  3. Sign up for a PubNub account
  4. Install Unity 2018.3.3
  5. Download the Assets and Project Settings Folder from here
  6. Print the image from the folder.

Steps to create the game

  1. Create a new project in Unity

Set up your project for Vuforia

  1. Login to the Vuforia account
  2. Navigate to License Manager and create a new development key. You will use this key later on to develop the application
  3. To activate Vuforia in your unity project, access the player settings from Edit > Project Settings, then select the Player category, and select the tab for the mobile device you are building to. Under the XR Settings panel, enable the Vuforia Augmented Reality Support property.
  4. Navigate to Target Manager on Vuforia and create a new database for unity editor.
  5. Click on the database created.
  6. Click on Add Target. Set the type to single image, select the image from the folder you downloaded from box, set the width, name and click add.
  7. Select the Click on Download Database and you will import the downloaded package later on.

Create the speech to text service

  1. Login to the IBM cloud account
  2. Navigate to the catalog, search for speech to text and create the service in the Dallas region.
  3. Create new credentials for the service from the service credential tab.
  4. Take note of the iam_apikey, you will use this key later on to develop the application.

Get the publish and subscribe keys from pubnub

  1. Login to the pubnub application
  2. Click on the Demo Project
  3. Click on create new keyset
  4. Take note of the publish and subscribe keys.

Set up the unity project to work with different services created above.

  1. Copy and replace the Asset and Project Settings Folder that you downloaded earlier in the Project Folder where the game is saved.
  2. Wait for unity to update the Assets.
  3. To download additional and required vuforia packages, navigate to Game Object> Vuforia> AR camera. This will install the required packages and then delete the AR camera that you just imported.
  4. Double click on the image package that you downloaded from vuforia to import it in the project.
  5. Open the Inspector Window by navigating to Window > General > Inspector (Shortcut - CTRL+3).
  6. Open the Project Heirarchy by navigating to Window > General > Heirarchy (Shortcut - CTRL+4).
  7. Select AR Camera, click on open vuforia engine configuration and paste the vuforia license key. Make sure the database that you created in vuforia is added under databases.
  8. Select Image Target from the Hierarchy. Make sure the scale is set to 7.91 for x,y and z
  9. Under Image Target Behaviour, select your database and image target.
  10. In the inspector window, scroll down to the Main 2 script and paste the pubnub publish key and pubnub subscribe key in the text box for pubnub_pub and pubnub_sub respectively.
  11. Paste the speect to text api key in the Example Streaming Script.

Open the main2 script from the Assets/Resources folder, change playerNumber to 1 and build the project for player 1 and set playerNumber to 2 and build the project for player 2

Click on run, point the camera at the image and enjoy the game.

Rules of the Game

  1. Player 1 has to start the game before Player 2
  2. Once both the players start the game, each of them gets 5 monsters assigned which are placed on the bench.
  3. Every monster has hit points(green) and attack points(black)
  4. The number of stars in the game represents the number of energies you have (for an attack you need an energy).
  5. Its a turn based game and the green bench represents that player's turn.
  6. In the beginning both players have to choose an active monster who will face off against the enemy's monster. - "number x active"
  7. Once chosen you cannot replace the active monster until it's destroyed.
  8. In your turn you have the following options
  9. You can perform a summoning ritual which summons either. "draw"
    1. Monster - who will do your bidding and decide to either
      1. Release the new monster "discard"
      2. Recruit him for your monster army. "move to number x"
    2. Energy - that will power up your monster
  10. You can power up any monster if you have an energy (the attack points will be highligted in red) "add energy to active/number x"
  11. You can attack the enemy's monster only if your active monster is powered up. "strike"

TO DO

  1. Integrate IBM Watson Assistant for help with the game.
  2. Allow player 1 and 2 to input an unique number to add it to the pubnub channels so that multiple players can play using the same pubunb account.

monster-battle's People

Contributors

chandni97 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

bedangsen

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.