Code Monkey home page Code Monkey logo

dungeon's Introduction

Dungeon

Implementation detailed

  • void startGame(): Deal with all game initial setting, including create player, create map etc.
    • void createPlayer(): Create a new player, ask player what name he/she want.
    • void setMember(): Initialize set member status including name, lv, tag, etc.
    • void createMap(): Create a map, which include several different rooms.
  • void runDungeon(): Deal with the whole game process
    • bool checkGameLogic(): Check whether to end the game or not.
    • bool isAlive(): If he/she dead, return true
  • void printTitle(), void printMap(), void printMoveMap(): Print Game screen.
  • void handleMovement(): Dealing with the player's moving action and updating the current room
  • void handleEvent(): Deal with player's interaction with objects in that room
    • Home: void homeEvent(): Including
      • Recover health
      • Change career: including Knight, Archer, Wizard, Worker.
      • Update Factory: including Armor, Arrow, Axe Factories and Magic Tower
      • Build Ladder: use for enter boss room(the goal) quicker.
    • Copper, Wood: Get item which can upgrade Factories
    • Money: Get money to buy items
    • Monster, Boss: char fight(Player*, Monster*): Allows the player to engage in combat with monsters.
    • NPC: Told player what to do to reach his/her goal.
    • Shop: Place to buy your item.
    • Ladder: Only place to place Ladder.

UML Design

png/image1.png

Results

png/image2.jpeg

⇧初始畫面

png/image3.jpeg

⇧輸入名稱

png/image4.jpeg

⇧Enter Home?

png/image5.jpeg

⇧移動

png/image6.jpeg

⇧第一次走到Empty space會告訴你這格Empty

png/image7.jpeg

⇧Villager遇到NPC

png/image8.jpeg

⇧進Home,選擇到Factory或Incinerator或繼續冒險

png/image9.jpeg

⇧進Factory選擇,輸入1換角色,輸入2繼續冒險

png/image10.jpeg

⇧換角色結果

png/image11.jpeg

⇧NPC遇到不同角色會有不同對話

png/image12.jpeg

⇧踩到Monster格

png/image13.jpg

⇧Fight並成功逃出

png/image14.jpeg

⇧Get Copper

png/image15.jpeg

⇧Get Wood

png/image16.jpeg

⇧撞到牆(該方向為nullptr)

png/image17.jpeg

⇧NPC對話

png/image18.jpeg

⇧NPC對話

png/image19.jpeg

⇧背包滿了

png/image20.jpeg

⇧選擇升級Factory(此選項須問過NPC才會顯示)

png/image21.jpeg

⇧升級成功

png/image22.jpeg

⇧升級至最高級別

png/image23.jpg

⇧若工廠升級至最高級別將不會顯示所需升級物資

png/image24.jpeg

⇧當Worker = Lv3時,拿到物品(不含錢)加倍

png/image25.jpg

⇧選擇建造Ladder(當Worker = Lv3且Wood>5時顯示此功能)

png/image26.jpeg

⇧Get Ladder

png/image27.jpeg

⇧Wizard = Lv3且問過NPC後可以Set Fire

png/image28.jpeg

⇧NPC對話

png/image29.jpeg

⇧Worker Lv>=3時可以點火(點火會增加攻擊力)

png/image30.jpg

⇧Fight and Win

png/image31.jpeg

⇧Get Money

png/image32.jpeg

⇧Ladder格可以置放Ladder,可以快速進出Boss Room

png/image33.jpeg

⇧每60回合Monster會復活

png/image34.jpeg

⇧逃出Dungeon結束畫面

dungeon's People

Contributors

dytsou avatar

Watchers

 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.