Skip to content

twisprite-developers/glortens-dungeon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Glorten's Dungeon

This repository includes the Unity 3D project to build the Twinsprite Glorten's Dungeon demo APP. A dungeon crawler minigame with a final boss RPG battle. It illustrates the interaction of physical objects with mobile games via the Twinsprite platform. Objects are uniquely identified by a code stored in a QR or NFC tag that works as a key to the object data store in the Twinsprite backend.

See It in Action

Play Now

  1. Download the Glorten's Dungeon App from Google play or the AppStore.

  2. Generate a Glorten's Papercraft on the Twinsprite page

  3. Scan the QR code in the papercraft to play. The character gold, items and experience will be stored in the Twinsprite Platform and linked to unique code in the QR.

To defeat the final boss you will need some help, the Twinsprite page provides codes to unlock a couple of special attacks.

NFC

If you own a NFC capable Android device, all the codes generated from the Twinsprite page can be stored in a NFC tag and tested in the Glorten's Dungeon APP. Tags with at least 144 bytes of storage capacity are required, the code have to be stored using NDEF format. You can use the NXP TagWriter App, it provides a function to write NFC tags directly from QR codes.

Code Overview

Scenes

The game includes three scenes under the /Assets/Scenes folder.

menu

The game main menu screen. These are the main elements in the scene:

  • MainMenu this Game Object contols the SCAN QR, SCAN NFC and PLAY buttons. The main logic is implemented in the /Assets/Scripts/UI/MainMenu.cs script.

  • ToyxManager manages all the interactions between the unique identity attached to a physical object and the Twinsprite backend. It also includes an Editor to test the Twinsprite SDK.

game

The dungeon scenario where you have to defeat the skeletons to get gold and find the Glorten's axe. These are the main elements in the scene:

boss

Final boss battle.

  • Dungeon/Characters/Glorten and Dungeon/Characters/Boss are the characters' Game Objects. All the battle logic is included under the /Assets/Scripts/BossFight folder.

Twinsprite Toyx Manager

The /Assets/Scripts/TwinspriteSDK folder contains the ToyxManager.cs utility script that wraps all the calls to the Twinsprite backed. There is also an Editor that simplifies your Toyx testing tasks.

In the Glorten's Dungeon project this script is attached to the ToyxManager Game Object included in the menu scene.

image

By default the ToyxManager has the API_KEY and SECRET_KEY to play with the Toyx codes generated from the Twinsprite page so you can fill the Toyx Id field with the code of a Glorten's papercraft QR removing the starting url string https://s2d.io/.

Creating a Customized version of Glorten's Dungeon

This section explains how to make the game point to your own Twinsprite account.

  1. If you don't have a Twinsprite Development Portal account, this is the register form.

  2. In the Glortn's Dungeon Unity 3D project, open the /Assets/Scenes/menu scene and select the toyxManager game object, on the Inspector area you will see the Twinsprite ToyxManager Editor with the default game key-pair.

  3. Go to the Twinsprite Development Portal, under the Developer Perspective, select "GAME > My Games", you will find the Glorten's Dungeon game. It contains the API_KEY and SECRET_KEY values you have to include in the ToyxManager Editor.

  4. On the Twinsprite Development Portal, under the Developer Perspective, select "DEVELOPMENT TOYX > Create new Toyx", provide a Batch Name and create a set of Development Toyx. Now copy a Toyx ID code and use it on the ToyxManager Editor.

  5. On Unity 3D run the menu scene and start making requests from the ToyxManager Editor.

You can find more info about creating Games and Toyx in the Twinsprite Developers Quick Start page.

Resources

Twinspite Page

Twinsprite Developer Site

Twinsprite Developer Documentation Site

License

Glorten's Dungeon source code has been developed by Carbonbyte Studios for Twinsprite and is available under the MIT license, excluding some third party plugins. The project art has been authored by Juanma Zarza for Twinsprite and is available under the Creative Commons Attribution (CC BY 4.0) license.

The license details are included in the LICENSE file.

Third Party Resources

CN Controls (by Cyrill Nadezhdin): Available under the MIT license.

GoKit (by prime[31]): custon license, included bellow.

For any developers just wanting to use GoKit in their games go right ahead. You can use GoKit in any and all games either modified or unmodified. In order to keep the spirit of this open source project it is expressly forbid to sell or commercially distribute GoKit outside of your games. You can freely use it in as many games as you would like but you cannot commercially distribute the source code either directly or compiled into a library outside of your game.

Almendra Font (by Ana Sanfelippo): available under SIL Open Font License 1.1

Boss fight ambient music has been composed by Albert "hellmer" Gallego and is available under Creative Commons Attribution-NoDerivatives (CC BY-ND 4.0)

image

About

Glorten's Dungeon is a demo game that interacts with physical objects using the Twinsprite platform with QR codes and NFC tags

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published