Crates.io | draw-lr |
lib.rs | draw-lr |
version | 0.1.0 |
source | src |
created_at | 2022-05-23 07:29:24.437634 |
updated_at | 2022-05-23 07:29:24.437634 |
description | An SDK to interact with pieces of the original Line Rider game |
homepage | |
repository | https://github.com/kumar-ish/draw-lr/ |
max_upload_size | |
id | 591629 |
size | 14,827 |
This is a library to be able to build on Line Rider; note that this is to interact with the original game, and not an extension.
You can use the crate by instantiating a game (of type draw_lr::Game
) and adding pieces on top of it (lines, layers, riders) using the crate. You can then write the game to a track JSON file and play with that on the game by uploading it.
fn main() {
use draw_lr::*;
use draw_lr::extension::*;
let mut game = Game::new();
let polygon = thick_polygon_lines(10, 40, None, None, 1, 1);
game.add_lines(polygon.iter());
let riders: Vec<Rider> = create_riders(
// Number of riders
4,
// Start pos
CoordOptions::Rand,
// Start speed
CoordOptions::Rand,
// Remountable
None,
);
game.add_riders(riders.iter());
game.write_to_file("decagon.track.json").ok();
}