Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Considerações especiais para desenvolvedores de jogos

Este article descreve algumas considerações para o desenvolvimento de jogos, além das anotações básicas de Introdução.

Desenvolver jogos que funcionam Offline

Usando as Aplicações Offline descreve um conjunto de técnicas, que você pode usar para tornar seu jogo, jogável quando sua aplicação ou browser não estiver conectado a internet. No mínimo, você vai querer usar sua plaicação em cache, para garantir que a estrutura básica do seu jogo esteja sempre disponível. Isso também tem a vantagem, de que uma vez que o jogo tenha sido carregado em cache do usuário, o próximo carregamento do jogo seja mais rápido.

Se seu jogo tem uma quantidade significativa de lógica do lado do servidor, ele não pode ser totalmente jogável offline, but it can still be advantageous to persist enough data in either IndexedDB or DOM Storage so that if a player's connection disappears (e.g. their computer loses WiFi connectivity), they still have some partial ability to play locally, rather than having their game simply grind to a halt or behave unpredictably.

Identifying players

It's often interesting to have an ongoing relationship with individual players of a game, particularly when it makes sense to save a bunch of state (saved games, earned experience, etc.). You need to authenticate that a player who has interacted with game now is the same one who has done so before. Available technologies for doing this include:

  • BrowserID — Players can demonstrate control of a given email address. Mozilla maintains public servers that can do much of the work for you, or you can run your own.
  • Twitter — Players can demonstrate control of a Twitter account using OAuth 1.0a; this requires a game to depend on Twitter and the servers it owns.
  • Facebook — Players can demonstrate control of a Facebook account using OAuth 2.0; this requires a game to depend on Facebook and the servers it owns.

Identity information gained from one of these methods can then be used by the game server to authorize access to accounts which offer such things as saved games, friend lists, photos, or other valuable resources.

Making games social

Multiplayer games can benefit from allowing players to choose to compete against lists of their friends or to interact with them in other ways as part of gameplay. Both Twitter and Facebook offer the ability to get lists of friends/followers as well as a variety of other APIs.

See also

Gaming and the Mozilla Labs Apps Project

Etiquetas do documento e colaboradores

 Colaboradores desta página: MarcoBruno
 Última atualização por: MarcoBruno,