Cocos2d-x in Action: Lua Edition (2nd Edition) cover

Cocos2d-x in Action: Lua Edition (2nd Edition)

No rating yet
Word count
639K words
Chapters
31
Series
Tsinghua Game Development Series
ISBN
9787302457305

Tags

Summary

Cocos2d-x in Action: Lua Edition (2nd Edition) is a fully updated edition of Cocos2d-x in Action: Lua Edition, systematically teaching game programming and project development with Cocos2d-x's Lua bindings. The book has 25 chapters in six parts. The Fundamentals part (Chapters 1–9) starts with Lua basics, an introduction to Cocos2d-x Lua, and setting up the development environment, then introduces core classes layer by layer: labels, menus, sprites, scenes, layers, actions, effects, animation, and user events. The Advanced part (Chapters 10–15) covers game music and sound effects, particle systems, tile maps, the physics engine, Cocos2d-x GUI controls, and the engine's 3D features. The Data and Networking part (Chapters 16–18) covers data persistence, HTTP-based networking, and Node.js with WebSocket networking. The Optimization part (Chapter 19) discusses performance optimization. The Multi-platform Porting part (Chapters 20–21) covers porting to Android and iOS respectively. The Hands-on part (Chapters 22–25) covers managing code with Git, then completes a project based on the mobile game Lost Route, and finally walks through publishing to Google Play and the Apple App Store. The book covers the complete pipeline as it builds the project, making it suitable for readers who want to go from beginner to independently developing a complete game.

Editor's review

这是一本“从语法到上架”一条龙式的 Cocos2d-x Lua 教程。它的价值主要有三点。第一,结构清晰:六篇二十五章把引擎知识点拆成基础、进阶、数据与网络、优化、移植、实战六个层级,读者可以按顺序推进,也可以把进阶篇当作查阅手册。第二,覆盖面完整:从精灵、动作、场景这些日常必须用到的核心类,到粒子、瓦片地图、物理引擎、GUI 控件、3D 特性,再到 HTTP、WebSocket 网络通信与性能优化,手游上线前后会用到的环节基本都有对应章节。第三,落点明确:最后以“迷失航线”完整项目串起前面知识点,并补充 Git 版本管理与 Google Play、App Store 的上架流程,让读者知道代码如何变成能发布的产品。本书是第 2 版,在前一版基础上做了更新与完善,并配套提供源代码下载、勘误与技术支持。需要提醒的是,书中内容基于当年的引擎版本,部分 API 与工程配置已随引擎演进而变化,读者练习时建议以官方文档为准。

Who it's for

A good fit for

  • 已掌握至少一门编程语言,想用脚本语言快速上手手游开发的初学者
  • 正在使用或计划使用 Cocos2d-x Lua 做 2D 手游的独立开发者
  • 高校游戏开发、移动应用方向课程的学生与任课教师
  • 需要补充引擎 Lua 绑定、网络通信与多平台移植知识的技术人员

Not a good fit for

  • 完全没有编程基础、也无意先补习编程入门的读者
  • 只想学习 Lua 语言本身、不关心游戏引擎应用的读者
  • 追求最新引擎版本与新版本 API 的开发者,需以官方文档为主

Reading tips

  1. 先按基础篇顺序动手敲一遍示例,把精灵、动作、场景、事件等核心概念跑通再往下读
  2. 进阶篇可结合自己的项目需求跳读,物理引擎、瓦片地图与 GUI 控件建议边查边用
  3. 实战篇的“迷失航线”建议独立复现一遍,再对照书中代码与配套源码排查差异
  4. 书中代码受引擎版本影响,遇到接口不一致时以对应版本官方文档和示例为准

About the publisher

Tsinghua University Press China · Founded in 1980

