桌球小游戏是 BigBear 老师设计、撰写的中英双语的 Cocos Creator 入门教程,面向 Cocos Creator 初学者,但不论你技术如何,相信你会在 BigBear 老师的文章中有所收获。
Shawn 上周天推送了完整中文版本,为了让大家有一个好的学习体验,我将《Cocos Creator入门实战:桌球小游戏》一文拆分成若干篇中英双语的教程,我们一起学习游戏、学习英语(看我公众号的名字就知道Shawn的英语有多low)!
上一次我们介绍的是如何开启物理系统,继续我们的双语桌球教程,今天我们来布局桌球。
桌面节点
在Canvas下面创建一个子节点作为我们的桌面节点。
Create a sprite node named 'table', its parent is 'Canvas' node. This node is our billiard table.
给它添加一个cc.Sprite组件并且给予它显示的spriteFrame
Set its spriteframe proerty used the spriteframe asset named 'bg'
Now we implement its physics features
Add a 4 four-box collider component
add 6 circle collider component
最终的节点碰撞体应调整为这样的效果:
When you finish these steps, you will see the table in the scene editor with debug info drawing. Example:
本文分享自 Creator星球游戏开发社区 微信公众号,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文参与 腾讯云自媒体同步曝光计划 ,欢迎热爱写作的你一起参与!