1. 介绍

    THDN的核心机制为Match3的利用,本文对Match3 Gameplay进行记录,并对其进行改良.THDN作为RogueLIke性质的游戏,玩家在随机生成的dungeon里进行探索并获取THDN的线索,随机生成的dungeon(DUNGEONIZE)会之后介绍,在探索的过程中,玩家面对黑暗的环境以及未知的生物,当玩家面对生物时,通过采取对战的方式战胜对手,而Match3机制的利用在对战中得以体现,THDN利用RPG+Match的对战风格去战胜对手,Match3的核心机制在于条件消除(3(*)+1),在规定的时间内收集指定的元素生成战斗能力,而在回合结束后,进行重置开始下一回合的收集.

 

    2.Match3 Core

   Match3在THDN的核心流程如下图

其初始化过程中主要为4步

  

InitTileAndPieces()=>FindAllCollectiable()=>FillBoard()=>InitParticleundCamera()

  首先获取图块和碎片并生成至match3面板中,碎片生成与图块里当进行消除时可以自动生成随机碎片或特殊元素至空图块中,当消除条件允许时,可以对面板全部图块进行消除条件检查,FindCollectiable方法对面板进行检测处理,当元素初始化生成后,需要对面板进行尺寸填充。在第一次填充时,需要保证第一次无消除条件的产生,保证条件的初始确认,在一切初始化完成后,便可对条件进行消除操作

  // find all Collectibles in the Board
List<GamePiece> FindAllCollectibles()
{
List<GamePiece> foundCollectibles = new List<GamePiece>(); for (int i = ; i < height; i++)
{
List<GamePiece> collectibleRow = FindCollectiblesAt(i);
foundCollectibles = foundCollectibles.Union(collectibleRow).ToList();
} return foundCollectibles;
}

消除对象主要是对图块中的碎片进行操作,当玩家在对碎片进行操作时,当对相邻碎片进行移动位置时需要检测是否产生消除操作,消除操作的产生指对3个以上的碎块进行合并,tile[column,row]里的碎片产生消除条件时,即可对碎块进行消除操作。、

   // decrement the breakable value, switch to the appropriate sprite
// and conver the Tile to become normal once the breakableValue reaches 0
IEnumerator BreakTileRoutine()
{
breakableValue = Mathf.Clamp(breakableValue--, , breakableValue); yield return new WaitForSeconds(0.25f); if (breakableSprites[breakableValue] !=null)
{
m_spriteRenderer.sprite = breakableSprites[breakableValue];
} if (breakableValue == )
{
tileType = TileType.Normal;
m_spriteRenderer.color = normalColor; } }

而在进行碎片移动操作时,需要对消除条件进行判断,主要分为以下情况

  1.当碎片可以进行消除条件时,确认消除的情况为tile[i,row]还是tile[column,i]还是tile[i,j],[x,y]会产生3中未知的消除条件

  2.bomb的消除条件为接邻消除效果即可触发,而产生的条件为4个以上的或者others产生的奖励效果。

  3.连锁反应的产生在对第一次消除效果的条件下产生,在对连锁反应的机制产生需要对面板元素进行遍历检测,而对THDN中的基础奖励进行倍数奖励(Sum(damage))

  4.DeadLock 状态的情况为当进行消除操作或者首次填充面板时无可消除条件期望产生时,即可对面板进行重新生成,直至生成可消除期望为止

   IEnumerator ClearAndRefillBoardRoutine(List<GamePiece> gamePieces)
{ // disable player input so we cannot swap pieces while the Board is collapsing/refilling
m_playerInputEnabled = false; isRefilling = true; // create a new List of GamePieces, using our initial list as a starting point
List<GamePiece> matches = gamePieces; // store a score multiplier for chain reactions
m_scoreMultiplier = ;
do
{
// increment our score multiplier by 1 for each subsequent recursive call of ClearAndCollapseRoutine
m_scoreMultiplier++; // run the coroutine to clear the Board and collapse any columns to fill in the spaces REFILLUNDCLEAR
yield return StartCoroutine(ClearAndCollapseRoutine(matches)); // pause one frame
yield return null; // run the coroutine to refill the Board (just refill)
yield return StartCoroutine(RefillRoutine()); // find any subsequent matches and repeat the process...
matches = FindAllMatches(); yield return new WaitForSeconds(0.2f); }
// .. while our list of matches still has GamePieces in it
while (matches.Count != ); // deadlock check
if (m_boardDeadlock.IsDeadlocked(m_allGamePieces, ))
{
yield return new WaitForSeconds(1f);
// ClearBoard(); // shuffle the Board's normal pieces instead of Clearing out the whole Board
yield return StartCoroutine(ShuffleBoardRoutine()); yield return new WaitForSeconds(1f); yield return StartCoroutine(RefillRoutine());
} // re-enable player input
m_playerInputEnabled = true; isRefilling = false; }

    消除效果产生后,关卡条件对消除物品进行收集并产生奖励,在THDN中,对战的主要机制为回合制下的match3操作,玩家在规定时间内产生消除成果Sum(basicMatch3+ExtraMatch3(combine)+ItemsEffect+BasicStats+specialEffect) 生成伤害总值对敌人进行伤害效果的产生(damage*effect?),在回合结束后需要检测双方的速度值来决定先手次序,如果包含network api需要对伤害方法进行[clientrpc]标记.在一方的血量为0时结束战斗返回地下城或者城镇.

   

