just_game_engine_formats 0.2.0
just_game_engine_formats: ^0.2.0 copied to clipboard
The Just Game Engine's saved file formats in pure Dart: scenes and timelines with their migrations, animator graphs, tags and physics layers.
example/just_game_engine_formats_example.dart
// Bring a scene saved by an older engine up to date, and say what changed.
import 'dart:convert';
import 'package:just_game_engine_formats/just_game_engine_formats.dart';
void main() {
const saved = '{"version": 5, "name": "cave", "entities": []}';
final scene = jsonDecode(saved) as Map<String, dynamic>;
final result = SceneFormat.migrateWithReport(scene);
print('format v${result.fromVersion} -> v${SceneFormat.current}');
for (final note in result.notes) {
print(' $note');
}
// A new level, as the editor makes one.
print(SceneStarters.encode(SceneStarters.twoD('level_02')));
}