GithubHelp home page GithubHelp logo

armadillo's Introduction

alt text

Use your phone as a controller for any HTML 5 game! Armadillo is an interdevice HTML5 game framework and can be modified to be used for any HTML5 game.
Armadillo is built with Node.js and Socket.io, so it's 100% javascript code. Fork this repository and see what you can do with it!

Installation

1. Install node.js (nodejs.org)
2. Clone repository:
$ git clone https://github.com/wietsedevries/armadillo.git
3. Open folder
$ cd Armadillo
4. Install dependencies:
$ npm install
5. Start server:
$ node server.js
6. Go to http://localhost:3000 and play game!:)

Documentation

Controller buttons

The controller currently has 2 buttons, but can have as many as you need. To add a new button you need to add 2 new lines of code in the armadillo.js file.

  1. Set eventlistener for button (@line 100)
    App.controller('#UNIQUE_BUTTON_ID',UNIQUE_INT_IDENTIFIER);

  2. Add function to button using the cases var (@line 130)
    UNIQUE_INT_IDENTIFIER: functionName

Now you can use the 'functionName' function in the controller.js to do whatever you like. As is, the function wil execute twice; ontouch & onTouchEnd.
The ** armadillo.js** file contains comments that will hopefully help you better understand these steps.

Joystick

This repository contains 2 types joysticks in je joystick.js file; an efficient one and an accurate one. The joystick is optional.
Both joysticks are dependent on jQuery's UI Draggable function and and rely on Dave Furfero's Touch Punch to enable the draggable function on mobile devices. (included in the file).

Efficient joystick calculateHour();
The efficient joystick sends less data packets to the server, but at a cost. The server will only register the angle of the joystick if the joystick moves more than 30degrees relative to its former position. The joysticks knows 12 positions equal to the hours on the clock.

Accurate joystick calculateAngle();
The accurate joystick send a data packets, containing the angle of the joystick, to the server on every movement (± 50 p/sec). This joystick is a must if accuracy is important, but it will slow down performance.

Contributing

The main goal of this open-source project is to advance the use of interdevice connectivity, so your contribution is much appreciated! Feel free to add, modify and improve whatever you like, but your help is currently most needed with the following points;

  • Enabling multi touch (to use joystick and buttons at the same time);
  • Implementing a lighter alternative for fastclick.js
  • Improve the demo game;

Don't know how to contribute? Check out this article.

Credits

Created by: Wietse de Vries | wietsedevries.eu
Inspired by: Eric Terpstra's "Anagrammatix" | Github Repository

License

The MIT License (MIT)

Copyright (c) 2015 Wietse de Vries

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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.