Post on 27-Jan-2015
description
{ Your Phone is the Controller with Multiplayer
JSDC 2013 吳宗德 (Aidan Wu)
Long, Long Time Ago
Connected TV
192.168.0.168
+ 192.168.0.168
+ 192.168.0.168
+ ADDRESS
+ 192.168.0.168
+ ADDRESS
+ 192.168.0.168
+ ADDRESS
+ 192.168.0.168
+ ADDRESS
WebSocket »
Your Phone is the Controller
mobile-‐‑input-‐‑multitouch
mobile-‐‑input-‐‑multitouch
mobile-‐‑input-‐‑multitouch
WebSocket Gateway
HTML5 Canvas
Simple Host Server
1. LOGIC / RULE 2. GRAPHICS 3. INPUT 4. SOUND 5. MUSIC 6. CONNECT (MULTIPLAYER) 7. ASSETS
Anatomy of a Game-‐‑based APP
1. Install? Write once play anywhere 2. Graphics? Canvas & WebGL 3. Sounds? HTML5 audio 4. Communication? Multiplayer game server 5. Data? Web storage / Offline 6. Controls? Keyboard and touch
Why is HTML5 gaming so cool?
Graphics Communication Input/Control
CANVAS-‐‑based UI
The Xerox 8010 Star Workstation introduced the first commercial GUI
<CANVAS> element
Drawing paths, boxes, circles, characters, and adding images, on the fly, via scripting
Tile + Sprite
LAYERS
GAME LOOP Polling vs Event driven
I
Input
Logic
OFF-‐‑SCREEN
Display
DRAWING OFF-‐‑SCREEN backbuffer
Gamepad Generation
u Hammer.js u Touchy.js u QuoJS
Multi-‐‑touch Gestures
MVC
M - Moving toward (continuous)"
V - Looking touchable"
C – Touch(Gesture)-aware
Data Communication
u RFC 6454 -‐‑ The Web Origin Concept u Same-‐‑Origin Policy u Cross-‐‑Document Messaging u PostMessage Architecture u XMLHbpRequest Level 2 u Comet u WebSockets
Connectivity and Real-‐‑Time
WebSockets ?
Long-‐‑polling / COMET
Polling / AJAX
Bandwidth optimized binary encoding for JavaScript
BiSON.js
Building a Scalable Game Server
• Scalable • Extensible • Performance
New Gaming Experience on Big and Small Screens
Chrome World Wide Maze
Chrome Super Sync Sports
Q & A
Some issues you might encounter