Skip to content
Andrey edited this page Sep 21, 2023 · 8 revisions

Introduce

There is a class Level that contains everything related to the editor.
Such as colors, blocks, background, guidelines and others

Getting a Level instance

From local saves

var local = await LocalLevels.LoadFileAsync();
var level = local.GetLevel("MyLevel", revision: 0).LoadLevel();

revision is the number for levels with the same names.
In the game, it's written as "rev."

From destination server (aka download)

var response = await client.DownloadLevelAsync(id: 49395494);
if (response.GeometryDashStatusCode != 0)
    throw new InvalidOperationException($"server return an error: {response.GeometryDashStatusCode}");

var levelString = response.GetResultOrDefault()?.Level?.LevelString;
if (string.IsNullOrEmpty(levelString))
    throw new InvalidOperationException("malformed level string");

var level = new Level(levelString, compressed: true);

Create an empty level

var level = new Level();
Clone this wiki locally