Skip to content

MvPorcalla/Reincarnation_Diary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

66 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Reincarnation Diary

GitHub issues GitHub forks GitHub stars GitHub license

๐Ÿ“– Description

Reincarnation Diary is a text-based RPG featuring a story-branching system and turn-based combat.
Players make meaningful choices that shape the storyline while facing enemies in strategic battles.
The game is managed by GameManager.js, which integrates all core modules such as Player, Enemy, Combat, UI, Story, and more.

Game Preview


๐Ÿ“ฆ How to Convert to Electron (Desktop App)


๐Ÿ“š Table of Contents


๐Ÿ› ๏ธ Installation

  1. Download or clone this project to your local machine.
  2. Ensure all files remain in the same project folder.
  3. Open index.html in your web browser.

โ–ถ๏ธ Usage

  • The game will automatically start when you open index.html.
  • Click the choice buttons to progress through the story.
  • During combat, click the Attack button to fight the enemy.
  • The game will handle scene transitions, battles, and player stats.

๐Ÿ’ป Technologies

  • HTML
  • CSS
  • JavaScript (ES6 Modules)

๐ŸŽฎ Game Features

  • Story-branching system with multiple choices
  • Turn-based combat with enemy dodge and critical hit mechanics
  • Modular and expandable game structure

๐Ÿ”ฎ Planned Future Improvements

  • LocalStorage-based account system
  • Automatic save system (prevents progress loss on refresh)
  • Import/Export player account data
  • expanded Job Class system
  • Character ranking and lifetime progression system
  • Sound effects and background music
  • Visual story summary and achievement showcase at game end
  • Packaging the game as a standalone desktop app using Electron

๐Ÿ‘ค Author

MvPorcalla


# ๐Ÿ“‚ Project Structure

Reincarnation_Diary
โ”‚
โ”œโ”€โ”€ assets
โ”‚   โ”œโ”€โ”€ data
โ”‚   โ”‚   โ””โ”€โ”€ enemyData.json         # Enemy data in JSON format
โ”‚   โ””โ”€โ”€ images                     # Game image assets
โ”‚       โ”œโ”€โ”€ background             # Background image
โ”‚       โ””โ”€โ”€ enemies                # Enemy character images
โ”‚
โ”œโ”€โ”€ css
โ”‚   โ””โ”€โ”€ uiStyle.css                # Game UI styles
โ”‚
โ”œโ”€โ”€ js                             # All JavaScript files
โ”‚   โ”œโ”€โ”€ gameManager.js             # Main game controller
โ”‚   โ”œโ”€โ”€ player.js                  # Handles player data and actions
โ”‚   โ”œโ”€โ”€ combat.js                  # Manages combat logic
โ”‚   โ”œโ”€โ”€ ui.js                      # Handles UI rendering and updates
โ”‚   โ”œโ”€โ”€ story.js                   # Story content and scene management
โ”‚   โ”œโ”€โ”€ debugger.js                # Debugging tools and story validator
โ”‚   โ”œโ”€โ”€ enemy.js                   # Enemy class and enemy data handling
โ”‚   โ””โ”€โ”€ combatUtils.js             # Combat utility functions
โ”‚
โ”œโ”€โ”€ endScreen.html                 # End screen page
โ”œโ”€โ”€ index.html                     # Game starting page
โ”œโ”€โ”€ mainGame.html                  # Main game interface
โ””โ”€โ”€ README.md                      # Project documentation

๐Ÿ“„ File Descriptions

gameManager.js

  • Acts as the main game controller.
  • Starts the game, manages game state and scene transitions.
  • Handles combat logic and scene rendering.

story.js

  • Contains the gameโ€™s story content.
  • Manages scenes, transitions, and story structure.

ui.js

  • Updates the user interface (UI).
  • Displays the story, player stats, enemy visuals, and interactive choices.

combat.js

  • Manages turn-based combat between the player and enemies.
  • Handles attack sequences and combat flow.

combatUtils.js

  • Provides combat-related utility functions.
  • Calculates:
    • Attack damage
    • Critical hit chance
    • Bonus damage

enemy.js

  • Defines the Enemy class and enemy combat interactions.
  • Manages:
    • Enemy attacks
    • Damage-taking and dodge chance
    • Enemy data loading from JSON
    • Random enemy selection based on tier

player.js

  • Manages player creation and player stats.
  • Controls player health and reset functions.

debugger.js

  • Provides debugging tools.
  • Validates story structure during development.
  • Controls whether debug logs are displayed.

๐Ÿš€ Game Startup Process

  1. When the game loads, startGame() is automatically called.
  2. The goToScene('start') function is triggered to load the starting scene.
  3. The game displays:
    • Story text
    • Choices or combat (if an enemy is present)
  4. The player clicks buttons to make choices or to fight enemies.
  5. The game progresses based on player interactions.

โœ… Summary

  • The project is modular: each file has a specific role (player, combat, UI, story, debug).
  • The gameManager.js is the central hub of the system.
  • Easy to maintain and expand by adding new features like scenes, enemies, and player mechanics.

๐Ÿค Contributing Guidelines

Thank you for your interest in contributing! You can help by:

  • Suggesting new features
  • Fixing bugs
  • Improving or expanding the documentation
  • Adding new story branches or combat mechanics

๐Ÿ“ข How to Contribute

  1. Fork this repository.
  2. Create a new branch: git checkout -b feature/YourFeature
  3. Commit your changes: git commit -m 'Add YourFeature'
  4. Push to your branch: git push origin feature/YourFeature
  5. Submit a pull request.

Please open an issue or pull request if you would like to contribute.
All contributions are welcome and appreciated!


๐Ÿ“Œ Further Support

If you'd like to enhance or improve this project, here are some great areas to contribute:

  • โœจ Adding inline comments and function headers to improve code readability
  • ๐Ÿ“ Creating detailed per-file documentation in Markdown
  • ๐Ÿ—‚๏ธ Refining the project folder structure for better scalability and maintainability

๐Ÿ‘‰ Feel free to reach out, submit feedback, or contribute to make this project even better! ๐Ÿ˜Š


๐Ÿ“ž Contact

For any issues or feedback, you can open a GitHub Issue.


๐Ÿš€ Contributions

Contributions, suggestions, and improvements are always welcome!
Feel free to fork this project and submit a pull request.
All contributions are appreciated and will help this project grow! ๐Ÿ™Œ


๐Ÿ“„ License

This project is licensed under the MIT License.
You are free to use, modify, and distribute this project, provided that you give proper credit.


๐Ÿ“Œ How to Credit

If you use, modify, or reference this project, please include the following attribution:

Copyright (c) 2024 MvPorcalla

โœ”๏ธ Proper credit helps support the developer and acknowledges the original creator.

โš ๏ธ Note: Even modified or rebranded versions must retain proper attribution, as required by the MIT License.


See the full LICENSE file for more details.

About

A story-driven RPG where your choices, battles, and life path shape your destiny. Build your stats, choose your job class, and experience branching storylines with unique endings.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors