jsdc2013_your phone is the controller with multiplayer

43
{ Your Phone is the Controller with Multiplayer JSDC 2013 吳宗德 (Aidan Wu)

Upload: aidan-wu

Post on 27-Jan-2015

112 views

Category:

Technology


2 download

DESCRIPTION

手機螢幕不一定要用來'看',也是絕佳的Gamepad。發揮第二螢幕的魔力!連結電腦螢幕或TV,創造另一種互動體驗;一個人的娛樂只不過用來打發時間,怎都比不上一團人的群樂。本議程將與大家共同探討運用 HTML5 與 Canvas 還有 WebSocket 打造多人 Sync 的連線遊戲體驗。

TRANSCRIPT

Page 1: JSDC2013_Your Phone is the Controller with Multiplayer

{ Your  Phone  is  the  Controller    with  Multiplayer  

JSDC  2013 吳宗德  (Aidan  Wu)

Page 2: JSDC2013_Your Phone is the Controller with Multiplayer
Page 3: JSDC2013_Your Phone is the Controller with Multiplayer
Page 4: JSDC2013_Your Phone is the Controller with Multiplayer

Long,  Long  Time  Ago

Page 5: JSDC2013_Your Phone is the Controller with Multiplayer
Page 6: JSDC2013_Your Phone is the Controller with Multiplayer

Connected  TV

Page 7: JSDC2013_Your Phone is the Controller with Multiplayer

192.168.0.168

Page 8: JSDC2013_Your Phone is the Controller with Multiplayer

+  192.168.0.168

Page 9: JSDC2013_Your Phone is the Controller with Multiplayer

+  192.168.0.168

+  ADDRESS

Page 10: JSDC2013_Your Phone is the Controller with Multiplayer

+  192.168.0.168

+  ADDRESS

Page 11: JSDC2013_Your Phone is the Controller with Multiplayer

+  192.168.0.168

+  ADDRESS

Page 12: JSDC2013_Your Phone is the Controller with Multiplayer

+  192.168.0.168

+  ADDRESS

Page 13: JSDC2013_Your Phone is the Controller with Multiplayer
Page 14: JSDC2013_Your Phone is the Controller with Multiplayer

WebSocket  »

Page 15: JSDC2013_Your Phone is the Controller with Multiplayer
Page 16: JSDC2013_Your Phone is the Controller with Multiplayer
Page 17: JSDC2013_Your Phone is the Controller with Multiplayer
Page 18: JSDC2013_Your Phone is the Controller with Multiplayer
Page 19: JSDC2013_Your Phone is the Controller with Multiplayer

Your  Phone  is  the  Controller  

mobile-­‐‑input-­‐‑multitouch

mobile-­‐‑input-­‐‑multitouch

mobile-­‐‑input-­‐‑multitouch

WebSocket  Gateway

HTML5  Canvas

Simple  Host  Server

Page 20: JSDC2013_Your Phone is the Controller with Multiplayer

1.  LOGIC  /  RULE 2.  GRAPHICS 3.  INPUT 4.  SOUND 5.  MUSIC 6.  CONNECT  (MULTIPLAYER) 7.  ASSETS  

Anatomy  of  a    Game-­‐‑based  APP  

Page 21: JSDC2013_Your Phone is the Controller with Multiplayer

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?  

Page 22: JSDC2013_Your Phone is the Controller with Multiplayer

Graphics Communication Input/Control

Page 23: JSDC2013_Your Phone is the Controller with Multiplayer

CANVAS-­‐‑based  UI

The  Xerox  8010  Star  Workstation  introduced  the  first  commercial  GUI

Page 24: JSDC2013_Your Phone is the Controller with Multiplayer

<CANVAS>  element

Drawing  paths,  boxes,  circles,  characters,  and  adding  images,  on  the  fly,  via  scripting

Page 25: JSDC2013_Your Phone is the Controller with Multiplayer

Tile  +  Sprite

Page 26: JSDC2013_Your Phone is the Controller with Multiplayer

LAYERS

Page 27: JSDC2013_Your Phone is the Controller with Multiplayer
Page 28: JSDC2013_Your Phone is the Controller with Multiplayer

GAME  LOOP Polling  vs  Event  driven

Page 29: JSDC2013_Your Phone is the Controller with Multiplayer

I

Input

Logic

OFF-­‐‑SCREEN

Display

Page 30: JSDC2013_Your Phone is the Controller with Multiplayer

DRAWING  OFF-­‐‑SCREEN backbuffer

Page 31: JSDC2013_Your Phone is the Controller with Multiplayer

Gamepad  Generation

Page 32: JSDC2013_Your Phone is the Controller with Multiplayer

u   Hammer.js   u   Touchy.js u   QuoJS  

Multi-­‐‑touch  Gestures  

Page 33: JSDC2013_Your Phone is the Controller with Multiplayer
Page 34: JSDC2013_Your Phone is the Controller with Multiplayer

MVC

M - Moving toward (continuous)"

V - Looking touchable"

C – Touch(Gesture)-aware

Page 35: JSDC2013_Your Phone is the Controller with Multiplayer

Data  Communication

Page 36: JSDC2013_Your Phone is the Controller with Multiplayer

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

Page 37: JSDC2013_Your Phone is the Controller with Multiplayer

WebSockets  ?

Long-­‐‑polling  /  COMET

Polling  /  AJAX

Page 38: JSDC2013_Your Phone is the Controller with Multiplayer

Bandwidth  optimized  binary  encoding  for  JavaScript

BiSON.js

Page 39: JSDC2013_Your Phone is the Controller with Multiplayer

Building  a  Scalable  Game  Server  

•  Scalable •  Extensible •  Performance

Page 40: JSDC2013_Your Phone is the Controller with Multiplayer

New  Gaming  Experience  on  Big  and  Small  Screens  

Page 41: JSDC2013_Your Phone is the Controller with Multiplayer

Chrome  World  Wide  Maze  

Page 42: JSDC2013_Your Phone is the Controller with Multiplayer

Chrome  Super  Sync  Sports  

Page 43: JSDC2013_Your Phone is the Controller with Multiplayer

Q  &  A

Some  issues  you  might  encounter