Skip to content

Calling addMove()

Tom Sherman edited this page Mar 7, 2017 · 8 revisions

Calling addMove

addMove is the function that tells the AI to execute a move. There are many predefined moves in moves.h and you can create your own.

When calling addMove just rememeber that it takes a pointer to a Move struct. The move should be declared somewhere in the global scope and you should pass it with &.

INDEFINITE Moves

Some moves release all their inputs after a certain number of frames (e.g. _mv_spotDodge lasts exactly 2 frames). However, other moves, will not terminate on their own. These moves must be ended separately, usually by adding logic to the AI telling it to clear its controller after a certain event. Beware of calling indefinite moves directly from logic.

Setting values in Move

This is explained in more detail here, but just be aware that some moves require you to set the direction before calling addMove. This is accomplished with macros provided in moves.h (e.g. SET_UP_B_DIR(45.f)).

Clone this wiki locally