SlideShare une entreprise Scribd logo
1  sur  27
An example of game developing 
with Ember.js and WebGL 
Yuki Shimada 
2014/09/22
About me 
• I majored in Computer Graphics at Toho 
University, Chiba prefecture. 
• I have developed a Game Engine for PS3 at a 
venture company established in the University of 
Tokyo. 
• Then, I have transfered to Sopia Inc. (now 
Accenture Inc.), as a system engineer. 
• I have also worked to develop a renderer and 
WebGL Web sites at a VFX studio. 
• Currently, I’m a freelancer (Web & CG).
Demonstration 
• Game Player 
http://youtu.be/0iRTk_2Wjp8 
• Map Editor 
http://youtu.be/u6F3wGJpnUo
My Game Web Service 
• The web service that makes easily able to develop RPG and share it on the 
web. 
• The RPG developers is divided into basic developers and advanced 
developers. 
• The advanced developers can develop RPG from the stage of game 
system. 
– You can write game code using TypeScript. 
– (I hope to support visual programming via node connecting in the future). 
– You can customize UI design using SCSS. 
• The basic developers can cherry-pick one from game systems developed 
by advanced developers, then within the framework of the game system, 
they can easily create RPG with mouse operation only.
The structure of this web service 
• This web service consists of two parts; game player 
and production tools. 
• These are constructed on Ruby on Rails. 
– View and controller of Rails are rarely used. 
– Ember.js controls all of the system, and Rails provide only model data. 
– To describe the view, I used Emblem. 
http://emblemjs.com 
– To transfer model data from Rails to Ember, I used Ember Data and 
ActiveModel::Serializers. 
– This sample made by @ursm was very helpful in usage of Ember Data 
and ActiveModel::Serializers. 
http://ursm.jp/blog/2013/12/03/ember-js-and-rails/
Languages 
• This system was wrote in CoffeeScript for production 
tools, and TypeScript for game player. 
• Ember.js is manipulated from Both 
CoffeeScript(production tools) and TypeScript(game 
player) . 
• The definition of Router is wrote in CoffeeScript.
Using of Ember.js 
• UI handling 
• Data transfer of Rails Model -> Ember Data 
• Data transfer of Ember Data -> WebGL 
• Ember.js Observer and WebGL 
• Computation of Game character’s parameters
UI Handling
UI Handling 
• UI consists of HTML(Emblem) and CSS(SCSS). 
– Creators can customize the look & feel of UI using SCSS. 
• The UI is controlled by Two-stage structure model; 
‘uiScreen’ and ‘uiTable’. 
• The Screens(‘uiScreen’s) correspond to the Template 
of Ember. 
• Screen switching is performed by switching 
templates via Ember,js. 
• Switching between display and non-display of the 
tables(‘uiTable’s) under the screen is performed by 
jQuery.
テーブル(’ uiTable’)uiScreen and uiTable 
スクリーン(’ uiScreen’)
Data transfer 
from Rails Model to Ember Data
Between Rails and Ember Data 
The data that are complex and frequently modified are hold in the column in the Rails model as JSON text. 
Using the Transform feature of Ember Data, transforming it to real JSON by eval in JavaScript, finally we obtain 
Ember objects. 
Definition of Ember Data Model A fixture of Rails Model (Factory Girl) 
trait :as_2 do 
id 2 
ui_screen_id 1 
screenIdentifier 'battle' 
tableIdentifier 'character_0' 
tableName '0:' 
tableName_binding 
'Tool.EScenarioCharacter.0.name' 
selectable false 
trs "[" + 
"{"+ 
"'columns':[" + 
"{" + 
"'item':'HP:'," + 
"'binding': 'Tool.EScenarioCharacter.0.hp'" + 
"}" + 
"]" + 
"}," + 
"{"+ 
"'columns':[" + 
"{" + 
"'item':'MP:'," + 
"'binding': 'Tool.EScenarioCharacter.0.mp'" + 
"}" + 
"]" + 
"}" + 
"]" 
end 
var uiTableDefinition = { 
screenIdentifier: DS.attr('string'), 
tableIdentifier: DS.attr('string'), 
tableName: DS.attr('string’), 
tableName_binding: DS.attr('string'), 
selectable: DS.attr('boolean'), 
trs: DS.attr('uiTableTrs'), 
… 
}; 
Transform of Ember Data Model 
window.Tool.UiTableTrsTransform = 
DS.Transform.extend( 
{ 
deserialize: function(value:any) { 
var json:any = null; 
eval("json = " + value); 
return Ember.create(json); 
} 
});
Question : How can we get one–to-many relationships of 
Ember Data Models from Rails Models? 
• There exists a partially different part in data expression of ‘one to many’ in Rails and Ember 
Data. 
• In Rails, if the child model has reference to the parent model, you can get the list of child 
models from the parent model. 
• In Ember Data, the parent model must expressly have the id array of the child models. 
• From the above difference, conversion process is needed. 
App.Post = DS.Model.extend({ 
comments: DS.hasMany('comment', {async: true}) 
}); 
{ 
"post": { 
"comments": [1, 2, 3] 
} 
} 
App.Comment = DS.Model.extend({ 
post: DS.belongsTo('post') 
}); 
{ 
"comment": { 
"post": 1 
} 
} 
class Post < ActiveRecord::Base 
has_many :comments 
end 
create_table ”posts", force: true do |t| 
end 
class Comment < ActiveRecord::Base 
belongs_to :post 
end 
create_table ”comments", force: true do |t| 
t.integer "ui_screen_id” 
end
Question : How can we get one–to-many relationships of 
Ember Data Models from Rails Models? 
Ember Data Rails Model 
var uiScreenDefinition = { 
var uiTableDefinition = { 
screenIdentifier: DS.attr('string'), 
tableIdentifier: DS.attr('string'), 
tableName: DS.attr('string’), 
tableName_binding: DS.attr('string'), 
selectable: DS.attr('boolean'), 
trs: DS.attr('uiTableTrs'), 
… 
}; 
identifier: DS.attr('string'), 
config: DS.attr('uiScreenConfig'), 
uiTables: DS.hasMany('ui-table') 
}; 
Definition of 
‘uiScreen’ 
which has 
many uiTables 
Definition of 
‘uiTable’ 
which belongs 
to ‘uiScreen’ 
create_table "ui_screens", force: true do |t| 
t.string "identifier" 
t.text "config" 
t.text "uiTables” 
end 
class UiScreen < ActiveRecord::Base 
has_many :ui_tables 
end 
create_table "ui_tables", force: true do |t| 
t.integer "ui_screen_id" 
t.string "screenIdentifier" 
t.string "tableIdentifier" 
t.string "tableName" 
t.string "tableName_binding" 
t.boolean "selectable" 
t.text "trs” 
end 
class UiTable < ActiveRecord::Base 
belongs_to :ui_screen 
end
Answer: To generate has-many id array toward Ember 
Data using Rails’ controller. 
class Api::UiScreensController < ApplicationController 
skip_before_action :verify_authenticity_token 
def index 
uiScreens = [] 
UiScreen.all.each do |uiScreen| 
uiTablesStr = "[" 
uiScreen.ui_tables.each do |uiTable| 
uiTablesStr += uiTable.id.to_s + ",“ 
end 
uiTablesStr.chop! 
uiTablesStr += "]" 
uiScreen.update_attribute(:uiTables, uiTablesStr) 
uiScreens.push(uiScreen) 
end 
jsonHash = JSON.parse(uiScreens.to_json) for item in jsonHash 
item["uiTables"] = eval(item["uiTables"]) 
end 
jsonWrapper = {} 
jsonWrapper["ui_screens"] = jsonStr = jsonWrapper.to_json 
jsonHash = JSON.parse(jsonStr) 
render :json => jsonHash 
end 
Add the all ids of uiTables that belong to the 
uiScreen to array character string. 
Ex:”[1, 2, 5, 6, 7]” 
Then, after transforming it to JSON, 
output it. 
{ 
"ui_screens": [ 
{ 
"config": "{'firstUI':'command','hiddenUIs': 
['physics', 'magic', 'target', 'magic-fake'],' 
calculatePosition': true}", 
"created_at": "2014-09-08T02:07:53.215Z", 
"id": 1, 
"identifier": "battle", 
"uiTables": [1, 2, 5, 6, 7] 
} 
] 
}
Data transfer of 
Ember Data to WebGL
Data transfer to WebGL 
• Not using WebGL directly, I use it via Three.js. 
http://threejs.org 
• I also use tmlib (a cool JS game library by 
@phi-jp). 
http://phi-jp.github.io/tmlib.js/ 
• The tmlib library is integrated with three.js. 
• Today, I will illustrate my method by taking 
the rendering of a game map as an example.
Data transmission of Map Data for Map Rendering 
Ember Data 
Tool.PlayRoute = Ember.Route.extend 
model: (params, transition) -> 
return Ember.RSVP.hash({ 
map: @store.find('squareGrid3dMap', params['id']) 
textures: @.store.find('squareGrid3dMapTexture') 
tiletypes: @.store.find('squareGrid3dMapTileType') 
uiScreens: @.store.find('uiScreen') 
uiTables: @.store.find('uiTable') 
}) 
Rails 
Map Data (Factory Girl) 
trait :as_2 do 
id 2 
name 'デバッグテスト' 
width 5 
height 5 
type_array "1 N,1 W,1 N,1 W,1 Wn" + 
"1 N,1 W,1 N,1 W,1 Wn" + 
"1 N,1 N,1 N,1 N,1 Nn" + 
"1 W,1 W,1 N,1 W,1 Wn" + 
"1 W,1 W,1 N,1 W,1 Wn" 
height_array "0 1,0 1,0 1,0 1,0 1n" + 
"0 1,0 1,0 1,0 1,0 1n" + 
"0 1,0 1,0 1,0 1,0 1n" + 
"0 1,0 1,0 1,0 1,0 1n" + 
"0 1,0 1,0 1,0 1,0 1n" 
end 
Tool.SquareGrid3dMap = DS.Model.extend 
name: attr('string') 
width: attr('number') 
height: attr('number') 
type_array: attr('string') 
height_array: attr('string')
Data transmission of Map Data for Map Rendering 
Tool.PlayIndexRoute = Ember.Route.extend 
model: -> 
@modelFor('play') 
afterModel: (model, transition)-> 
window.WrtGS.main(model) 
function systemMain(err:any, args:any){ 
window.WrtGS = new 
system.System(args); 
} 
module system { 
export class System { 
public main(model:any) { 
this.map = new map.Map(model.map.get(‘type_array’), 
model.map.get(‘height_array’), 
model.texture.get(‘gametex_url’)); 
trait :as_2 do 
id 2 
name 'デバッグテスト' 
width 5 
height 5 
type_array "1 N,1 W,1 N,1 W,1 Wn" + 
"1 N,1 W,1 N,1 W,1 Wn" + 
"1 N,1 N,1 N,1 N,1 Nn" + 
"1 W,1 W,1 N,1 W,1 Wn" + 
"1 W,1 W,1 N,1 W,1 Wn" 
height_array "0 1,0 1,0 1,0 1,0 1n" + 
"0 1,0 1,0 1,0 1,0 1n" + 
"0 1,0 1,0 1,0 1,0 1n" + 
"0 1,0 1,0 1,0 1,0 1n" + 
"0 1,0 1,0 1,0 1,0 1n" 
end 
trait :as_1 do 
id 1 
name 'メタル' 
gametex_url ‘metal.jpg’
Since the data is mere text data, the subsequent processes is 
just to analyze the original text format of map, 
create the geometry of Three.js, and assign texture images to Meshes. 
// 1頂点目 
geom.vertices.push( new THREE.Vector3(x-1, this.maxCeilingHeight, y) ); 
// 2頂点目 
geom.vertices.push( new THREE.Vector3(x-1, ceilingHeight, y) ); 
// 3頂点目 
geom.vertices.push( new THREE.Vector3(x-1, ceilingHeight, y-1) ); 
// 4頂点目 
geom.vertices.push( new THREE.Vector3(x-1, this.maxCeilingHeight, y-1) ); 
// 表三角形の1個目 
var face1 = new THREE.Face3( verticesStride+0, verticesStride+1, verticesStride+2 ); 
face1.normal = new THREE.Vector3(1, 0, 0); 
geom.faces.push( face1 ); 
geom.faceVertexUvs[ 0 ].push( [ 
new THREE.Vector2( 0.75, 0 ), 
new THREE.Vector2( 0.75, this.texcoordOne * (this.maxCeilingHeight - ceilingHeight) ), 
new THREE.Vector2( 1, this.texcoordOne * (this.maxCeilingHeight - ceilingHeight) ) ] );
Transmission of Map Data for Map Rendering 
In the data transmission from Ember.js to WebGL (Three.js), 
I don’t do anything special. 
I just extract strings from the data fulfilled in Ember model, 
analyze them, and transfer them to the function for geometry 
construction of Three.js.
Ember.js Observer and WebGL 
• When an enemy is damaged, the enemy figure 
is vibrated. For this process, I used the 
Observer of Ember.js. 
• Since the status value of a friend and foe is 
supervised as an Ember object, when their 
HPs decrease, the coordinate values of foe 
polygon of three.js are vibrated by activating 
the Observer.
Computation of 
parameters of Game 
character’s 
In RPG, there exists many cases 
where a parameter is calculated 
from the other parameters. 
→By applying computed Properties, 
I solved the problem. 
In the present production tools, we 
can freely create all kind of 
parameters of characters, and also 
can describe a mathematical 
relationship between the character’s 
parameters freely.
Affinity between Ember.js and web games 
• Optimal for display and update of UI 
– Since the first version was processed using jQuery only, the development was 
a hellish battle. Now, due to Ember.js the process becomes quite simple. 
– The Ember.js is suitable for RPG with large number of UI. Why not use that 
power? 
• Two-way binding is useful 
– In a large scale game, data synchronization between multiple points in app is 
required. Ember.js take care whole synchronous processing. 
• Observer is also useful 
– In a game UI, the usage of not only text but also picture often happens. In that 
case, we should use the data binding for the recalculation of inner data only, 
so that we can focus on using another rendering library for animation in 
observer of Ember. 
• The Computed Properties play an active role In a game, such as RPG, that requires 
a lot of computation between parameters.
Ember.js is Terrific! 
• Finally, what I want to claim is, 
• Ember.js supports the basis of both the portions of 
game and production tools in the present Web 
service. 
• If Ember.js was not available, I could not obtain 
effective software development and excellent 
prospect of code. 
Thanks! Ember.js!
Finally 
• For the person who want to learn Ember.js 
– I have posted the Japanese translation of the Ember.js 
official guide on my github 
page.https://github.com/emadurandal/emberjs-guides-japanese- 
translation 
– “Series introduction to Ember.js” at Developers.IO is also 
must-see. 
(Thank you Watanabe-san for your very fine article!) 
http://dev.classmethod.jp/series/getting-started 
%E2%80%8E-emberjs/
Thank you for your attention !

Contenu connexe

Tendances

Node meetup feb_20_12
Node meetup feb_20_12Node meetup feb_20_12
Node meetup feb_20_12
jafar104
 
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Jeado Ko
 

Tendances (20)

Optimize CollectionView Scrolling
Optimize CollectionView ScrollingOptimize CollectionView Scrolling
Optimize CollectionView Scrolling
 
Introduction to HTML5 Canvas
Introduction to HTML5 CanvasIntroduction to HTML5 Canvas
Introduction to HTML5 Canvas
 
Ui perfomance
Ui perfomanceUi perfomance
Ui perfomance
 
Node meetup feb_20_12
Node meetup feb_20_12Node meetup feb_20_12
Node meetup feb_20_12
 
SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling
SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling
SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling
 
Advanced html5 diving into the canvas tag
Advanced html5 diving into the canvas tagAdvanced html5 diving into the canvas tag
Advanced html5 diving into the canvas tag
 
An introduction to the create js suite
An introduction to the create js suiteAn introduction to the create js suite
An introduction to the create js suite
 
Nodejs mongoose
Nodejs mongooseNodejs mongoose
Nodejs mongoose
 
Mongoose and MongoDB 101
Mongoose and MongoDB 101Mongoose and MongoDB 101
Mongoose and MongoDB 101
 
Mongoose getting started-Mongo Db with Node js
Mongoose getting started-Mongo Db with Node jsMongoose getting started-Mongo Db with Node js
Mongoose getting started-Mongo Db with Node js
 
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
 
SVCC 2013 D3.js Presentation (10/05/2013)
SVCC 2013 D3.js Presentation (10/05/2013)SVCC 2013 D3.js Presentation (10/05/2013)
SVCC 2013 D3.js Presentation (10/05/2013)
 
Bootstrap과 UI-Bootstrap
Bootstrap과 UI-BootstrapBootstrap과 UI-Bootstrap
Bootstrap과 UI-Bootstrap
 
Heroku pop-behind-the-sense
Heroku pop-behind-the-senseHeroku pop-behind-the-sense
Heroku pop-behind-the-sense
 
CANVAS, SVG, WebGL, CSS3, WebEvent
CANVAS, SVG, WebGL, CSS3, WebEventCANVAS, SVG, WebGL, CSS3, WebEvent
CANVAS, SVG, WebGL, CSS3, WebEvent
 
Code Tops Comments
Code Tops CommentsCode Tops Comments
Code Tops Comments
 
Eclipse Tricks
Eclipse TricksEclipse Tricks
Eclipse Tricks
 
Mongoose: MongoDB object modelling for Node.js
Mongoose: MongoDB object modelling for Node.jsMongoose: MongoDB object modelling for Node.js
Mongoose: MongoDB object modelling for Node.js
 
Rapidly Iterating Across Platforms with Server-Driven UI
Rapidly Iterating Across Platforms with Server-Driven UIRapidly Iterating Across Platforms with Server-Driven UI
Rapidly Iterating Across Platforms with Server-Driven UI
 
Rapidly Iterating Across Platforms using Server-Driven UI
Rapidly Iterating Across Platforms using Server-Driven UIRapidly Iterating Across Platforms using Server-Driven UI
Rapidly Iterating Across Platforms using Server-Driven UI
 

En vedette

Common social
Common socialCommon social
Common social
Dduncan73
 
Lte 5 presentation lte realibility -
Lte 5 presentation lte realibility -Lte 5 presentation lte realibility -
Lte 5 presentation lte realibility -
Fithri Yenti Hasibuan
 
Communication Networks in Manufacturing p.p.
Communication Networks in Manufacturing p.p.Communication Networks in Manufacturing p.p.
Communication Networks in Manufacturing p.p.
Bennett Roberson
 
How to create a power point presentation
How to create a power point presentationHow to create a power point presentation
How to create a power point presentation
Jchadwell
 
Test method of reading comprehension
Test method of reading comprehensionTest method of reading comprehension
Test method of reading comprehension
Fithri Yenti Hasibuan
 
FRANCESCO BORROMINI
FRANCESCO BORROMINIFRANCESCO BORROMINI
FRANCESCO BORROMINI
Tatheer Atif
 
Schneider electric strategy presentation
Schneider electric strategy presentationSchneider electric strategy presentation
Schneider electric strategy presentation
bkaur11
 

En vedette (16)

Common social
Common socialCommon social
Common social
 
Pakistan quarters
Pakistan quartersPakistan quarters
Pakistan quarters
 
Ember.js Tokyo event 2014/09/22 (Japanese)
Ember.js Tokyo event  2014/09/22 (Japanese)Ember.js Tokyo event  2014/09/22 (Japanese)
Ember.js Tokyo event 2014/09/22 (Japanese)
 
Lte 5 presentation lte realibility -
Lte 5 presentation lte realibility -Lte 5 presentation lte realibility -
Lte 5 presentation lte realibility -
 
Fun pastimes
Fun pastimesFun pastimes
Fun pastimes
 
H7N9 in China
H7N9 in ChinaH7N9 in China
H7N9 in China
 
Bagian ii-e-peendekatan-komunikatif
Bagian ii-e-peendekatan-komunikatifBagian ii-e-peendekatan-komunikatif
Bagian ii-e-peendekatan-komunikatif
 
H7N9 in China 3
H7N9 in China 3 H7N9 in China 3
H7N9 in China 3
 
Communication Networks in Manufacturing p.p.
Communication Networks in Manufacturing p.p.Communication Networks in Manufacturing p.p.
Communication Networks in Manufacturing p.p.
 
Modul 1 matlab 1
Modul 1 matlab 1Modul 1 matlab 1
Modul 1 matlab 1
 
How to create a power point presentation
How to create a power point presentationHow to create a power point presentation
How to create a power point presentation
 
Test method of reading comprehension
Test method of reading comprehensionTest method of reading comprehension
Test method of reading comprehension
 
Andrea palladio
Andrea palladioAndrea palladio
Andrea palladio
 
FRANCESCO BORROMINI
FRANCESCO BORROMINIFRANCESCO BORROMINI
FRANCESCO BORROMINI
 
Assignment Five: Thank You, M'am
Assignment Five: Thank You, M'amAssignment Five: Thank You, M'am
Assignment Five: Thank You, M'am
 
Schneider electric strategy presentation
Schneider electric strategy presentationSchneider electric strategy presentation
Schneider electric strategy presentation
 

Similaire à Ember.js Tokyo event 2014/09/22 (English)

JavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de DatosJavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de Datos
philogb
 
JavaScript para Graficos y Visualizacion de Datos - BogotaJS
JavaScript para Graficos y Visualizacion de Datos - BogotaJSJavaScript para Graficos y Visualizacion de Datos - BogotaJS
JavaScript para Graficos y Visualizacion de Datos - BogotaJS
philogb
 
前端MVC 豆瓣说
前端MVC 豆瓣说前端MVC 豆瓣说
前端MVC 豆瓣说
Ting Lv
 
Mongo db washington dc 2014
Mongo db washington dc 2014Mongo db washington dc 2014
Mongo db washington dc 2014
ikanow
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
Justin Cataldo
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
Igor Bronovskyy
 

Similaire à Ember.js Tokyo event 2014/09/22 (English) (20)

AWS EC2
AWS EC2AWS EC2
AWS EC2
 
JavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de DatosJavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de Datos
 
JavaScript para Graficos y Visualizacion de Datos - BogotaJS
JavaScript para Graficos y Visualizacion de Datos - BogotaJSJavaScript para Graficos y Visualizacion de Datos - BogotaJS
JavaScript para Graficos y Visualizacion de Datos - BogotaJS
 
Svcc 2013-d3
Svcc 2013-d3Svcc 2013-d3
Svcc 2013-d3
 
Viktor Tsykunov: Azure Machine Learning Service
Viktor Tsykunov: Azure Machine Learning ServiceViktor Tsykunov: Azure Machine Learning Service
Viktor Tsykunov: Azure Machine Learning Service
 
Ext JS Introduction
Ext JS IntroductionExt JS Introduction
Ext JS Introduction
 
Intro to HTML5
Intro to HTML5Intro to HTML5
Intro to HTML5
 
Scalable web application architecture
Scalable web application architectureScalable web application architecture
Scalable web application architecture
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.js
 
Learn D3.js in 90 minutes
Learn D3.js in 90 minutesLearn D3.js in 90 minutes
Learn D3.js in 90 minutes
 
前端MVC 豆瓣说
前端MVC 豆瓣说前端MVC 豆瓣说
前端MVC 豆瓣说
 
Mongo db washington dc 2014
Mongo db washington dc 2014Mongo db washington dc 2014
Mongo db washington dc 2014
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
 
How to make a video game
How to make a video gameHow to make a video game
How to make a video game
 
Getting Input from User
Getting Input from UserGetting Input from User
Getting Input from User
 
Unit-2 Getting Input from User.pptx
Unit-2 Getting Input from User.pptxUnit-2 Getting Input from User.pptx
Unit-2 Getting Input from User.pptx
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
 
Aprimorando sua Aplicação com Ext JS 4 - BrazilJS
Aprimorando sua Aplicação com Ext JS 4 - BrazilJSAprimorando sua Aplicação com Ext JS 4 - BrazilJS
Aprimorando sua Aplicação com Ext JS 4 - BrazilJS
 
A la découverte de TypeScript
A la découverte de TypeScriptA la découverte de TypeScript
A la découverte de TypeScript
 
Unreal Engine Basics 02 - Unreal Editor
Unreal Engine Basics 02 - Unreal EditorUnreal Engine Basics 02 - Unreal Editor
Unreal Engine Basics 02 - Unreal Editor
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Dernier (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Ember.js Tokyo event 2014/09/22 (English)

  • 1. An example of game developing with Ember.js and WebGL Yuki Shimada 2014/09/22
  • 2. About me • I majored in Computer Graphics at Toho University, Chiba prefecture. • I have developed a Game Engine for PS3 at a venture company established in the University of Tokyo. • Then, I have transfered to Sopia Inc. (now Accenture Inc.), as a system engineer. • I have also worked to develop a renderer and WebGL Web sites at a VFX studio. • Currently, I’m a freelancer (Web & CG).
  • 3. Demonstration • Game Player http://youtu.be/0iRTk_2Wjp8 • Map Editor http://youtu.be/u6F3wGJpnUo
  • 4. My Game Web Service • The web service that makes easily able to develop RPG and share it on the web. • The RPG developers is divided into basic developers and advanced developers. • The advanced developers can develop RPG from the stage of game system. – You can write game code using TypeScript. – (I hope to support visual programming via node connecting in the future). – You can customize UI design using SCSS. • The basic developers can cherry-pick one from game systems developed by advanced developers, then within the framework of the game system, they can easily create RPG with mouse operation only.
  • 5. The structure of this web service • This web service consists of two parts; game player and production tools. • These are constructed on Ruby on Rails. – View and controller of Rails are rarely used. – Ember.js controls all of the system, and Rails provide only model data. – To describe the view, I used Emblem. http://emblemjs.com – To transfer model data from Rails to Ember, I used Ember Data and ActiveModel::Serializers. – This sample made by @ursm was very helpful in usage of Ember Data and ActiveModel::Serializers. http://ursm.jp/blog/2013/12/03/ember-js-and-rails/
  • 6. Languages • This system was wrote in CoffeeScript for production tools, and TypeScript for game player. • Ember.js is manipulated from Both CoffeeScript(production tools) and TypeScript(game player) . • The definition of Router is wrote in CoffeeScript.
  • 7. Using of Ember.js • UI handling • Data transfer of Rails Model -> Ember Data • Data transfer of Ember Data -> WebGL • Ember.js Observer and WebGL • Computation of Game character’s parameters
  • 9. UI Handling • UI consists of HTML(Emblem) and CSS(SCSS). – Creators can customize the look & feel of UI using SCSS. • The UI is controlled by Two-stage structure model; ‘uiScreen’ and ‘uiTable’. • The Screens(‘uiScreen’s) correspond to the Template of Ember. • Screen switching is performed by switching templates via Ember,js. • Switching between display and non-display of the tables(‘uiTable’s) under the screen is performed by jQuery.
  • 10. テーブル(’ uiTable’)uiScreen and uiTable スクリーン(’ uiScreen’)
  • 11. Data transfer from Rails Model to Ember Data
  • 12. Between Rails and Ember Data The data that are complex and frequently modified are hold in the column in the Rails model as JSON text. Using the Transform feature of Ember Data, transforming it to real JSON by eval in JavaScript, finally we obtain Ember objects. Definition of Ember Data Model A fixture of Rails Model (Factory Girl) trait :as_2 do id 2 ui_screen_id 1 screenIdentifier 'battle' tableIdentifier 'character_0' tableName '0:' tableName_binding 'Tool.EScenarioCharacter.0.name' selectable false trs "[" + "{"+ "'columns':[" + "{" + "'item':'HP:'," + "'binding': 'Tool.EScenarioCharacter.0.hp'" + "}" + "]" + "}," + "{"+ "'columns':[" + "{" + "'item':'MP:'," + "'binding': 'Tool.EScenarioCharacter.0.mp'" + "}" + "]" + "}" + "]" end var uiTableDefinition = { screenIdentifier: DS.attr('string'), tableIdentifier: DS.attr('string'), tableName: DS.attr('string’), tableName_binding: DS.attr('string'), selectable: DS.attr('boolean'), trs: DS.attr('uiTableTrs'), … }; Transform of Ember Data Model window.Tool.UiTableTrsTransform = DS.Transform.extend( { deserialize: function(value:any) { var json:any = null; eval("json = " + value); return Ember.create(json); } });
  • 13. Question : How can we get one–to-many relationships of Ember Data Models from Rails Models? • There exists a partially different part in data expression of ‘one to many’ in Rails and Ember Data. • In Rails, if the child model has reference to the parent model, you can get the list of child models from the parent model. • In Ember Data, the parent model must expressly have the id array of the child models. • From the above difference, conversion process is needed. App.Post = DS.Model.extend({ comments: DS.hasMany('comment', {async: true}) }); { "post": { "comments": [1, 2, 3] } } App.Comment = DS.Model.extend({ post: DS.belongsTo('post') }); { "comment": { "post": 1 } } class Post < ActiveRecord::Base has_many :comments end create_table ”posts", force: true do |t| end class Comment < ActiveRecord::Base belongs_to :post end create_table ”comments", force: true do |t| t.integer "ui_screen_id” end
  • 14. Question : How can we get one–to-many relationships of Ember Data Models from Rails Models? Ember Data Rails Model var uiScreenDefinition = { var uiTableDefinition = { screenIdentifier: DS.attr('string'), tableIdentifier: DS.attr('string'), tableName: DS.attr('string’), tableName_binding: DS.attr('string'), selectable: DS.attr('boolean'), trs: DS.attr('uiTableTrs'), … }; identifier: DS.attr('string'), config: DS.attr('uiScreenConfig'), uiTables: DS.hasMany('ui-table') }; Definition of ‘uiScreen’ which has many uiTables Definition of ‘uiTable’ which belongs to ‘uiScreen’ create_table "ui_screens", force: true do |t| t.string "identifier" t.text "config" t.text "uiTables” end class UiScreen < ActiveRecord::Base has_many :ui_tables end create_table "ui_tables", force: true do |t| t.integer "ui_screen_id" t.string "screenIdentifier" t.string "tableIdentifier" t.string "tableName" t.string "tableName_binding" t.boolean "selectable" t.text "trs” end class UiTable < ActiveRecord::Base belongs_to :ui_screen end
  • 15. Answer: To generate has-many id array toward Ember Data using Rails’ controller. class Api::UiScreensController < ApplicationController skip_before_action :verify_authenticity_token def index uiScreens = [] UiScreen.all.each do |uiScreen| uiTablesStr = "[" uiScreen.ui_tables.each do |uiTable| uiTablesStr += uiTable.id.to_s + ",“ end uiTablesStr.chop! uiTablesStr += "]" uiScreen.update_attribute(:uiTables, uiTablesStr) uiScreens.push(uiScreen) end jsonHash = JSON.parse(uiScreens.to_json) for item in jsonHash item["uiTables"] = eval(item["uiTables"]) end jsonWrapper = {} jsonWrapper["ui_screens"] = jsonStr = jsonWrapper.to_json jsonHash = JSON.parse(jsonStr) render :json => jsonHash end Add the all ids of uiTables that belong to the uiScreen to array character string. Ex:”[1, 2, 5, 6, 7]” Then, after transforming it to JSON, output it. { "ui_screens": [ { "config": "{'firstUI':'command','hiddenUIs': ['physics', 'magic', 'target', 'magic-fake'],' calculatePosition': true}", "created_at": "2014-09-08T02:07:53.215Z", "id": 1, "identifier": "battle", "uiTables": [1, 2, 5, 6, 7] } ] }
  • 16. Data transfer of Ember Data to WebGL
  • 17. Data transfer to WebGL • Not using WebGL directly, I use it via Three.js. http://threejs.org • I also use tmlib (a cool JS game library by @phi-jp). http://phi-jp.github.io/tmlib.js/ • The tmlib library is integrated with three.js. • Today, I will illustrate my method by taking the rendering of a game map as an example.
  • 18. Data transmission of Map Data for Map Rendering Ember Data Tool.PlayRoute = Ember.Route.extend model: (params, transition) -> return Ember.RSVP.hash({ map: @store.find('squareGrid3dMap', params['id']) textures: @.store.find('squareGrid3dMapTexture') tiletypes: @.store.find('squareGrid3dMapTileType') uiScreens: @.store.find('uiScreen') uiTables: @.store.find('uiTable') }) Rails Map Data (Factory Girl) trait :as_2 do id 2 name 'デバッグテスト' width 5 height 5 type_array "1 N,1 W,1 N,1 W,1 Wn" + "1 N,1 W,1 N,1 W,1 Wn" + "1 N,1 N,1 N,1 N,1 Nn" + "1 W,1 W,1 N,1 W,1 Wn" + "1 W,1 W,1 N,1 W,1 Wn" height_array "0 1,0 1,0 1,0 1,0 1n" + "0 1,0 1,0 1,0 1,0 1n" + "0 1,0 1,0 1,0 1,0 1n" + "0 1,0 1,0 1,0 1,0 1n" + "0 1,0 1,0 1,0 1,0 1n" end Tool.SquareGrid3dMap = DS.Model.extend name: attr('string') width: attr('number') height: attr('number') type_array: attr('string') height_array: attr('string')
  • 19. Data transmission of Map Data for Map Rendering Tool.PlayIndexRoute = Ember.Route.extend model: -> @modelFor('play') afterModel: (model, transition)-> window.WrtGS.main(model) function systemMain(err:any, args:any){ window.WrtGS = new system.System(args); } module system { export class System { public main(model:any) { this.map = new map.Map(model.map.get(‘type_array’), model.map.get(‘height_array’), model.texture.get(‘gametex_url’)); trait :as_2 do id 2 name 'デバッグテスト' width 5 height 5 type_array "1 N,1 W,1 N,1 W,1 Wn" + "1 N,1 W,1 N,1 W,1 Wn" + "1 N,1 N,1 N,1 N,1 Nn" + "1 W,1 W,1 N,1 W,1 Wn" + "1 W,1 W,1 N,1 W,1 Wn" height_array "0 1,0 1,0 1,0 1,0 1n" + "0 1,0 1,0 1,0 1,0 1n" + "0 1,0 1,0 1,0 1,0 1n" + "0 1,0 1,0 1,0 1,0 1n" + "0 1,0 1,0 1,0 1,0 1n" end trait :as_1 do id 1 name 'メタル' gametex_url ‘metal.jpg’
  • 20. Since the data is mere text data, the subsequent processes is just to analyze the original text format of map, create the geometry of Three.js, and assign texture images to Meshes. // 1頂点目 geom.vertices.push( new THREE.Vector3(x-1, this.maxCeilingHeight, y) ); // 2頂点目 geom.vertices.push( new THREE.Vector3(x-1, ceilingHeight, y) ); // 3頂点目 geom.vertices.push( new THREE.Vector3(x-1, ceilingHeight, y-1) ); // 4頂点目 geom.vertices.push( new THREE.Vector3(x-1, this.maxCeilingHeight, y-1) ); // 表三角形の1個目 var face1 = new THREE.Face3( verticesStride+0, verticesStride+1, verticesStride+2 ); face1.normal = new THREE.Vector3(1, 0, 0); geom.faces.push( face1 ); geom.faceVertexUvs[ 0 ].push( [ new THREE.Vector2( 0.75, 0 ), new THREE.Vector2( 0.75, this.texcoordOne * (this.maxCeilingHeight - ceilingHeight) ), new THREE.Vector2( 1, this.texcoordOne * (this.maxCeilingHeight - ceilingHeight) ) ] );
  • 21. Transmission of Map Data for Map Rendering In the data transmission from Ember.js to WebGL (Three.js), I don’t do anything special. I just extract strings from the data fulfilled in Ember model, analyze them, and transfer them to the function for geometry construction of Three.js.
  • 22. Ember.js Observer and WebGL • When an enemy is damaged, the enemy figure is vibrated. For this process, I used the Observer of Ember.js. • Since the status value of a friend and foe is supervised as an Ember object, when their HPs decrease, the coordinate values of foe polygon of three.js are vibrated by activating the Observer.
  • 23. Computation of parameters of Game character’s In RPG, there exists many cases where a parameter is calculated from the other parameters. →By applying computed Properties, I solved the problem. In the present production tools, we can freely create all kind of parameters of characters, and also can describe a mathematical relationship between the character’s parameters freely.
  • 24. Affinity between Ember.js and web games • Optimal for display and update of UI – Since the first version was processed using jQuery only, the development was a hellish battle. Now, due to Ember.js the process becomes quite simple. – The Ember.js is suitable for RPG with large number of UI. Why not use that power? • Two-way binding is useful – In a large scale game, data synchronization between multiple points in app is required. Ember.js take care whole synchronous processing. • Observer is also useful – In a game UI, the usage of not only text but also picture often happens. In that case, we should use the data binding for the recalculation of inner data only, so that we can focus on using another rendering library for animation in observer of Ember. • The Computed Properties play an active role In a game, such as RPG, that requires a lot of computation between parameters.
  • 25. Ember.js is Terrific! • Finally, what I want to claim is, • Ember.js supports the basis of both the portions of game and production tools in the present Web service. • If Ember.js was not available, I could not obtain effective software development and excellent prospect of code. Thanks! Ember.js!
  • 26. Finally • For the person who want to learn Ember.js – I have posted the Japanese translation of the Ember.js official guide on my github page.https://github.com/emadurandal/emberjs-guides-japanese- translation – “Series introduction to Ember.js” at Developers.IO is also must-see. (Thank you Watanabe-san for your very fine article!) http://dev.classmethod.jp/series/getting-started %E2%80%8E-emberjs/
  • 27. Thank you for your attention !

Notes de l'éditeur

  1. ・Web上で簡単にRPGが作れるWebサービス。 ・想定開発者をベーシック開発者とアドバンスド開発者の2つに分けている。 ・アドバンスド開発者はRPGのゲームシステムを開発することができる。 ・ゲームコードはTypeScriptで記述できる。 ・将来的には、ノード接続によるビジュアルプログラミングに対応したい。 ・UIのカスタマイズもSCSSで可能。 ・ベーシック開発者は、アドバンスド開発者が開発したゲームシステムの中から好きなものを選び、その枠内でマウス操作だけで簡単にRPGが作れる。
  2. ・ゲームプレーヤー部分と制作ツール部分の2つから構成される。 ・全体がRuby on Rails上で構築されている。 ・RailsのView、Controllerは殆ど使っていない。 ・Ember.jsで全てを制御。Railsはモデルデータを提供するだけ。 ・ビューの記述にはEmblemを使用。 ・RailsからのEmberへのモデルデータ伝達には、Ember DataとActiveModel::Serializersを利用。 ・参考URL:@ursmさんの以下のサンプルが参考になりました。
  3. ・制作ツール側はCoffeeScriptで、ゲームプレーヤー部分はTypeScriptで記述。 ・CoffeeScript(制作ツール)、TypeScript(ゲームプレーヤー)双方から、Ember.jsを操作。 ・全体のRouter定義はCoffeeScript側で行っている。
  4. ・UIはHTML(Emblem)+CSS(SCSS)でできている。 ・クリエーターはSCSSで見た目をカスタマイズ可能。 ・スクリーン(‘uiScreen’)-&amp;gt;テーブル(‘uiTable’)の2段階構造のモデルでUIを管理。 ・スクリーン=Ember.jsのテンプレート・Ember.jsでテンプレートを切り替えて、スクリーンの切り替えをしている。 ・スクリーン配下のテーブルの表示・非表示はjQueryで。
  5. 複雑または構造の変更が多いデータは、JSONテキストデータとしてRailsモデルのカラムに保存。Ember DataのTransformを使い、JavaScriptでevalして、Emberオブジェクト化している。
  6. Question : Ember Dataモデルの一対多関係をRailsのモデルからどう復元する? ・RailsとEmber Dataの一体多のデータ表現では、一部異なる点がある。 ・Railsでは、子モデルが親モデルの参照を持つだけで、親モデルから子モデルのリストにアクセス可能。 ・Ember Dataでは、親モデルが子モデルのid配列を明示的に持つ必要がある。 ・上記の違いがあるため、両者のやりとりには変換処理が必要。
  7. 答え : RailsのControllerでEmber Data向けにhas many id配列を生成する ・uiScreenにbelong to している全てのuiTableのidを配列文字列に追加。 ・そして、JSON化して出力
  8. ・WebGLを直接触っているのではなく、Three.jsを利用。 ・tmlibというゲームライブラリを使用。 ・tmlibはthree.jsと統合されている。 ・今回は、マップの描画を例に取って解説。
  9. ・あとは、ただのテキストデータなので、独自マップテキストフォーマットを解析し、Three.jsのジオメトリ作成、テクスチャ画像割り当てを行う。
  10. ・Ember.jsからWebGL(Three.js)へのデータ受け渡しは、そんな特別なことはしていない。 ・Ember Dataモデルで、Fulfilledされたデータから文字列を取り出し、それを文字列解析して、Three.jsのジオメトリ構築用の関数に渡しているだけ。
  11. ・敵がダメージを受けると、敵画像が揺れたりしているが、これはEmber.jsのObserverを使っている。 ・敵や味方のステータス値もEmberオブジェクトとして管理しており、HPが減るとObserverが起動、Three.jsの敵ポリゴンの座標値を振動させている。
  12. ・RPGでは、あるパラメーターから他のパラメーターを算出する、というケースが非常に多い。  →Computed Propertiesで解決。 ・本制作ツールでは、キャラクターのパラメーターを自由に新設し、パラメーター間の数学関係を自由に記述できる。
  13. Ember.jsとWebゲームの親和性 ・UIの表示・更新に最適! ・初期バージョンはjQueryのみで処理していたが、やはり地獄だった。今はEmber.jsのお陰でかなりスマートになった。 ・UIの数が多いRPGなどには特に向いている。使わない手はない。 ・双方向バインディングが便利。 ・大型のゲームになると、複数の場所間でデータを同期する必要が生じるが、同期処理の面倒はすべてEmber.jsが見てくれる。 ・オブザーバーも便利。 ・ゲームUIでは単なるテキストではなく、画像を使用することも多い。内部データの再計算だけにデータバインディングを使用し、アニメーションは別描画ライブラリを併用することも可能。表示の更新のタイミングはObserverで。 ・RPGなど、パラメーター同士の計算が多いゲームではComputed Propertiesが活躍する。
  14. ・以上、Ember.jsは本Webサービスのゲーム部分、制作ツール部分双方の根底を支えている。 ・Ember.jsがなければ、ここまでの開発効率とコードの見通しの良さは考えられなかった. ありがとう、Ember.js!
  15. ・Ember.jsを学びたい方。 ・Ember.js公式ガイド日本語訳を公開しています! ・Developers.IOの「シリーズEmber.js入門」も必見。 (渡辺さん素晴らしい記事をありがとう!)