Founded in 1980, Tsinghua University Press has 57 titles in our collection, covering popular science, medicine, health, law, philosophy and social sciences. Representative works include medical popular-science books such as Cancer Truth: Doctors Are Reading It Too and New Knowledge on Cancer by Bo Luo (Li Zhizhong), legal titles such as Sunshine Is the Best Preservative: Express Delivery of Major Global Anti-Corruption Cases, and works like Qi Ge's A Brief History of Philosophy with Big Ideas and Liu Yunhao's From the Internet to a New Industrial Revolution. Its authors include science writers, medical researchers, the Renmin University of China anti-corruption master's class and university scholars, reflecting a publishing profile that balances academic seriousness with accessible reading. As public information is limited, this profile is based only on the titles in our collection.

Contents

  1. Part 1 Fundamentals
  2. Chapter 1 Lua Language Basics
  3. Chapter 2 Introduction to Cocos2d-x Lua
  4. Chapter 3 Setting Up the Environment
  5. Chapter 4 Labels
  6. Chapter 5 Menus
  7. Chapter 6 Sprites
  8. Chapter 7 Scenes and Layers
  9. Chapter 8 Actions, Effects, and Animation
  10. Chapter 9 User Events
  11. Part 2 Advanced Topics
  12. Chapter 10 Game Music and Sound Effects
  13. Chapter 11 Particle Systems
  14. Chapter 12 Tile Maps
  15. Chapter 13 Physics Engine
  16. Chapter 14 Cocos2d-x GUI Controls
  17. Chapter 15 3D Features in Cocos2d-x
  18. Part 3 Data and Networking
  19. Chapter 16 Data Persistence
  20. Chapter 17 HTTP-Based Networking
  21. Chapter 18 Node.js and WebSocket Networking
  22. Part 4 Optimization
  23. Chapter 19 Performance Optimization
  24. Part 5 Multi-platform Porting
  25. Chapter 20 Porting to Android
  26. Chapter 21 Porting to iOS
  27. Part 6 Hands-on Practice
  28. Chapter 22 Managing Code with Git
  29. Chapter 23 Project Practice: The Lost Route Mobile Game
  30. Chapter 24 Publishing to Google Play
  31. Chapter 25 Publishing to the Apple App Store

FAQ

这本书适合零基础学编程的人吗?
不太适合。书中开篇即讲 Lua 语言基础,但节奏较快,默认读者具备基本编程概念。若从未写过代码,建议先补一门语言的基础语法,再回来读本书会顺畅许多。
第2版和第1版有什么区别?
第2版是在畅销的第1版基础上全面升级而成,内容框架同为六篇,但对引擎版本、示例代码与工程实践做了更新与完善,并继续提供源码下载、勘误与技术支持服务。有第1版的读者可重点看变化部分。
这本书配套资源在哪里获取?
出版社与电商页面均说明,本书配套提供源代码下载、勘误和技术支持,具体网址见书中前言。建议先下载源码再动手练习,便于对照排查报错。
书中的技术内容现在还有用吗?
本书出版于 2017 年。引擎核心概念(节点树、动作系统、事件分发、渲染层级等)依然通用,但部分 API、工程配置和第三方工具链已发生变化,建议结合当前官方文档学习并做适配。

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

About the author

Guan Dongsheng Author · China · 1973

Guan Dongsheng, born in December 1973, is a Chinese mobile development expert, CTO, IT author, founder and chief training expert of Zhijie Classroom, a Cocos Most Valuable Professional (CVP), and a senior lecturer at 51CTO Academy. Proficient in iOS, Android, Python and related technologies, he has participated in projects such as the Beijing public transit card and has written more than fifty technical books, including the iOS Development Guide and Python from Beginner to Expert. His writing focuses on programming fundamentals and practical application. Recent works cover the use of Python, MATLAB and R for scientific plotting and academic charts, as well as AI-era topics such as financial big-data analysis and quantitative trading with tools like ChatGPT and DeepSeek. He often uses comics and full-color illustrations to lower the barrier to learning, balancing interest with practicality.

More by the same author

Top rated in the same category