Giter VIP home page Giter VIP logo

textrpg's Introduction

TextRPGTitleScreen

C++ Text RPG

This is the repository for my youtube series that I am working on Create a C++ Text RPG! Currently this is only compatible with windows. It uses direct Windows API calls for the Console, Events, Inputs, etc. I may try to make it cross platform; however, I have a lot of other projects that need work as well, so that is on the back burner currently.

This is a work in progress and there are still many different features that we need. ** The current layout works on my machine and my crash on a smaller resolution. There are some magic numbers that are not checking if we are writing beyond the buffer boundaries. **

Build

  • Clone the repository git clone https://github.com/dwjclark11/TextRPG.git.
  • Go into the repo directory and run cmake -S . -B build.
  • Go into the build directory and run cmake --build . --config Debug or config Release.
    • If on MSVC, you can build from the sln that would have been generated.
    • MSVC also creates new Debug/Release folders when building. The assets folder gets copied to the bin folder.
    • Move the assets folder into the Debug/Release folders.

Features

Here are some of the features that have already been implemented.

  • StateMachine
    • The state machine allows the user to switch between different game states such as GameState, MenuState, TitleState, etc.
  • Typewritter
    • The typewritter is a simple class that will scroll the text based on certain parameters. The typewriter should be used in conjunction with the TextState that has not yet been implemented.
  • Item/Equipment Loaders
    • The Item/Equipment loaders are factories that will create the items for use based on the parameters that are passed in. We are also able to load these items from an XML file.
  • XML Parser
    • We have a simple XML parser that uses TinyXML2. The parser can be used to read XML files to help create the items/equipment in the game.

Typewriter Example

TheTypewriter.mp4

Desired Features

Some of the desired or planned features for the future are:

  • Battle system
    • A simple system in where we can battle various enemies. This will also have a battle state
  • Shops
    • This is something I already have in the works. We will have different shops where the player can buy items/weapons/armor etc.

Comments, feedback, and ideas are highly appreciated. Please check out the Youtube channel and let me know what you think. I am trying to make this a learning resource, for me as well. I love learning and becoming better everyday

textrpg's People

Contributors

dwjclark11 avatar

Stargazers

Ronan avatar  avatar Sweery avatar  avatar MyriadColors avatar Ogün Güngör avatar  avatar Patrick O'Dacre avatar

Watchers

Kostas Georgiou avatar  avatar

textrpg's Issues

Add CMake support

Trying to change builds to use CMake rather that relying on VS slns.

Add the Concept Pages to Selector Class

Description:

  • We want to add the ability to display a specific amount of items with the selector per a certain amount of pages.
  • This will need to calculate the max number of pages based on the total number of items.

  • There are a few new functions that need to be added:
    • IncrementPage() -- Increments the page and adjusts the currentY value.
    • DecrementPage() -- Decrements the page and adjusts the currentY value.

  • There are a few functions that will need to be adjusted when the concept of pages are added:
    • MoveUp() -- This will need to adjust based if the current Y is greater than the max display rows * currentPage, Increment the page.
    • MoveDown() -- This will need to adjust based if the current Y is less than the max display rows * currentPage, Decrement the page.
    • Draw() -- The draw function will need to be adjusted to only draw the items for the current page.
    • SetData() -- The max pages needs to be clamped in some way. This should also be done in the CTOR.

  • Some more variables should be added to the SelectorParams:
    • int maxDisplayRows
  • The Selector class should also keep track of the currentPage and max pages:
    • int m_CurrentPage, m_MaxPages.

  • We may also want to add the ability to scroll the page down rather than change pages.
  • We would need to have flags to set if the selector uses scrolls or flips pages.
  • The scroll would need to shift where the display start it as you scroll down, the display start would increase by 1 if the currentY is greater than the max display rows.

Bug in ItemMenuState.cpp: Item descriptions not displaying correctly

I think the line
const std::wstring& item_desc = item->GetDescription();
should be changed to
const std::wstring& item_desc = data.at(index).get()->GetDescription();
in the RenderItem function in ItemMenuState.cpp (line 132).

To the best of my understanding, item->getDescription() would return the description of every rendered item (for me it was displaying all item descriptions on top of each other), but data.at(index).get()->GetDescription() gives us only the description of the item the user is "hovering over." I know this isn't currently your active project, but nonetheless I hope this helps!

I am a bit confused as to why this is not working on my pc...

I am trying to learn a bit more about making a game in c++ and have been loving the tutorials but I have run into issues and I am not sure how to go about fixing it. I would appreciate some help to get it working. I have gotten to #5-2 in the series and now when I run it I get the wrong output.
image

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.