Unity2D 制作小游戏FlappyBird心得—Unity5学习笔记
前些天用Unity2D制作了一个小游戏FlappyBird,算作是计算机图形学这门课的一个小作业了,我用的Unity开发引擎版本是5.4.1_64-bit的,其中有些控件的脚本语法跟Unity4的不太一样,这也给我的自学过程造成了很多困扰,网上的代码很多都是Unity4版本的,没法在5上实现。
我写这篇文章希望能记录一些用Unity5做游戏的心得和技巧以及一些基本功能的实现方法(比如声音、动画、捆绑物体、随机生成物体、用图形显示得分数字等等),便于给自己和今后的Unity游戏开发初学者以参考。
用英文写了,就当练一下英语写作了,speaking of writing 都是泪啊T_T,我们说好的要分手呢,雅思?总分够了,写作只有5.5分 T_T……………..Zhazha English ,couhe look look
目录:
1.设置默认开发工具
2.素材收集
3.分层
4.拖入素材,设置背景图片层次
5.动画设计
6.给物体设置物理属性(刚体和球体)
7.合并柱子并添加碰撞边缘
8.脚本中调用并修改刚体属性及碰撞检测
9.随机生成柱子
10.用图形显示数字
11.添加音效
12.切换场景
13.添加按钮和文本框
附录I——C#script of one bird
1.At the initial stage of the project ,set the default external tools .
I’m used to VS 2013:
Edit->Preferences->External Tools
2.Collect some assets including audios and pictures .
Just drag the pictures into the Folder .
My friend helped me collect those .
And I know a website with lots of useful resources : itch.io
Some of them need payments ,but many of them are free to download with the source file of Unity .
3. create layers:Edit->project settings->Tags and layers
Like the picture shows below ,in “inspector” view on the right ,click sorting layers and add two layers “back ”and “fore ”.