Atomic Plugins for Multiplayer
Objective-C Java JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist/doc/js
doc_template Fixed docs Jan 12, 2016
src Plugins prepared for cordova-android@7.0.0 Aug 21, 2018
.gitattributes
.gitignore Fixed docs Jan 12, 2016
README.md
gulpfile.js Implement Google Play Games Multiplayer Jun 22, 2015
package.json plugin adapted for npm Jul 7, 2015

README.md

Atomic Plugins for Multiplayer

This repo contains Multiplayer APIs designed using the Atomic Plugins paradigm. Integrate Social services in your app easily and take advantage of all the features provided: elegant API, flexible solution that works across multiple platforms, single API for different Social Services and more.

Currently there are 2 multiplayer services implemented:

  • GameCenter
  • GooglePlay

You can contribute and help to create more awesome plugins.

##About Atomic Plugins

Atomic Plugins provide an elegant and minimalist API and are designed with portability in mind from the beginning. Framework dependencies are avoided by design so the plugins can run on any platform and can be integrated with any app framework or game engine.

#Provided APIs

##JavaScript API:

###API Reference

See API Documentation

###Introduction

Cocoon.Multiplayer class provides an easy to use Multiplayer API that can be used with different Multiplayer Services: GooglePlay games and GameCenter.

###Setup your project

Releases are deployed to Cordova Plugin Registry. You only have to install the desired plugins using Cordova CLI, CocoonJS CLI or Ludei's Cocoon.io Cloud Server.

cordova plugin add cocoon-plugin-multiplayer-ios-gamecenter;
cordova plugin add cocoon-plugin-multiplayer-android-googleplaygames;

The following JavaScript file is included automatically:

cocoon_multiplayer.js

And, depending on the social service used, also:

cocoon_multiplayer_gamecenter.js cocoon_multiplayer_googleplaygames.js

###Example

var GameCenter = Cocoon.Social.GameCenter;
var SocialGameCenter = gc.getSocialInterface();
var MultiplayerGameCenter = gc.getMultiplayerInterface();
  
SocialGameCenter.login(function(loggedIn, error) {
	if(loggedIn){
		var request = new Cocoon.Multiplayer.MatchRequest(2,2);
		var handleMatch = function(match, error){
  			console.log("Error: " + JSON.Stringify(error));
   		}

 		...

   		MultiplayerGameCenter.findMatch(request, handleMatch);
   		
   		...
    
    }
});

#License

Mozilla Public License, version 2.0

Copyright (c) 2015 Ludei

See MPL 2.0 License