macro

package
v0.0.0-...-b239de3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package macro is a collection of semi-automation functions. A macro function can be set on each tank, which is executed with every update.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttackMove

func AttackMove(t *core.Tank, filter ...string)

AttackMove moves the tank in the aligned direction. If the tank encounters an enemy, it stops and opens fire. If the enemy is destroyed, the tank continues to move.

func FireAndManeuver

func FireAndManeuver(t *core.Tank)

FireAndManeuver moves the tank in the aligned direction. Whenever the weapon is loaded, the tank will stop and fire. While reloading, the tank keeps moving.

func FireWall

func FireWall(t *core.Tank)

FireWall fires at random positions in front of the tank. Most fun in combination with the rocket launcher.

func GuardMode

func GuardMode(t *core.Tank, filter ...string)

GuardMode makes the tank wait and attack anything that approaches. Cannons can change their angle but cannot move.

func MoveTo

func MoveTo(t *core.Tank, to core.Position)

MoveTo uses Forward(), Left() and Right() to reach the given position. If the tank becomes Blocked(), the algorithm will be paused and must be reset manually with Forward().

func RotationsToTarget

func RotationsToTarget(t *core.Tank, relativeAngle int) int

RotationsToTarget returns the number of rotation steps. Negative numbers require rotation to the left. Positive numbers require rotation to the right.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL