基于SpringBoot和Vue的贪吃蛇双人对战游戏设计与实现  

Design and implementation of greedy snake duel game based on SpringBoot and Vue

在线阅读下载全文

作  者:张豪 姚佰允 杜瑞庆 ZHANG Hao;YAO Baiyun;DU Ruiqing(School of Information and Electrical Engineering,Hebei University of Engineering,Handan 056038,China)

机构地区:[1]河北工程大学信息与电气工程学院,河北邯郸056038

出  处:《无线互联科技》2025年第3期51-55,共5页Wireless Internet Science and Technology

摘  要:贪吃蛇是一款深受欢迎的经典单机小游戏。然而,随着互联网多人联机游戏的蓬勃发展,贪吃蛇传统的单人作战模式已逐渐不再适应时代的需求。为了改变这一现状,文章提出了一种基于SpringBoot和Vue框架的贪吃蛇双人对战游戏。游戏前端使用Vue框架结合HTML的canvas标签进行游戏界面的构建和图形的绘制。后端采用SpringSecurity框架和JWT令牌技术实现了用户登录与注册,确保用户登录过程及个人信息的安全。游戏匹配基于微服务架构,通过WebSocket协议与客户端进行实时通信,实现了双人匹配功能。为了增添更多变化和乐趣,系统还引入了人机对战模式。在这个模式中,玩家可以选择与机器人对战,系统运用动态编译技术来操控机器人的行为。该游戏的设计打造了一种全新的游戏体验,不仅保留了传统贪吃蛇游戏的经典乐趣,还融入了现代游戏多人对战的元素,显著提升了游戏的互动性和刺激感。Greedy Snake is a popular classic single player mini game.However,with the vigorous development of online multiplayer games on the Internet,the traditional single player combat mode of the greedy snake has gradually not adapted to the needs of the times.In order to change this situation,this article proposes a two player battle game called Snake based on SpringBoot and Vue framework.The game front-end uses Vue framework combined with HTML canvas tags to build the game interface and draw graphics.The backend adopts the SpringSecurity framework and JWT token technology to implement user login and registration,ensuring the security of the user login process and personal information.Game matching is based on microservice architecture,and real-time communication with the client is achieved through WebSocket protocol,realizing the function of two person matching.In order to add more variety and fun,the system has also introduced a human-machine combat mode.In this mode,players can choose to battle against robots,and the system uses dynamic compilation techniques to control the robot’s behavior.The design of this game creates a brand new gaming experience,which not only retains the classic fun of traditional snake games,but also incorporates elements of modern multiplayer battles,significantly enhancing the interactivity and excitement of the game.

关 键 词:SpringBoot Vue 匹配服务 WebSocket 微服务架构 人机对战 

分 类 号:TP311[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象