JSON data structure containing game configuration settings#769
Open
222448082Ashen wants to merge 2 commits into
Open
JSON data structure containing game configuration settings#769222448082Ashen wants to merge 2 commits into
222448082Ashen wants to merge 2 commits into
Conversation
Add a sample game_config.json and multiple usage examples demonstrating reading/writing a game configuration from JSON. Files added: json/game_config.json, examples in C#, C# (OOP), C++, Python, and a short .txt explanation. Each example shows creating a JSON config, saving to file, loading it with json_from_file, extracting gameTitle, windowWidth/Height and backgroundColor, applying those settings to open a window and display values, and cleaning up resources.
Add a new usage example image for the JSON `json_from_file` example at public/usage-examples/json/json_from_file-1-example.png to support documentation and visual reference.
❌ Deploy Preview for splashkit failed.
|
himanshigaba22
suggested changes
May 14, 2026
himanshigaba22
left a comment
There was a problem hiding this comment.
Nice example - loading game settings from JSON is a really useful idea and easy to follow.
Just a few small things to fix before it can be merged:
The C# top-level file is named json_from_file-1-example.cs, but it should use the -top-level.cs naming
The C# OOP file needs a proper namespace wrapper
The .txt file has multiple lines, but it should just be a short one-line title
The json/game_config.json file might not need to be included since the example creates it itself
Also, open_audio() and close_audio() don’t seem needed here since no audio is used
Can you also confirm if usage-example-references.json has been updated?
Once these are fixed, it should be good to go 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Splashkit Function:
json_from_fileOverview of example functionality: This example demonstrates how to create a JSON data structure containing game configuration settings (such as window dimensions, game title, and RGB background color), save the data to a file using
json_to_file, and then read it back usingjson_from_file. The retrieved values are successfully extracted usingjson_read_stringandjson_read_number, and then applied to configure and draw a SplashKit window.Example Output:
(Note: Drag and drop your screenshot
json_from_file-1-example.pnghere when creating the PR on GitHub)Usage Example Checks (READ CAREFULLY)