Logo FSBarV1_Archived

UnitSim Module

Unit movement simulation.

Types

Type Description

MovingUnit

Internal state for a moving unit.

Functions and values

Function or value Description

create unit speed mapWidth mapHeight seed

Full Usage: create unit speed mapWidth mapHeight seed

Parameters:
    unit : TrackedUnit
    speed : float32
    mapWidth : float32
    mapHeight : float32
    seed : int

Returns: MovingUnit

Create a MovingUnit with a random target within map bounds.

unit : TrackedUnit
speed : float32
mapWidth : float32
mapHeight : float32
seed : int
Returns: MovingUnit

step mu mapWidth mapHeight frame

Full Usage: step mu mapWidth mapHeight frame

Parameters:
    mu : MovingUnit
    mapWidth : float32
    mapHeight : float32
    frame : int

Returns: MovingUnit

Advance one frame. Moves toward target; picks new target when reached. Returns updated MovingUnit.

mu : MovingUnit
mapWidth : float32
mapHeight : float32
frame : int
Returns: MovingUnit

Type something to start searching.