Crate onshape_level_gen

Source
Expand description

This crate contains essential utilities to generate an OnShape yml level file.

§Example

use onshape_level_gen::util::*;
 
// this difficulty is a FFT result iterating factor.
let init_difficulty_limit = 1.2f32;
let input_ogg = "~/your_target_file.ogg";
let output_yml = "~/level.yml";
 
let (samples, output_params) = get_data_from_ogg(input_ogg).unwrap();
let notes = get_notes_from_samples(samples, init_difficulty_limit).unwrap();
let walls = get_walls_from_notes(&notes);
let yml_content = gen_yml(&output_params, walls);
 
std::fs::write(output_yml, yml_content).unwrap();

Modules§

util
Contains general and utility functions.
wall
Contains implementations for Wall module.

Structs§

LevelDifficulty
Parameters to adjust level difficulty.
Note
The FFT result of a fixed segmenet of samples.
Samples
A collection of raw f32 data with sample rate from sound file.
SoundFileInfo
Information about the original sound file.
Wall
Represents the time and the type of a wall.

Enums§

Difficulty
4 Difficulties used in OnShape level script.
DodgeType
Represent the 5 dodge types in the OnShape game.
LCR
A most common type(left, center, right) in the OnShape game.
WallType
All 4 possible shapes in the OnShape game.