基于Unity3D的2D塔防游戏设计与实现
2021-10-16张宝宝



摘 要:Unity3D是当前国内外广泛使用的游戏开发软件,其所开发出的塔防游戏自游戏发展以来就十分盛行。该项目基于Unity3D开发了一款塔防游戏。其主要功能包括防御塔放置、敌人孵化、关卡管理、音效控制、UI界面以及最后的积分管理。该项目摒弃了传统关卡设计,通过关卡内的难度上升而达到提升游戏难度的目的。通过该项目,可以让玩家体验到难度层层递增、挑战性极强的塔防游戏。
关键词:Unity3D;C#;塔防
中图分类号:TP311 文献标识码:A 文章编号:2096-4706(2021)07-0071-04
Design and Implementation of 2D Tower Defense Game Based on Unity3D
ZHANG Baobao
(School of Computer and Software,Jincheng College of Sichuan University,Chengdu 611731,China)
Abstract:Unity3D is game development software that is widely used at home and abroad at present. Tower defense games developed by it are extremely popular since the development of games. This project develops a tower defense game based on Unity3D. Its main functions include defense tower placement,enemy hatching,gate management,sound effect control,UI interface,and the final points management. Instead of traditional gate design,this project aims to increase the difficulty of the game by increasing the difficulty within the gate. Through this project,players can experience the tower defense game with increasing difficulty and strong challenge.
Keywords:Unity3D;C#;tower defense
收稿日期:2021-03-10
0 引 言
随着电子产品的普及和发展,游戏技术也随之得到了很大的提升。在游戏引擎和玩法方面,目前的游戏行业水平都达到了空前的高度。其中塔防类游戏得到了很多玩家的喜爱,不管是自身还是敌人都可以随着关卡的进行得到能力的提升。
1 开发工具及技术
Unity3D是由Unity公司设计的一款游戏引擎,在其中可以进行2D及3D游戏的设计与开发。该平台同时支持主机、手机、PC等设备的游戏开发。目前国内外有相当多的游戏制作组使用Unity开发了很多优秀游戏。本项目游戏脚本开发采用C#语言,使用VS2019版本,设计了一款基于Unity3D的塔防游戏,实现了怪物AI、防御塔攻击算法的设计以及众多特效等。
2 游戏策划
本项目的塔防游戏拥有以下几个规则:
(1)玩家可以使用金币在建筑方块上建造防御塔,但是每建造一次,金币的消耗便会随之增加。
(2)怪物会从不同的方向生成,并且会通过不同的路径走向玩家的核心。怪物每生成一次,其攻击力、防御力及每次的个数都会有所提升。……
