是什么能够两小时写出《flppybird》游戏--绘制场景
2015-03-02 08:50
197 查看
我参考了/article/11477374.html
这篇博客的技巧来实现flppybird的绘制管道。
这是最终效果 一定要点击效果哦。
下面的代码是我们参考博客的升级版
大家如果不熟悉这个函数多多看看官方的api哦 http://www.wooyoogame.com/api/
这篇博客的技巧来实现flppybird的绘制管道。
这是最终效果 一定要点击效果哦。
下面的代码是我们参考博客的升级版
LoadImage("imageBird", ":/blog/游戏博客/flppybird/image/bird.png"); channelSprite=//创建管道的精灵 { type:"sprite"; Blend: "alpha"; Width: 20%; Height: 80%; X:100%; Y:50%; attachCamera:true;//设置附着镜头 如果没有设为true,今天移动他就不会动 Texture: "imageBird";//设置纹理 CenterY: 100%;//中心点坐标Y(50%表示图中心) Y:0; Texcoord:{112/1024,645/1024,55/1024,320/1024};//纹理坐标 }; channelUpSprite = ( { type:"sprite"; Blend: "alpha";//设置为透明 Width: 20%; Height: 80%; X:0;//下半截管道的X坐标和上半截的相同 attachCamera:true; Y:50%;//生成下半截管道的Y坐标 加一个随机数是上面管道和下面的管道的空隙 Texture: "imageBird"; Texcoord:{168/1024,645/1024,55/1024,320/1024}//纹理坐标 }); //生成100对管道 foreach(1...100, { //上半截高度和X轴时随机的 space = 30; case((30- value*0.2)> 20, { space =(30- value*0.2) }, (30- value*0.2)< 29, { space=20 });//不断减小管道间的空隙 tempX = (50*value+rand(-5,10))%; tempY = rand(10,40)%; create({X:tempX;Y:tempY+space+rand(-5,2)}::channelUpSprite); create({X:tempX;Y:tempY}::channelSprite); }); Camera=//设置镜头的状态 { viewX:0;//镜头的X位置为0; }; setCamera(Camera);//设置镜头 系统函数 Camera.viewX <:{50,(500*70),350000};//设置镜头移动从50 到500*70 事件为350000ms也就是350秒
大家如果不熟悉这个函数多多看看官方的api哦 http://www.wooyoogame.com/api/
相关文章推荐
- 是什么能够两小时写出《flppybird》游戏--绘制背景和UI控件
- 是什么能够两小时写出《flppybird》游戏
- 是什么能够两小时写出《flppybird》游戏--制作小鸟的动画
- android:如何用一天时间,写出“飞机大战”这样的游戏!(无框架-SurfaceView绘制)
- 绘制2D游戏场景
- 创建XNA Shooter游戏——游戏场景绘制
- android:怎样用一天时间,写出“飞机大战”这种游戏!(无框架-SurfaceView绘制)
- 透视投影绘制 游戏场景
- Unity2d 弱联网游戏制作(二) 动画、场景、渲染层、碰撞检测、音乐播放
- cocos2d-x游戏开发系列教程-坦克大战游戏关卡选择场景的编写上
- 【开源java游戏框架libgdx专题】-08-中文显示与绘制
- HTML5吃豆豆游戏开发实战(一)使用Canvas绘制游戏主角
- 简单实现手机游戏雪花场景效果
- 用VC6.0与OpenGL实现游戏场景设计
- hbase常识及habse适合什么场景
- Unity3D研究院之游戏场景的切换与持久化简单数据的储存(十四)
- 【Cocos2d-x游戏引擎开发笔记(10)】自定义场景和场景跳转
- 游戏服务端究竟解决了什么问题?
- 游戏制作--在场景中移动(一)
- 英文经典好歌《Nothing's Gonna Change My Love For You》没有什么能够改变我对你的爱-英译中