新出的角色扮演游戏怎么只上3个将

有款僵尸小游戏就三个关卡,三把枪那是什么游戏_百度知道
有款僵尸小游戏就三个关卡,三把枪那是什么游戏
有款僵尸小游戏就三个关卡,三把枪那是什么游戏有的僵尸是在地上爬的
您的回答被采纳后将获得:
系统奖励15(财富值+成长值)+难题奖励20(财富值+成长值)
我有更好的答案
你好,下面这个站点的小游戏比较新,种类也比较多,要什么都有哦。
为您推荐:
其他类似问题
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。下载数量:14250
开发者:珠海顶峰互动科技有限公司
手机扫码,快速下载!
《史上最坑爹的游戏3》全关卡通关图文攻略大全
《史上最坑爹的游戏3》简称《坑3》,是继《坑1》及《坑2》火遍中国大陆及港澳台之后,原创团队精心推出的续作。《坑1》及《坑2》共获得超过3000万的游戏玩家,目前还在持续增长中。《坑3》依然是24个关卡,一如既往地遵循逆思维以及打破常规意识束缚的原则,游戏创意依旧,玩法也依旧坑爹,除了逆向思维解谜外,还加入了敏捷操作的元素,并在游戏美术上作了一次大的升级,音效更加专业,并采用欢快风格为主,游戏内容更加搞笑,相信能再次风靡一时,今天给大家带来游戏的通关图文攻略。第一关从第一关开始,《史上最坑爹的游戏3》就带给大家不一样的感觉,第一关最开始的玩法和《愤怒的小鸟》一样,在小人做出航母“起飞”姿势的同时把小鸟弹射出去就好了,弹射的方法就是弹弓拉到最下方的水平位置就可以了。弹出去之后就会看到小鸟在空中飞行,飞到一定程度后,我们就要回答坑爹团队的第一个问题了,这个问题我们只能选择“是的,我愿意”才能顺利通过。回答完成只会,本馆真正的坑爹问题就来了,算来算去确实有些费脑子,不过笔者在这里告诉大家答案,标准答案就是“-2”,也就是亏了2块钱。输入之后游戏还会给大家一个具体的解释,相信很多玩家都会看得懂。这一关其实就是最后的题目考验了玩家对于数字方面的逻辑能力,我们在算题的时候尽量不要把问题复杂化就可过关了。第二关第二关是一个看图猜成语的关卡,首先游戏为大家提供了一张图,图例是一个卫生间加“只准小便”四个字,而我们可以遐想一下,这个图中词可以引出“无地放屎”这个词,那么答案就是“无的放矢”了。这一关比较考验玩家的思维, 但相对来说也比较简单。第三关这一关看起来就比较喜感了,为什么这样说呢?原因就是因为这款的元素就是一个小人和一个大大的苹果,我们只需要一直按住苹果的中间位置让苹果停止转动就可以过关了。这个关卡笔者实在没想出路游戏的目的是什么,也许开发商考虑的是很多玩家认为让苹果一直转动才会过关,而不是停止才过关吧。第四关到了第四关难度就有些增加了,首先我们要点击右侧的大石头,然后用手指向上滑动石头,之后让大石头从空中掉落,反复操作12次才能把这个大石头砸成几块小石头。砸碎了之后,我们要迅速的将小石块一个一个的移动到水瓶中,如果玩家在这时的动作稍慢,那么小人就会被晒死。而我们迅速的将石头扔进去之后谁就会慢慢溢出来,这样我们就可以过关了。这一关考验的是玩家的反应能力和敏捷度,在摔碎石头和移动石头时都要迅速才行。如果慢一点游戏的小人就会被晒死。第五关这一关有点唐伯虎点秋香的意思,我们要帮助小人找到他的真猛天女才行。首先点击小人的头部,这时秋香的偷袭就会浮现出来。等秋香出现之后,我们要按住秋香的头像,然后拖动到祝枝山的脸上,这样就可以完成换脸了。最后我们只需要点击一下祝枝山的身体就能顺利过关啦!之后两个人就可以幸福的在一起啦,这关的难度并不大,只要玩家细心观察就可以顺利通过了。第六关这一关大家看着 是不是很眼熟,没错这关的主题就是借鉴了最近两年比较火爆的电视节目《好声音》,不过玩家在这里千万不要点击任何一位导师,我们要做的就是用手指分别按住小人身体的两侧,然后他就会自己手舞足蹈起来。经过几秒钟的等待,精神病院的救护车就会把小人带走了,我们也可以顺利通过了。& & & &这一关主要就是给大家一个新颖的形式和玩法,正常情况下我们一般都会点击导师,但游戏中我们则要反着来才能通过。第七关这一关完全就可以体现坑爹游戏的精华了,原因很简单就是玩家想要通过的话就必须不断地颠倒沙漏100次或者摇晃手机100次才行。当我们摇晃到手酸时就可以顺利通过了。第八关这一关的难度就在于玩家要有非常敏捷的速度,首先游戏开始之后会出现一个力度条,这个力度条一定要保证接近100%才能打断柱子。打断柱子之后,我们要迅速的向左滑动几次屏幕,这样小人就可以向左躲开倒下的柱子了,接下来就是通过的时刻啦。这关主要考验了玩家的手指点击屏幕的速度以及反应能力,只要狠心点击手机屏幕就可以顺利通过了。第九关这一关其实就是想办法把小人从门中就出就可以了。首先我们要向对着大门来回的滑动几次,这样大门就会被击破。之后拖动屏幕右下角的梯子到悬崖边上,然后点击小人,这时他就顺利的获救了。这一关的难度并不大,玩家就是需要仔细的观察图中的元素就可以顺利过关了。第十关这一关考验的就是玩家的英文阅读能力了,笔者认为这关还是很有难度的。第一个提示的意思是:本关总共有3个任务,只有分别完成所有小任务才能顺利通关。第一个小任务是让玩家快速的摇晃手机15次,完成任务后就会被打上绿色的小勾,这样我们就完成了第一个任务。第二个小任务是需要我们把手机向上抛3次(一定要垂直抛弃,千万不要让手机翻转)。另外还要要抛离双手再接住才行。第三个小任务就是放下你的设备,和你妈妈说一句“我爱你”,其实我们只需要将设备放到桌子上就可以顺利通关了,说不说随你们喽。这关完全就是锻炼玩家的英文能力,如果你的英文不太好,那么可以借助查询工具来通关。第十一关这一关也是比较眼熟吧,游戏有点类似于妈妈再打我一次,通过这关并不需要什么技巧,只需要一直扇小女孩巴掌,在扇的过程中一定要无视变大的药丸,不点一直扇就好了。之后左右移动小女孩,狂扇60下巴掌就可以过关了,实在是无节操啊。第十二关这关还是大家熟悉的场景,游戏类似于找你妹的玩法,虽然关卡是要求找妹子,但实际上我们要在图中找到钱、房子、车子和钻石这4样东西,一定要按住顺序来哦。按顺序把4样东西找到后,再找到右上角的确定按钮。最后就能找到妹子啦!!!这一关其实就是考验玩家的眼力,但寻找起来并不难,我们只需要按照顺序寻找就可以过关了。第十三关这一关的场景就是我们小时候玩过的红白机中最经典的坦克大战游戏改编,过关的方法非常简单粗暴,不用管上方的坦克,我们只需要把金色坦克移动到BOSS的正上方,然后对着它无限开炮就可以了,打穿外面的护甲后,就可以直接干掉BOSS过关了。这一关其实就是给玩家一个发泄的机会,我们可以先对付上方的坦克,也可以直接干掉BOSS过关。第十四关这一关玩家要掌握好节奏,首先我们要通过下层木桩的堵截,然后来到上层,这个步骤比较简单,之后拿到奖杯。但是当我们即将拿到奖杯的那一瞬间,坑爹的事情发生了,奖杯自动掉落到下层了,没办法,我们只能原路返回,再次拿到奖杯才行。这关并没有什么技巧,我们只需要掌握好节奏就可以顺利的上下层穿越了,笔者也是玩了好几回才过关,当然如果我们有金币的话也可以直接跳过。第十五关在大家经历了非常坑爹的一关之后,接下来的这一关看起来就比较欢乐了,我们要进行偷菜行动。首先点击太阳,让场景变成夜晚。这样才有利于我们偷菜。然后我们要拖动图中的喷壶把小人旁边的火堆浇灭。之后拖动铲子到被浇灭的火堆,然后挖出一只“叫花鸡”。然后拖动叫花鸡到看守的猎犬处,这样就可以把看菜的狗狗引走了。最后拖动金手套到菜地,我们就可以顺利的偷菜啦。这一关主要考验了玩家的逻辑性,要一步一步的慢慢进行就可以 顺利通关了。第十六关《Flappy Bird》的风靡程度想必是被《坑爹》团队所录用了,原因就是这一关完全就是《Flappy Bird》的翻版,玩法与《Flappy Bird》一样,我们首先要努力的飞过15根柱子。飞过15根柱子之后我们会遇到气球绑着金币,这里千万不要贪婪的去吃金币,我们一定要一直飞过去才行,这样就可以顺利通过了。第十七关这一关与外星人有关,游戏开始的时候都不要做,慢慢等待女神掉下悬崖即可。当女神即将掉落悬崖的时刻,我们要迅速的点击女神,然后就可以把她救起来了,我们也就顺利过关啦。& & & &这关其实就是考验玩家的稳准狠,关键时刻关键迅速点击就可以过关了。& & & &第十八关这一关看起来就比较欢乐了,一上来我们会看到游戏中有一个拳击手,大家会认为这关只要把对方打败就好了?其实这一关并不需要打到对手,我们只需要逃跑就可以了,首先向左移动慢慢靠近拳击手,当被他发现之后,我们要迅速向右奔跑。然后利用游戏中的跳跃键来躲避前方的障碍,一直跑到尽头就会发现拳击手被一道墙挡住,这时我们就可以顺利过关了。这一关的技巧在于躲避障碍和反向思维,千万不要碰到拳击手,我们只需要在游戏中用跑酷的形式玩这关就可以了。第十九关这一关有点像小时候大家玩的》冒险岛》,玩家主需要控制小人跳过15根柱子就可以过关了。这关我们只需要掌握好节奏就可以顺利过关了,并没有什么难度。第二十关这一关大家一定非常怀念,原因就是关卡看起来十分像》魂斗罗》,游戏开始之后我们要一路向右移动,然后用攻击键来杀敌。一路打到所有敌人之后,天空中就会飞过超级武器,这时玩家一定要抓住时机跳起吃到它。之后一路向左返回,就会看到一只大虫子,用超级武器干掉它就能过关了。这一关其实就是让玩家怀念一下童年的游戏,技巧在于吃完超级武器之后要留到最后才可以使用。第二十一关这一关非常简单,我们可以完全忽略游戏中的所有场景,只要点击右上角的求助按钮,分享到微信、QQ空间或者微博三个钟的任意一个地方就能过关了。这关并不需要任何技巧,只要我们的手机有网络就可以了。第二十二关这一关也没有任何技巧可言,让大家玩手机的真实目的其实就是让玩家在100秒内毁掉图中的手机,提供的道具都是浮云,我们只需要拿着手机轻轻在桌子上或者手上敲几下就能过关了。这一关其实就是考验玩家的反向思维,有时候道具未必用得上,其他的方法却很实用。第二十三关这关其实就是另类的跑酷风格,游戏主要看最后时刻玩家的反应能力。游戏开始之后我们用手指按住图中的脚印开始奔跑,一定要跟住前面弟弟的脚步。当距离还剩下100米的时候,会出现一个长相很奇葩的怪物障碍,这时我们要迅速把他拖下来绊倒弟弟,这样我们就可以顺利过关了。这一关考验了玩家的反应能力,很多时候在一种状态下保持时间过久就会分神,所以这关要高度集中并反应迅速。第二十四关这是《史上最坑爹的游戏3》中最后一个关卡了,这一关是一道毫无节操的数字题。接下来笔者就为大家解答。首先设孩子年龄为X,亲年龄为Y,然后列出方程式:Y-X=21(Y+6)/(X+5)=5算出X=0。75最后得出结论目前小孩还没有出生。所以爸爸现在应该是在“照顾”妈妈。你懂得。爸爸现在应该还在妈妈身上辛勤努力地工作。以上就是笔者为大家介绍的《史上最坑爹的游戏3》游戏全部关卡的通关技巧,游戏中我们会遇到很多熟悉的场景,并且通过的难度也从易到难,玩起来的还是十分有乐趣,十分坑爹的。
《史上最坑爹的游戏3》全关卡通关图文攻略大全,以上就是119手游网小编阿2为您带来的详细介绍!
北京新鱼网络科技有限公司 Copyright (C) 2015.www.119you.com ALL Rights Reserved
京网文[8号
最新手机游戏排行榜热门游戏下载就在119手游网
违法和不良信息举报电话:维护中
举报邮箱:维护中学会分享才能取得更大的进步
消消乐游戏算法实现(三消乐)
先上前端效果图
3消乐地图初始化的时候不允许有下面两种情况的发生,就是不允许个(个以上已经包含个,所以只要判断个就可以了)相同颜色的格子连在一起,
下图是两种情况,细分分为种情况,就是初始点为个格子中的一个为一种情况,所以细分种情况
代码中的方法是
private boolean isLine(int x, int y){....}
代码过多,不写出来了
首先初始化地图,看代码注释应该看差不多了
3消规则,只要地图中包含其中以下种情况就可以判断该地图不是死图,红色部分表示
相同颜色的格子,黄色代表如果这个位置如果也是相同颜色只要一动一个位置就可以
3个相同颜色格子并排在一起
比如第一张图,首先判断它上或者下是否有相同颜色
如果格子是初始格子是红色
先判断标识格子是否为红色,如果不是一图的情况不用判断了,如果也是红色
那么只要判断上面第一张图的个黄色位置的格子只要有一个是红色,那么格子就不是死格子,那么这个图就不是死图
第张图,只要判断任意两个相邻黄色位置的格子有种情况:跟同时为红,跟跟,跟的颜色也是红色那么该格子不是死格子,该图不是死图
跟第二种很像,不过相邻变成了左右,我就不说了
细分的话应该有 种情况,所以这个方法的代码量最大,不细说了
代码方法是private boolean isDie(int x, int y) {...}
判断这个格子是否是个以上颜色相同格子相连
比如以格子为起点,然后向前后左右个方向扩张
用递归的方法,就有个方法,每个方法添加相
代码大概如下
colSet =上下相邻颜色相同的格子=向上颜色的格子+向下颜色的格子
rowSet =左右相邻颜色相同的格子=向左颜色的格子+向右颜色的格子
如果他们等于3个或者3个以上,那么他们就要被消,先存起来
removeCellSet
后面再一次性消玩
i为格子的x坐标,j为y坐标
客户端要求如果不相连的区域要分离出来发给他们,分离出来的列表都要排序,这个要求比较蛋疼
格子坐标(x,y)
格子还有颜色属性Color
比如上图,removeCellSet包含上面格子的key=x+”_”+y;
只能用递归,
向相邻的格子扩张,如果相同颜色并且在removeCellSet里面
格子消掉并下降
例如上图给子格子下降
获取所有要消除的给子的x轴
比如有x=0;x=2;x=3这3列中都有空格
然后给这3列的非空格子排序,并重新按顺序填充格子,y大排下面,排完后剩下就为空,效果如下(我这是最简单的方法,不易出错,这个可以优化,优化就比较复杂了)
3消中最重要的的方法在这里,上面的方法都在这下面按顺序执行
上面代码的流程图
因为能消,所以再消
再消,但不能再消乐,得移动其中的格子
package com.eyugame.tade.module.glops.
* 宝石颜色
public enum Color {
package com.eyugame.tade.module.glops.
import java.util.ArrayL
import java.util.C
import java.util.C
import java.util.HashS
import java.util.L
import java.util.R
import java.util.S
import com.eyugame.tade.module.glops.constant.C
import com.eyugame.tade.module.glops.exception.NearCellE
import com.eyugame.tade.module.glops.exception.NoSpoilageE
import com.eyugame.tade.module.glops.model.C
import com.eyugame.tade.module.glops.model.RemoveScaleR
* @author pengwei
public class BasePlay {
private final static String LINK = "_";
private Cell[][]
* 横轴单元格数量
private int xS
* 竖轴单元格数量
private int yS
* 可以供随机的颜色
private List&String& liveColorList = new ArrayList&String&();
* 一次移动的一组(可能多次消除和生成)
private List&RemoveScaleResult& removeScaleResultL
* 要移除的位置
private Set&String& removeCellSet = new HashSet&String&();
* 构造方法
* @param xSize
* @param ySize
public BasePlay(int xSize, int ySize) {
this.xSize = xS
this.ySize = yS
this.maps = new Cell[xSize][ySize];
random = new Random();
this.initMaps();
while (this.isDieMap()) {
this.initMaps();
* 初始化地图,给地图上色
private void initMaps() {
this.initLiveColor();
for (int i = 0; i & this.xS i++) {
for (int j = 0; j & this.yS j++) {
// 可供选择的颜色
int liveSize = liveColorList.size();
// 判断该位置是否有可供选择的颜色
if (liveSize & 0) {
// 随机颜色
int tem = random.nextInt(liveSize);
Cell cell = new Cell();
String liveColor = liveColorList.get(tem);
// 给格子上坐标跟颜色
cell.setX(i);
cell.setY(j);
cell.setColor(Color.valueOf(liveColor));
// 放进地图
maps[i][j] =
// 判断该格子是否有3个连在一起
if (this.isLine(i, j)) {
// 如果是有颜色重叠,从供选择的颜色中去掉该颜色,并重新随机颜色
j = j - 1;
liveColorList.remove(liveColor);
// 如果颜色没有3个重复,则初始化可供选择颜色
this.initLiveColor();
// 如果没有可以选择的颜色,初始化地图
this.maps = new Cell[xSize][ySize];
this.initMaps();
* 初始化随机颜色
private void initLiveColor() {
liveColorList = new ArrayList&String&();
Color[] colors = Color.values();
for (Color color : colors) {
liveColorList.add(new String(color.toString()));
* 填充地图 不允许3格一排或者一列
* @param x
填充格子的x轴
* @param y
填充格子的y轴
* @return 是否填充成功
private boolean isLine(int x, int y) {
boolean lx1 = x - 1 & -1;
boolean lx2 = x - 2 & -1;
boolean bx1 = x + 1 & this.xS
boolean bx2 = x + 2 & this.xS
boolean ly1 = y - 1 & -1;
boolean ly2 = y - 2 & -1;
boolean by1 = y + 1 & this.yS
boolean by2 = y + 2 & this.yS
if (ly1 && by1) {
if (isCellColorEqual(maps[x][y - 1], maps[x][y], maps[x][y + 1])) {
if (lx1 && bx1) {
if (isCellColorEqual(maps[x - 1][y], maps[x][y], maps[x + 1][y])) {
if (ly2) {
if (isCellColorEqual(maps[x][y], maps[x][y - 1], maps[x][y - 2])) {
if (by2) {
if (isCellColorEqual(maps[x][y], maps[x][y + 1], maps[x][y + 2])) {
if (lx2) {
if (isCellColorEqual(maps[x][y], maps[x - 1][y], maps[x - 2][y])) {
if (bx2) {
if (isCellColorEqual(maps[x][y], maps[x + 1][y], maps[x + 2][y])) {
* 相邻3个格子是否同一颜色
* @param cell1
* @param cell2
* @param cell3
* @return 统一颜色为true,不同为false
private boolean isCellColorEqual(Cell cell1, Cell cell2, Cell cell3) {
if (cell1 != null && cell2 != null && cell3 != null) {
Color color1 = cell1.
Color color2 = cell2.
Color color3 = cell3.
if (color1 != null && color2 != null && color3 != null) {
return (color1 == color2 && color1 == color3);
* 在补图要添加的格子中相邻3个格子是否同一颜色
* @param cell1
* @param cell2
* @param cell3
* @return 统一颜色为true,不同为false
private boolean isCellColorEqualInAddCell(Cell cell1, Cell cell2, Cell cell3, Set&Cell& set) {
if (cell1 != null && cell2 != null && cell3 != null) {
if (set.contains(cell1) && set.contains(cell2) && set.contains(cell3)) {
Color color1 = cell1.
Color color2 = cell2.
Color color3 = cell3.
if (color1 != null && color2 != null && color3 != null) {
return (color1 == color2 && color1 == color3);
* 右边颜色一样的格子
private void isCellColorEqualRight(int x, int y, Color color, Set&String& set) {
set.add(this.getKey(x, y));
int newX = x + 1;
if (newX & this.xSize) {
if (maps[newX][y] != null && maps[newX][y].color == color) {
this.isCellColorEqualRight(newX, y, color, set);
* 左边颜色一样的格子
private void isCellColorEqualLeft(int x, int y, Color color, Set&String& set) {
set.add(this.getKey(x, y));
int newX = x - 1;
if (newX &= 0) {
if (maps[newX][y] != null && maps[newX][y].color == color) {
this.isCellColorEqualLeft(newX, y, color, set);
* 主键生成
* @param x
* @param y
private String getKey(int x, int y) {
return x + BasePlay.LINK +
* 上边颜色一样的格子
private void isCellColorEqualUp(int x, int y, Color color, Set&String& set) {
set.add(this.getKey(x, y));
int newY = y - 1;
if (newY &= 0) {
if (maps[x][newY] != null && maps[x][newY].color == color) {
this.isCellColorEqualUp(x, newY, color, set);
* 下边颜色一样的格子
private void isCellColorEqualDown(int x, int y, Color color, Set&String& set) {
set.add(this.getKey(x, y));
int newY = y + 1;
if (newY & this.ySize) {
if (maps[x][newY] != null && maps[x][newY].color == color) {
this.isCellColorEqualDown(x, newY, color, set);
* 在删除的节点中,找到相邻的相同颜色的格子
* @param x
* @param y
* @param color
* @param set
* @param cSet
private void nearAdd(int x, int y, Color color, Set&String& set, Set&String& cSet) {
if (!cSet.isEmpty()) {
String nKey = this.getKey(x, y);
cSet.remove(nKey);
set.add(nKey);
if (x - 1 & -1) {
String key = this.getKey(x - 1, y);
if (removeCellSet.contains(key) && !set.contains(key) && maps[x - 1][y].color == color) {
this.nearAdd(x - 1, y, color, set, cSet);
if (x + 1 & this.xSize) {
String key = this.getKey(x + 1, y);
if (removeCellSet.contains(key) && !set.contains(key) && maps[x + 1][y].color == color) {
this.nearAdd(x + 1, y, color, set, cSet);
if (y - 1 & -1) {
String key = this.getKey(x, y - 1);
if (removeCellSet.contains(key) && !set.contains(key) && maps[x][y - 1].color == color) {
this.nearAdd(x, y - 1, color, set, cSet);
if (y + 1 & this.ySize) {
String key = this.getKey(x, y + 1);
if (removeCellSet.contains(key) && !set.contains(key) && maps[x][y + 1].color == color) {
this.nearAdd(x, y + 1, color, set, cSet);
* 移动 将source 移动至target
* @param source
* @param target
* @throws Exception
public List&RemoveScaleResult& move(Cell source, Cell target) {
if (source != null && target != null) {
if (this.near(source, target)) {
Color targetColor = maps[target.X][target.Y].
Color sourceColor = maps[source.X][source.Y].
maps[source.X][source.Y].color = targetC
maps[target.X][target.Y].color = sourceC
if (!this.isLine(source.X, source.Y) && !this.isLine(target.X, target.Y)) {
maps[source.X][source.Y].color = sourceC
maps[target.X][target.Y].color = targetC
throw new NoSpoilageException("这次移动没有可消除的格子");
removeScaleResultList = new ArrayList&RemoveScaleResult&();
this.fadeCircle();
throw new NearCellException("目标不在起点旁边");
throw new NullPointerException("起点或者目标为空");
return removeScaleResultL
* 起点跟目标点是否相邻
* @param source
* @param target
private boolean near(Cell source, Cell target) {
if (this.isInMap(source) && this.isInMap(target) && source.nearCell(target)) {
* 判断该点是否超界
* @param cell
private boolean isInMap(Cell cell) {
if (cell.X & -1 && cell.X & this.xSize && cell.Y & -1 && cell.Y & this.ySize) {
* 补图 随机添加格子
private Set&Cell& addCell(RemoveScaleResult result) {
Set&Cell& addCellSet = this.getNonePoint();
if (!addCellSet.isEmpty()) {
this.addCell(addCellSet, result);
return addCellS
* @param addCellSet
private void addCell(Set&Cell& addCellSet, RemoveScaleResult result) {
List&Cell& list = new ArrayList&Cell&();
this.initLiveColor();
for (Cell cell : addCellSet) {
while (true) {
if (!this.liveColorList.isEmpty()) {
int tem = random.nextInt(liveColorList.size());
String liveColor = liveColorList.get(tem);
cell.setColor(Color.valueOf(liveColor));
if (!this.isLineOnAddCell(cell, addCellSet)) {
maps[cell.X][cell.Y] =
list.add(cell);
liveColorList.remove(liveColor);
this.addCell(addCellSet, result);
if (this.isDieMap()) {
this.addCell(addCellSet, result);
if (!list.isEmpty()) {
result.setNewCellList(list);
* 判断在补图要添加的给子中是否有3个连线
* @param x
* @param y
* @param set
private boolean isLineOnAddCell(Cell cell, Set&Cell& set) {
int x=cell.X;
int y=cell.Y;
boolean lx1 = x - 1 & -1;
boolean lx2 = x - 2 & -1;
boolean bx1 = x + 1 & this.xS
boolean bx2 = x + 2 & this.xS
boolean ly1 = y - 1 & -1;
boolean ly2 = y - 2 & -1;
boolean by1 = y + 1 & this.yS
boolean by2 = y + 2 & this.yS
if (ly1 && by1) {
if (isCellColorEqualInAddCell(maps[x][y - 1], cell, maps[x][y + 1], set)) {
if (lx1 && bx1) {
if (isCellColorEqualInAddCell(maps[x - 1][y], cell, maps[x + 1][y], set)) {
if (ly2) {
if (isCellColorEqualInAddCell(cell, maps[x][y - 1], maps[x][y - 2], set)) {
if (by2) {
if (isCellColorEqualInAddCell(cell, maps[x][y + 1], maps[x][y + 2], set)) {
if (lx2) {
if (isCellColorEqualInAddCell(cell, maps[x - 1][y], maps[x - 2][y], set)) {
if (bx2) {
if (isCellColorEqualInAddCell(cell, maps[x + 1][y], maps[x + 2][y], set)) {
private void fadeCircle() {
removeCellSet = new HashSet&String&();
RemoveScaleResult result = new RemoveScaleResult();
List&List&Cell&& removeCellList = new ArrayList&List&Cell&&();
// 判断选出要消除的格子
this.createRemoveCell();
// 给要消除的给子分块
this.blockRemoveCell(removeCellList);
// 消除格子,并且降落
this.removeCellAndDown();
if (!removeCellList.isEmpty()) {
result.setRemoveCellList(removeCellList);
// 添加格子
if (!removeCellSet.isEmpty()) {
this.addCell(result);
removeScaleResultList.add(result);
// 添加格子后再消除格子
this.fadeCircle();
* 生成要消掉的节点 同颜色同列或者同行超过3个的都要消掉
private void createRemoveCell() {
for (int i = 0; i & this.xS i++) {
for (int j = 0; j & this.yS j++) {
Cell source = maps[i][j];
String cellKey = this.getKey(i, j);
if (source != null && !removeCellSet.contains(cellKey)) {
source.setX(i);
source.setY(j);
Set&String& rowSet = new HashSet&String&();
Set&String& colSet = new HashSet&String&();
this.isCellColorEqualLeft(i, j, source.color, rowSet);
this.isCellColorEqualRight(i, j, source.color, rowSet);
this.isCellColorEqualUp(i, j, source.color, colSet);
this.isCellColorEqualDown(i, j, source.color, colSet);
if (rowSet.size() & 2) {
for (String key : rowSet) {
removeCellSet.add(key);
if (colSet.size() & 2) {
for (String key : colSet) {
removeCellSet.add(key);
* 给要消除的给子分区域
private void blockRemoveCell(List&List&Cell&& removeCellList) {
// 复制一份要消掉的格子的集合
Set&String& cSet = new HashSet&String&(removeCellSet);
for (String key : removeCellSet) {
// 不在cSet里面的格子说明被归某一区域了,不需要在分区域了
if (!cSet.isEmpty() && cSet.contains(key)) {
String[] xy = key.split(BasePlay.LINK);
int x = Integer.parseInt(xy[0]);
int y = Integer.parseInt(xy[1]);
Set&String& set = new HashSet&String&();
// 为该格子相邻的格子迭代扩张,并从cSet中移除掉
this.nearAdd(x, y, maps[x][y].color, set, cSet);
if (!set.isEmpty()) {
List&Cell& list = new ArrayList&Cell&();
for (String key2 : set) {
String[] xy2 = key2.split(BasePlay.LINK);
int x2 = Integer.parseInt(xy2[0]);
int y2 = Integer.parseInt(xy2[1]);
maps[x2][y2].X = x2;
maps[x2][y2].Y = y2;
list.add(maps[x2][y2]);
// 对同属于同一区域的要消除的格子排序
Collections.sort(list, new Comparator&Cell&() {
public int compare(Cell o1, Cell o2) {
if (o1.Y == o2.Y) {
} else if (o1.Y & o2.Y) {
return -1;
removeCellList.add(list);
* 消除要消除的格子跟并且地图格子下降
private void removeCellAndDown() {
Set&Integer& set = new HashSet&Integer&();
for (String key : removeCellSet) {
String[] xy = key.split(BasePlay.LINK);
int x = Integer.parseInt(xy[0]);
int y = Integer.parseInt(xy[1]);
maps[x][y] =
if (!set.contains(x)) {
set.add(x);
for (Integer x : set) {
List&Cell& list = new ArrayList&Cell&();
for (int j = this.ySize - 1; j & -1; j--) {
Cell cell = maps[x][j];
if (cell != null) {
cell.setX(x);
cell.setY(j);
list.add(cell.clone());
maps[x][j] =
int j = this.ySize - 1;
for (Cell cell : list) {
cell.setX(x);
maps[x][j] =
* 获取空的节点
private Set&Cell& getNonePoint() {
Set&Cell& set = new HashSet&Cell&();
for (int i = 0; i & this.xS i++) {
for (int j = 0; j & this.yS j++) {
if (maps[i][j] == null) {
Cell cell = new Cell();
cell.setX(i);
cell.setY(j);
set.add(cell);
* 是否为死图
private boolean isDieMap() {
for (int i = 0; i & this.xS i++) {
for (int j = 0; j & this.yS j++) {
maps[i][j].X =
maps[i][j].Y =
if (isDie(i, j) == false) {
* 判断该格子是否为死格子
* @param x
格子的x坐标
* @param y
格子的y坐标
private boolean isDie(int x, int y) {
boolean lx1 = x - 1 & -1;
boolean lx2 = x - 2 & -1;
boolean lx3 = x - 3 & -1;
boolean bx1 = x + 1 & this.xS
boolean bx2 = x + 2 & this.xS
boolean bx3 = x + 3 & this.xS
boolean ly1 = y - 1 & -1;
boolean ly2 = y - 2 & -1;
boolean ly3 = y - 3 & -1;
boolean by1 = y + 1 & this.yS
boolean by2 = y + 2 & this.yS
boolean by3 = y + 3 & this.yS
Color color = maps[x][y].
if (bx1) {
if (maps[x + 1][y].color == color) {
if (bx3) {
if (maps[x + 3][y].color == color) {
if (bx2 && by1) {
if (maps[x + 2][y + 1].color == color) {
if (bx2 && ly1) {
if (maps[x + 2][y - 1].color == color) {
if (lx2) {
if (maps[x - 2][y].color == color) {
if (lx1 && ly1) {
if (maps[x - 1][y - 1].color == color) {
if (lx1 && by1) {
if (maps[x - 1][y + 1].color == color) {
if (ly1 && by1) {
if (maps[x + 1][y - 1].color == color && maps[x + 1][y + 1].color == color) {
if (lx1) {
if (maps[x - 1][y].color == color) {
if (lx3) {
if (maps[x - 3][y].color == color) {
if (lx2 && by1) {
if (maps[x - 2][y + 1].color == color) {
if (lx2 && ly1) {
if (maps[x - 2][y - 1].color == color) {
if (bx2) {
if (maps[x + 2][y].color == color) {
if (bx1 && ly1) {
if (maps[x + 1][y - 1].color == color) {
if (bx1 && by1) {
if (maps[x + 1][y + 1].color == color) {
if (ly1 && by1) {
if (maps[x - 1][y - 1].color == color && maps[x - 1][y + 1].color == color) {
if (by1) {
if (maps[x][y + 1].color == color) {
if (by3) {
if (maps[x][y + 3].color == color) {
if (lx1 && by2) {
if (maps[x - 1][y + 2].color == color) {
if (bx1 && by2) {
if (maps[x + 1][y + 2].color == color) {
if (ly2) {
if (maps[x][y - 2].color == color) {
if (bx1 && ly1) {
if (maps[x + 1][y - 1].color == color) {
if (lx1 && ly1) {
if (maps[x - 1][y - 1].color == color) {
if (lx1 && bx1) {
if (maps[x - 1][y + 1].color == color && maps[x + 1][y + 1].color == color) {
if (ly1) {
if (maps[x][y - 1].color == color) {
if (ly3) {
if (maps[x][y - 3].color == color) {
if (lx1 && ly2) {
if (maps[x - 1][y - 2].color == color) {
if (bx1 && ly2) {
if (maps[x + 1][y - 2].color == color) {
if (by2) {
if (maps[x][y + 2].color == color) {
if (bx1 && by1) {
if (maps[x + 1][y + 1].color == color) {
if (lx1 && by1) {
if (maps[x - 1][y + 1].color == color) {
if (lx1 && bx1) {
if (maps[x - 1][y - 1].color == color && maps[x + 1][y - 1].color == color) {
public Cell[][] getMaps() {
public void setMaps(Cell[][] maps) {
this.maps =
public int getxSize() {
public void setxSize(int xSize) {
this.xSize = xS
public int getySize() {
public void setySize(int ySize) {
this.ySize = yS
package com.eyugame.tade.module.glops.
import com.eyugame.tade.module.glops.constant.C
* @author k60
public class Cell {
public int X;
public int Y;
public Cell() {
public Cell(int x, int y) {
public int getX() {
public void setX(int x) {
public int getY() {
public void setY(int y) {
public Color getColor() {
public void setColor(Color color) {
this.color =
public boolean nearCell(Cell cell) {
if (cell != null) {
if (this.X == cell.X && this.Y == (cell.Y + 1)) {
} else if (this.X == cell.X && this.Y == (cell.Y - 1)) {
} else if (this.X == (cell.X + 1) && this.Y == cell.Y) {
} else if (this.X == (cell.X - 1) && this.Y == cell.Y) {
public String toString() {
return this.X+"_"+this.Y+":"+this.
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + X;
result = prime * result + Y;
public boolean equals(Object obj) {
if (this == obj)
if (obj == null)
if (getClass() != obj.getClass())
Cell other = (Cell)
if (X != other.X)
if (Y != other.Y)
public Cell clone(){
Cell cell=new Cell();
cell.setX(this.X);
cell.setY(this.Y);
cell.setColor(this.color);
package com.eyugame.tade.module.glops.
import java.util.L
* 消除刻度结果
public class RemoveScaleResult {
* 消除的单元格
private List&List&Cell&& removeCellL
* 新产生的单元格颜色列表
* 产生规则:
* X轴,由左至右补
* Y轴,由下至上补
private List&Cell& newCellL
public List&List&Cell&& getRemoveCellList() {
return removeCellL
public void setRemoveCellList(List&List&Cell&& removeCellList) {
this.removeCellList = removeCellL
public List&Cell& getNewCellList() {
return newCellL
public void setNewCellList(List&Cell& newCellList) {
this.newCellList = newCellL
package com.eyugame.tade.module.glops.
* 当起点向目标移动,目标跟起点不是相邻时异常
public class NearCellException extends RuntimeException {
private static final long serialVersionUID = -0566849L;
public NearCellException(String message){
super(message);
package com.eyugame.tade.module.glops.
* 当起点向目标移动,但是不能3消异常
public class NoSpoilageException extends RuntimeException {
private static final long serialVersionUID = 4414593L;
public NoSpoilageException(String message) {
super(message);
没有更多推荐了,
加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!}

我要回帖

更多关于 将军至上游戏下载 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信