Sonolus Wiki

13. Test Level

In this chapter, we will set up a simple level to better play test with.

Level Cover and Bgm

Sonolus.js internally uses sonolus-express to power its development server, and devServer hook in config allows you to modify its behavior.

We will use this hook to add level cover and BGM, as well as other meta information. The code won't be shown here because it is not important to engine scripting but merely for testing purpose.

Chart

A test chart is also prepared along with it, and we are going to generate entities based on the chart:

export const data: LevelData = {
    // ...
    entities: [
        // ...

        ...chart.notes.map((beat) => ({
            archetype: 'Note',
            data: [
                {
                    name: archetypes.Note.data.names.beat,
                    value: beat,
                },
            ],
        })),
    ],
}
export const data = {
    // ...
    entities: [
        // ...

        ...chart.notes.map((beat) => ({
            archetype: 'Note',
            data: [
                {
                    name: archetypes.Note.data.names.beat,
                    value: beat,
                },
            ],
        })),
    ],
}