描述
开 本: 16开纸 张: 胶版纸包 装: 平装-胶订是否套装: 否国际标准书号ISBN: 9787517059349
本书针对的是对HTML5游戏开发或应用开发感兴趣的初学者,书中有意弱化了对概念、定义的精确描述和堆叠,避免了很多初学者面对陌生的技术名词时产生恐惧和障碍心理。不论是手机页游、微信游戏还是APP游戏,也不论你是没有任何编程开发经验的新手还是跨领域的开发学习者,这本书都会为你学习HTML5、Egret Engine和游戏开发带来帮助,并为进一步实践和提升指出了方向。
本书以案例教学的方式,讲解了如何使用白鹭引擎(Egret Engine)及配套工具开发HTML5游戏。案例由简至繁,选取了当前应用领域常见的摇奖游戏、卡牌游戏、平台游戏、塔防游戏以及在线聊天,讲解了白鹭引擎支持图形图 像、多媒体、交互与事件、粒子特效、EUI、物理引擎、人工智能及网络通信方面的功能,讨论了程序开发时的调试、面向对象设计、设计模式及应用程序框架等应用方法。本书*后介绍了实际项目开发中的一些应用技巧。本书适合从事H TML5开发的初级技术人员,也可供HTML5开发培训机构参考。
前言
第1章认识当代互联网核心技术—HTML5··········· 1
1.1 为什么使用HTML5开发游戏···················· 1
1.1.1 游戏!游戏!········································ 2
1.1.2 微信中的应用和小程序························ 2
1.1.3 全平台的HTML5应用·························· 3
1.2 Egret
Engine与游戏开发···························· 4
1.2.1 如何学习游戏开发································ 4
1.2.2 为什么使用Egret Engine······················ 5
1.2.3 Egret
Engine还可以做什么·················· 5
1.3 如何使用本书············································· 5
1.3.1 如果你是游戏开发新手························ 5
1.3.2 如果你有开发经验································ 5
1.3.3 获取相关网络资源································ 6
第2章就这么简单—10分钟开发
一个HTML5应用························································· 7
2.1 开发前的准备工作····································· 7
2.1.1 软件下载················································ 7
2.1.2 安装配置················································ 7
2.1.3 软件界面················································ 9
2.2 开发“Hello world”应用························ 11
2.2.1 新建项目·············································· 12
2.2.2 运行项目·············································· 14
2.2.3 编辑项目内容······································ 15
2.3 把应用发布到网络上······························· 20
2.4 TypeScript基础·········································· 21
2.4.1 TypeScript简介···································· 21
2.4.2 对象的属性和方法······························ 22
2.4.3 对象的事件及运行流程······················ 23
2.4.4 编程基础·············································· 24
第3章互动与特效—摇奖游戏制作···················· 47
3.1 使用多媒体元素······································· 47
3.1.1 使用图片·············································· 49
3.1.2 使用资源管理器实现预加载·············· 52
3.1.3 显示图像·············································· 54
3.2 特效制作与应用······································· 58
3.2.1 粒子特效介绍······································ 58
3.2.2 Egret
Feather使用······························ 59
3.2.3 花瓣飘落及元宝掉落特效·················· 60
3.3 事件机制··················································· 65
3.3.1 什么是事件(Event)························· 65
3.3.2 使用事件监听器(Event
Listener)··· 66
第4章多样的交互界面—卡牌游戏制作············ 69
4.1 所见即所得的界面编辑··························· 69
4.1.1 准备设计资源······································ 72
4.1.2 EXML可视化编辑器···························· 74
4.1.3 皮肤分离机制······································ 79
4.2 交互界面开发··········································· 80
4.2.1 主要界面开发······································ 80
4.2.2 界面逻辑实现······································ 85
4.3 EUI详细介绍············································· 96
4.3.1 EXML····················································· 96
4.3.2 控件和容器·········································· 99
4.3.3 自定义组件········································ 121
第5章模拟物理—动作类平台游戏制作·········· 123
5.1 游戏设计思路及任务分解····················· 123
5.2 素材准备················································· 124
5.3 设计游戏界面········································· 131
5.3.1 游戏加载界面···································· 131
5.3.2 游戏开始界面······································ 133
5.4 场景逻辑················································· 133
5.4.1 载入界面············································ 133
5.4.2 开始界面············································ 135
5.5 使用p2物理引擎··································· 137
5.5.1 导入第三方库···································· 138
5.5.2 角色制作············································ 138
5.5.3 制作游戏场景···································· 143
5.5.4 碰撞检测与开发································ 144
5.6 运行时错误调试····································· 148
5.6.1 Chrome调试······································ 148
5.6.2 “调试”视图···································· 150
第6章人工智能—经典塔防游戏制作·············· 156
6.1 塔防游戏设计及任务分解····················· 156
6.1.1 塔防游戏元素分析···························· 156
6.1.2 面向对象编程···································· 158
6.1.3 MVC设计模式··································· 165
6.2 塔防游戏开发········································· 167
6.2.1 地图制作方法···································· 167
6.2.2 炮塔与子弹制作································ 171
6.2.3 游戏图形渲染机制分析···················· 175
6.3 让炮塔更加智能····································· 176
6.3.1 人工智能的应用································ 176
6.3.2 智能炮塔设计开发···························· 178
第7章建立通信—网络多人聊天······················ 180
7.1 应用设计及分析····································· 180
7.1.1 网络资源设计···································· 180
7.1.2 多人聊天逻辑设计···························· 181
7.1.3
WebSocket原理及配置···················· 182
7.1.4 开放平台原理及使用························ 184
7.2 游戏聊天室开发····································· 185
7.3 通过微信分享········································· 190
7.3.1 配置JS-SDK第三方库······················· 190
7.3.2 微信JS-SDK的使用··························· 191
7.3.3 微信分享接口使用···························· 193
第8章高级技巧······················································ 195
8.1 实际开发中的常见问题························· 195
8.1.1 屏幕适配与自动布局························ 195
8.1.2 如何使用第三方库···························· 198
8.2 跨平台开发与发布································· 202
8.2.1 iOS和Android APP生成方法··········· 202
8.2.2 微信小程序生成方法························ 204
8.3 接下来做什么········································· 208
评论
还没有评论。