当前位置: 老葡京网站娱乐 > 网页设计 > HTML 5教程 > 正文

用HTML 5来开发一款android本地化App游戏-宝石碰碰

时间:2014-03-16 lufy

老葡京网站娱乐 www.sdguanhua.com 首先来开发一个类似于对对碰的游戏,不过此游戏玩法为在下原创,如有雷同,纯属巧合,游戏界面 如下。

游戏操作:上下左右划动 屏幕,来操作宝石向不同的方向移动。

游戏规则:当有三个一样的宝石相邻则消除,被消除过一 次的宝石会变成半透明,当所有宝石都被消除一次后,则进入下一关。

游戏测试连接:

http://lufylegend.com/demo/GemGem

制作开始

一,准备

首先,需要下载lufylegend.js引擎,下面是我在博客的 lufylegend-1.7.0发布帖

http://blog.csdn.net/lufy_legend/article/details/8719768

二,游戏开发

引擎lufylegend1.7.0中扩展了LLoadManage静态类,可以读取图片,js文件以 及文本文件,本次游戏开发就来体验一下这个新功能,首先看下面数组

代码清单1

var 

loadData = [  
{path:"../jquery.js",type:"js"},  
{path:"./js/share.js",type:"js"},  
{path:"./js/Social.js",type:"js"},  
{path:"./js/GameRanking.js",type:"js"},  
{path:"./js/GameLogo.js",type:"js"},  
{path:"./js/GameClear.js",type:"js"},  
{path:"./js/Gem.js",type:"js"},  
{path:"./js/Stage.js",type:"js"},  
{path:"./js/Clock.js",type:"js"},  
{path:"./js/Point.js",type:"js"},  
{path:"./js/GetPoint.js",type:"js"},  
{path:"./js/Bullet.js",type:"js"},  
{path:"./js/Event.js",type:"js"},  
{path:"./js/function.js",type:"js"},  
{path:"./js/GameBody.js",type:"js"},  
{name:"num.+",path:"./images/plus.png"},  
{name:"num.0",path:"./images/0.png"},  
{name:"num.1",path:"./images/1.png"},  
{name:"num.2",path:"./images/2.png"},  
{name:"num.3",path:"./images/3.png"},  
{name:"num.4",path:"./images/4.png"},  
{name:"num.5",path:"./images/5.png"},  
{name:"num.6",path:"./images/6.png"},  
{name:"num.7",path:"./images/7.png"},  
{name:"num.8",path:"./images/8.png"},  
{name:"num.9",path:"./images/9.png"},  
{name:"back",path:"./images/back.png"},  
{name:"line",path:"./images/line.png"},  
{name:"clear",path:"./images/clear.png"},  
{name:"gem01",path:"./images/gem01.png"},  
{name:"gem02",path:"./images/gem02.png"},  
{name:"gem03",path:"./images/gem03.png"},  
{name:"gem04",path:"./images/gem04.png"},  
{name:"gem05",path:"./images/gem05.png"},  
{name:"gem06",path:"./images/gem06.png"},  
{name:"gem07",path:"./images/gem07.png"},  
{name:"gem08",path:"./images/gem08.png"},  
{name:"gem09",path:"./images/gem09.png"},  
{name:"ico_sina",path:"./images/ico_sina.gif"},  
{name:"ico_qq",path:"./images/ico_qq.gif"},  
{name:"ico_facebook",path:"./images/ico_facebook.png"},  
{name:"ico_twitter",path:"./images/ico_twitter.png"}  
];