Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
quick-cocos2d-x 培训 01
Search
YuLei Liao
February 28, 2013
Programming
300
3
Share
quick-cocos2d-x 培训 01
YuLei Liao
February 28, 2013
Other Decks in Programming
See All in Programming
ハーネスエンジニアリングにどう向き合うか 〜ルールファイルを超えて開発プロセスを設計する〜 / How to approach harness engineering
rkaga
28
22k
PHPer、Cloudflare に引っ越す
suguruooki
2
200
AIを導入する前にやるべきこと
negima
2
350
AI時代になぜ書くのか
mutsumix
0
390
20年以上続くプロダクトでも使い続けられる静的解析ツールを求めて
matsuo_atsushi
0
150
JCON - Create Agentic AI Apps, The Easy Way!
kdubois
1
110
t *testing.T は どこからやってくるの?
otakakot
1
930
空間オーディオの活用
objectiveaudio
0
150
cloudnative conference 2026 flyle
azihsoyn
0
180
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
260
Making the RBS Parser Faster
soutaro
0
710
Structured Concurrency, Scoped Values and Joiners in the JDK 25 26 27
josepaumard
1
150
Featured
See All Featured
The SEO identity crisis: Don't let AI make you average
varn
0
460
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.6k
Tell your own story through comics
letsgokoyo
1
920
Documentation Writing (for coders)
carmenintech
77
5.3k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
300
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
690
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
240
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
BBQ
matthewcrist
89
10k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
140
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.2k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Transcript
quick-cocos2d-x 架构
quick-cocos2d-x 架构
搭建开发环境 • http://dualface.github.com/blog/2013/02/28/ from-flash-to-quick/
cocos2d-x基本概念 • 坐标系:左下⾓角为屏幕原点、图像的锚点默认 在中央 • “节点树”结构 • CCNode/CCScene/CCLayer/CCSprite • Action:
MoveTo, MoveBy, RotationTo, ScaleTo.. • 事件:touch(began, moved, ended, cancelled), enterFrame
Lua 的核⼼心⽤用法 • 函数是值(与AS3、JS等⼀一样) • 表格是唯⼀一的数据容器(赋值时只拷⻉贝引⽤用) • 数组、字典 • clone()
函数 • ⽤用表格模拟对象 • self, “:”和“.”的区别 • class() 函数
quick framework • 很薄的⼀一层封装,简化最常⻅见的操作 • display 模块 • transition 模块
• display 模块如何扩展 cocos2d-x 的 C++ 对象
Component-based Architecture • 对象仅仅是“容器”:ObjectBase • 以“⾏行为”扩展对象:object:bindMethod() 为对象绑定⼀一个⽅方法 • 创建⾏行为,绑定⾏行为到对象 •
不同“⾏行为”的组合就可以满⾜足任意需求
Component-based Architecture • ⾏行为间的依赖和优先级 • ⽅方法链:不同⾏行为可以为对象绑定同名 ⽅方法;在⽅方法中可以调⽤用同名⽅方法的“⽗父 类”实现 • 不影响性能