ACM-VIT / ACM-VIT/cli-rpg

Make a JSON file for the achievements and write a function for achievement handling

Open
#133 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Description

All the player achievements should have their title, description and the file path to the ascii art stored in a JSON file. There should also be a function written for the persistent storing of the player's achievements.

### JSON File Format
```
{
"achievements": [
{
"id": 1,
"name": "achievement name",
"description": "How the player unlocks the achievement.",
"path_to_badge": "file/path/to/ascii/art.txt"
},
{
"id": 2,
"name": "achievement name",
"description": "How the player unlocks the achievement.",
"path_to_badge": "file/path/to/ascii/art.txt"
}
]
}
```

## Steps to Implement

1. Make a JSON file to store all the required achievement.
2. Write a function `handle_achievements` which stores the achievements unlocked by the player persistently (the achievements should not disappear if the player quits the game).
3. The function should create a `unlockedAchievements.json` file on the first run and as the player makes progress and unlocks an achievement, the JSON file should be updated.
4. Further details regarding listening to minigame events which trigger the handling of achievements will be updated to the assignee once the minigames are modified to deal with achievements.

**Note:** `achievements.json` and `handle_achievements.rs` should be created in `src/achievments/`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the requested files in src/achievments/: achievements.json and handle_achievements.rs. Read the existing achievement and minigame flow before defining the persistence boundary; done means achievements are listed in the specified format, unlockedAchievements.json is created on first run, and unlocked achievements survive quitting and are updated as progress is made.

Written by the indexing model from the issue text.

Assessment

Tech stack
json, rust
Domain
cli, game-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.