Crates.io | wasmdome-mech-sdk |
lib.rs | wasmdome-mech-sdk |
version | 0.0.7 |
source | src |
created_at | 2020-02-26 14:56:35.283568 |
updated_at | 2020-07-29 16:22:25.306015 |
description | SDK for developing WebAssembly robots to compete autonomously in arenas |
homepage | https://wasmdome.dev |
repository | |
max_upload_size | |
id | 212711 |
size | 16,324 |
This is the SDK used by developers for building mechs to compete in the WasmDome. Developers building mechs that will compete for nothing less than the survival of the planet will do so by responding to turn events delivered by the game engine and return a vector of mech commands..
Here's an example of a mech that simply moves north and fires every turn (obviously you will want a more clever strategy if you want to win):
extern crate wasmdome_mech_sdk as mech;
use mech::*;
mech_handler!(handler);
pub fn handler(mech: impl MechInstruments) -> Vec<MechCommand> {
vec![
mech.request_radar(),
mech.move_mech(GridDirection::North),
mech.fire_primary(GridDirection::South)
]
}