GithubHelp home page GithubHelp logo

textgameengine's Introduction

项目简介

这是一个基于 antlr4 开发的文字游戏。游戏的内容是闯迷宫,玩家的目标是找到出口房间。

项目运行环境

  • JDK Azul Zulu Version 17.0.7
  • antlr4-runtime-4.12.0

游戏玩法

  1. 初始阶段玩家会出现在地图中的入口房间.房间内存在物品或者有几率出现怪物.
  2. 游戏主要有战斗模式和探索模式。玩家进入房间后会根据概率随机进入战斗模式(当前房间有怪物的情况下)或者探索模式。
  3. 战斗模式 中玩家可以装备和切换武器同怪物进行战斗,直到一方死亡。
  4. 探索模式 中玩家可以探索和拾取房间内的物品,使用物品增加生命值或者信心。

项目特色

  1. 基于面向对象的**,自底向上通过抽象语法树,构建游戏世界。
  2. 基于 java switch case 配合 antlr 的词法分析器,规则处理用户指令输入。
  3. 地图自定义生成。开发者可以基于已经编写好的 antlr 的语法规则文件 GameMap.g4 文件生成地图。并在游戏入口处指定地图文件的位置,程序会自动生成对应的地图。
  4. 自定义语法错误和语义错误监听器。构建地图时,若地图文件存在不符合语法规则或者语义问题,会在控制台中给出相应的提示,易于定位问题。

核心文件和解析类

参考资料

textgameengine's People

Watchers

markus avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.