Skip to content

Commit

Permalink
draw_position docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dsrw committed Dec 7, 2023
1 parent d25b433 commit e4d6485
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions docs/book/coding/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ if player.hit(enemy1):
echo "The player hit enemy1"
```

## `position` / `postion=`
## `position` / `position=`

Gets or set the position of a unit as a Vector3. `me` by default.
Gets or set the position of a unit as a Vector3. `me` by default. Can also
be assigned a unit, which is a shortcut for `unit.position`.

```nim
if player.hit(enemy):
Expand All @@ -107,6 +108,21 @@ if player.hit(enemy):
player.position = vec3(0, 0, 0)
```

## `draw_position` / `draw_position=`

Gets or sets the draw point of a `Build` as a Vector3. `me` by default. Can also
be assigned a unit, which is a shortcut for `unit.position`.

```nim
speed = 0.1
# draw randomness around the player
forever:
color = random(blue, red, green)
forward 1..10
turn -90..90
draw_position = player
```

## `start_position`

The starting position of a unit. Missing currently, but will be in in 0.2.
Expand Down

0 comments on commit e4d6485

Please sign in to comment.