Match3 Module For Game(THDN)的更多相关文章

  1. Android Studio 编译单个module

    前期自己要把gradle环境变量配置好 在Terminal中gradle命令行编译apk 输入gradle assembleRelease 会编译全部module编译单个modulecd ./xiru ...

  2. ABP源码分析三:ABP Module

    Abp是一种基于模块化设计的思想构建的.开发人员可以将自定义的功能以模块(module)的形式集成到ABP中.具体的功能都可以设计成一个单独的Module.Abp底层框架提供便捷的方法集成每个Modu ...

  3. nodejs模块中exports和module.exports的区别

    通过Node.js的官方API可以看到Node.js本身提供了很多核心模块 http://nodejs.org/api/ ,这些核心模块被编译成二进制文件,可以require('模块名')去获取:核心 ...

  4. ES6之module

    该博客原文地址:http://www.cnblogs.com/giggle/p/5572118.html 一.module概述 JavaScript一直没有模块体系,但是伴随着ES6的到来,modul ...

  5. [python] CSV read and write using module xlrd and xlwt

    1. get data from csv, skip header of the file. with open('test_data.csv','rb,) as csvfile: readCSV = ...

  6. Yii2.0.7 限制user module登录遇到的问题

    在Yii2.0.6的时候我是在以下文件通过以下方法实现的. frontend/modules/user/Module.php namespace frontend\modules\user; clas ...

  7. Android Studio导入github下载的project和module

    前言:我们以前eclispe时代, 经常都是跑到github浏览第三方开源资源,然后下载下来,运行一下sample之类的,学习没有接触的第三方安卓库,但是到了Android Studio,在githu ...

  8. Android Studio导入Project、Module的正确方法

    Gradle Project项目.Module模块导入 最近看到网上很多人在抱怨,Android Studio很难导入github上下载下来的一些项目,主要包括: 1.导入就在下载Gradle2.根本 ...

  9. ImportError: No module named 'requests'

    补充说明: 当前环境是在windows环境下 python版本是:python 3.4. 刚开始学习python,一边看书一边论坛里阅读感兴趣的代码, http://www.oschina.net/c ...

随机推荐

  1. PHP中 spl_autoload_register() 函数用法

    这篇文章主要介绍了PHP中spl_autoload_register()函数用法,结合实例形式分析了__autoload函数及spl_autoload_register函数的相关使用技巧,需要的朋友可 ...

  2. java的System.currentTimeMillis()如何转换成C#的DateTime.Now.Ticks?

    考虑到我们是东八时区的话,应做如下转换: long milli = System.currentTimeMillis() + 8*3600*1000; long ticks = (milli*1000 ...

  3. springboot2.04与activiti 6.0集成

    本文就不对activiti做解释,下面直接看项目集成 以下顺序方面根据我的理解来,可以先从第二章看,再看第一张与第三章 增加activiti表的API,备注用. 目录 一.springboot2.X集 ...

  4. P1112 区间连续段

    题目描述 给你一个长度为n的数组 \(a_1, a_2, \dots a_n\) . 一开始这n个元素都为0. 然后有m次操作,每次操作有两种操作类型: update x y a:将区间 \([x,y ...

  5. PHP会员找回密码功能的简单实现

    文章来自:博客 http://www.jb51.net/article/91944.htm 设置思路 1.用户注册时需要提供一个E-MAIL邮箱,目的就是用该邮箱找回密码. 2.当用户忘记密码或用户名 ...

  6. [转]在ASP.NET WebAPI 中使用缓存【Redis】

    初步看了下CacheCow与OutputCache,感觉还是CacheOutput比较符合自己的要求,使用也很简单 PM>Install-Package Strathweb.CacheOutpu ...

  7. python基础七之copy

    浅拷贝 没有嵌套,则copy后完全不同,有嵌套,则copy后本体不同,嵌套相同. l1 = [1, 2, [4, 5, 6], 3] l2 = l1.copy() print(l1 is l2) # ...

  8. 基于AutoIt3的Ping、网址转IP地址,以及hosts文件写入

    #include <Constants.au3> #include <GUIConstantsEx.au3> GUICreate("通讯测试-eip.hxgroup. ...

  9. react 父组件与子组件双向绑定

    在项目中我们可能会遇到类似这样的场景,也就是父子组件的双向数据绑定 首先,先把在head中引入react.js.react-dom.js和可选择的babel.js(这里需要注意引用的顺序,react. ...

  10. 【t081】序列长度

    Time Limit: 1 second Memory Limit: 128 MB [问题描述] 有一个整数序列,我们不知道她的长度是多少(即序列中整数的个数),但我们知道在某些区间中至少有多少个整数 ...