DailyJS

Wordchain: An AngularJS/Firebase Word Game

Alex R. Young

Subscribe

@dailyjs

Facebook

Google+

games angular firebase

Wordchain: An AngularJS/Firebase Word Game

Posted by Alex R. Young on .
Featured

games angular firebase

Wordchain: An AngularJS/Firebase Word Game

Posted by Alex R. Young on .
Wordchain

Wordchain (GitHub: sonnylazuardi / wordchain, License: MIT) by Sonny Lazuardi is a multiplayer word game made with Firebase, AngularJS, the Google Dictionary API, and the Wikitionary API. It allows you to sign in with Facebook, and complete words in a crossword-like manner.

The code is all modular, dependency-injected Angular classes, so it's fairly easy to see how it fits together. The main game logic is in js/controllers.js. Here's the dictionary API search:

$scope.search = function() {
  angular.element('.loader').fadeIn(1000);
  $.get('https://www.googleapis.com/scribe/v1/research?key=AIzaSyDqVYORLCUXxSv7zneerIgC2UYMnxvPeqQ&dataset=dictionary&dictionaryLanguage=en&query='+$scope.word, function(data) {
    console.log(data);
    angular.element('.loader').fadeOut(1000);
    $scope.definitions = data.data[0].dictionary.definitionData;
    $scope.$apply();
  }, 'jsonp');
};

The readme has some details on running it locally, once you've got set up with Firebase.