MDN’s new design is in Beta! A sneak peek: https://blog.mozilla.org/opendesign/mdns-new-design-beta/

Web 游戏开发简介

这篇翻译不完整。请帮忙从英语翻译这篇文章

现代的web已经高速发展成为一个可行可靠的平台,它不仅能够用来创建高质量的酷炫游戏,同时也能够用来发布和传播这些游戏。

采用现代网页技术和较新的浏览器,完全有可能做出令人影响深刻的顶级页面游戏。它能够制作的游戏种类可以和桌面端以及原生系统相当。我们这里所说的,并不是很久之前就采用Flash®制作出的简单卡牌游戏或者多人社交游戏。而是牛逼的3D 动作射击游戏,RPG 游戏等等。得益于 JavaScript 实时编译技术性能的大幅提升,以及新开放的 API。在制作运行在浏览器(或者是基于类似 Firefox OS 的 HTML5技术支持的设备)上的游戏时,我们不用妥协。

 

The HTML5 game platform

你可以真正地为你的游戏考虑下 Web 来作为更好的目标平台。我们总是喜欢说,"the Web is the platform."  让我们浏览下 Web 平台的核心部分:

Function Technology
Audio Web Audio API
Graphics WebGL (OpenGL ES 2.0)
Input Touch events, Gamepad API, device sensors, WebRTC, Full Screen API, Pointer Lock API
Language JavaScript (or C/C++ using Emscripten to compile to JavaScript)
Networking WebRTC and/or WebSockets
Storage IndexedDB or the "cloud"
Web HTML, CSS, SVG, Social API (and much more!)

The business case

作为一名游戏开发者,无论你是独立的个人还是大型游戏工作室,你想知道你的下一个游戏项目瞄准 Web 是有意义的 。让我们看看 Web 是如何帮到你的 。

  1. Web 触手可及;它无处不在。如今可以看到,用 HTML5 构建的游戏运行在智能手机,平板,个人电脑和智能电视。
  2. 提高营销和曝光度。你不限于在某商店推广你的游戏。相反,你可以像其他媒体一样在 Web 宣传和推广你的游戏,利用网络的固有性和共享性接触新客户。
  3. 你可以掌握最重要的事项:支付。你不必交付超过收入的 30% 给他人,仅仅就因为你的游戏在他们的生态系统。相反,你可以管理任何你想要的和使用任何你喜欢的付款处理服务。
  4. 拥有更多控制权的是,只要你愿意,你可以随时更新游戏。 不必着急等待审核通过,仅当其他公司的某某人决定你的关键 bug 修复是否会在今天或明天交付。
  5. 掌握你的数据分析! 不必依靠别人作出所有决定,你需要什么分析,你可以收集自己的 -- 或选择你最喜欢的第三方平台, 来收集有关你的销售和游戏产生的信息。
  6. 你可以用你的方式更密切地管理你的客户关系。 再也不用苦苦等待只能通过应用商店有限的机制来过滤客户的反馈。用你想要的方式与客户交流, 没有中间人。
  7. 你的玩家可以随时随地玩你的游戏。因为 Web 是无处不在的,你的顾客可以在手机,平板,家庭手提,个人电脑或其他设备上关注游戏动态。

Web technologies for game developers

对于技术同行们, let's dig into the APIs the Web brings to the table that cater to game developers. Here's a thorough list to give you a taste of what the Web can do for you:

Full Screen API
This simple API lets your game take over the entire screen, thereby immersing the player in action.
Gamepad API
If you want your users to be able to use gamepads or other game controllers to work your game, you'll need this API.
HTML and CSS
Together, these two technologies let you build, style, and lay out your game's user interface. Part of HTML is the <canvas> element, which provides one way to do 2D graphics.
HTML audio
The <audio> element lets you easily play simple sound effects and music. If your needs are more involved, check out the Web Audio API for real audio processing power!
IndexedDB
A powerful data storage API for maintaining user data on their own computer or device. A great way to save game state and other information locally so it doesn't have to be downloaded every time it's needed. Also useful to help make your game playable even when the user isn't connected to the Web (such as when they're stuck on an airplane for hours on end).
JavaScript
JavaScript, the programming language used on the Web, is blazing fast in modern browsers and getting faster all the time. Use its power to write the code for your game, or look at using technologies like Emscripten or Asm.js to easily port your existing games.
Pointer Lock API
The Pointer Lock API lets you lock the mouse or other pointing device within your game's interface so that instead of absolute cursor positioning you receive coordinate deltas that give you more precise measurements of what the user is doing, and prevent the user from accidentally sending their input somewhere else, thereby missing important action.
SVG (Scalable Vector Graphics)
Lets you build vector graphics that scale smoothly regardless of the size or resolution of the user's display.
Typed Arrays
JavaScript typed arrays give you access to raw binary data from within JavaScript; this lets you manipulate GL textures, game data, or anything else, even if it's not in a native JavaScript format.
Web Audio API
This API for controlling the playback, synthesis, and manipulation of audio from JavaScript code lets you create awesome sound effects as well as play and manipulate music in real time.
WebGL
Lets you create high-performance, hardware-accelerated 3D (and 2D) graphics from Web content. This is a Web-supported implementation of OpenGL ES 2.0.
WebRTC
The WebRTC (Real-Time Communications) API gives you the power to control audio and video data, including teleconferencing and transmitting other application data back and forth between two users. Want your players to be able to talk to each other while blowing up monsters? This is the API for you.
WebSockets
The WebSocket API lets you connect your app or site to a server to transmit data back and forth in real-time. Perfect for multiplayer gaming action, chat services, and so forth.
Web Workers
Workers give you the ability to spawn background threads running their own JavaScript code, to take advantage of modern, multi-core processors.
XMLHttpRequest and File API
The combination of XMLHttpRequest and the File API lets you send and receive any kind of data you want (don't let the "XML" throw you!) from a Web server. This is a great way to do anything from downloading new game levels and artwork to transmitting non-real-time game status information back and forth.

 

文档标签和贡献者

标签: 
 此页面的贡献者: magiclyde, fierayan
 最后编辑者: magiclyde,