This is the API reference for Oort. For more general information see the wiki.

Starter Code

Oort expects your code to have a Ship type with a tick method. Each tutorial provides some starter code which includes this:

```rust use oort_api::prelude::*;

pub struct Ship {}

impl Ship { pub fn new() -> Ship { Ship {} }

pub fn tick(&mut self) {
}

} ```

The game will call your new function when a ship is created and then call tick 60 times per second during the simulation.

struct Ship is useful for storing any state that needs to persist between ticks. enum Ship works too and can be helpful when this state differs between ship classes.

The statement use oort_api::prelude::* imports all the APIs so that you can use them simply as e.g. position(). See the [prelude] module documentation for the details on everything this imports. The important APIs are covered below.

Subsystems

Ship Status and Control

Weapons

Radar

Radio

Scalar Math

See the Rust documentation for the full list of f64 methods.

Vector Math

Two-dimensional floating point vectors (Vec2) are ubiquitous in Oort and are used to represent positions, velocities, accelerations, etc.

Debugging

Miscellaneous

Ship Classes