sketch future file structure

This commit is contained in:
Crispy 2024-10-06 00:57:24 +02:00
parent d332bd30f3
commit 66c9b10264
3 changed files with 58 additions and 4 deletions

54
README.md Normal file
View file

@ -0,0 +1,54 @@
# marble machinations
(working title)
logic mostly like https://git.crispypin.cc/CrispyPin/marble
file hierarchy
```
- assets/
- storage/
- levels/
- 00_zeroes.json
- 01_cat.json
- 02_parse.json
- 99_sandbox.json
- solutions/
- 00_zeroes/
- solution_0.json
- solution_1.json
- factorial_194726/
- solution_0.json
- solution_1.json
- blueprints
- blueprint_0.json
- custom_levels/
- factorial_194726.json
```
`00_zeroes.json`
```json
{
"id": "00_zeroes",
"name": "Zeroes",
"description": "learn how to output data",
"init_board": null,
"inputs": [],
"outputs": [0, 0, 0, 0, 0, 0, 0, 0]
}
```
`00_zeroes/solution_0.json`
```json
{
"level_id": "00_zeroes", //redundant, useful if sharing solution files?
"name": "unnamed 1",
"board": "oo\nP*\n|-"
}
```
`blueprints/blueprint_0.json`
```json
{
"name": "fast printer",
"board": "oo\nP*\n|-"
}
```

View file

@ -12,7 +12,7 @@ use crate::{
};
#[derive(Debug)]
pub struct Game {
pub struct Editor {
source_board: Board,
machine: Machine,
sim_state: SimState,
@ -51,7 +51,7 @@ enum SimState {
Stepping,
}
impl Game {
impl Editor {
pub fn new_sandbox() -> Self {
Self {
source_board: Board::new_empty(16, 16),

View file

@ -1,6 +1,6 @@
use std::fs::read_to_string;
use editor::Game;
use editor::Editor;
use marble_engine::board::Board;
use raylib::prelude::*;
@ -24,7 +24,7 @@ fn main() {
textures.load_dir("assets", &mut rl, &thread);
textures.load_dir("assets/tiles", &mut rl, &thread);
let mut game = Game::new_sandbox();
let mut game = Editor::new_sandbox();
let board = Board::parse(&read_to_string("boards/adder.mbl").unwrap());
game.load_board(board);