logo bannerlogo banner
Page Navigator

Example Usage

import { Movements } from 'yolkbot/constants';

bot.emit('move', Movement.FORWARD); // move forward
bot.emit('move', [Movement.FORWARD, Movement.LEFT]); // move forward & to the left
bot.emit('move', [Movement.FORWARD, Movement.LEFT, Movement.JUMP]); // move forward & to the left while jumping
bot.emit('move', []); // stop moving entirely

// legacy dispatches: bot.dispatch(new MovementDispatch(Movement.FORWARD));

Checks

  • The bot must be playing the game
  • The movement passed must be a valid movement
    • Movement validation is not as strict as other dispatches due to the enum format
    • Be careful to only pass valid movement patterns
    • Things like moving forward & backward at the same time will flag