Module: RTanque::Bot::BrainHelper

Defined in:
lib/rtanque/bot/brain_helper.rb

Overview

Some helpful constants and methods for use as mixin in Brain

Constant Summary collapse

BOT_RADIUS =
Bot::RADIUS
MAX_FIRE_POWER =
Bot::MAX_FIRE_POWER
MIN_FIRE_POWER =
Bot::MIN_FIRE_POWER
MAX_HEALTH =
Bot::MAX_HEALTH
MAX_BOT_SPEED =
Bot::MAX_SPEED
MAX_BOT_ROTATION =
Configuration.bot.turn_step
MAX_TURRET_ROTATION =
Configuration.turret.turn_step
MAX_RADAR_ROTATION =
Configuration.radar.turn_step

Instance Method Summary collapse

Instance Method Details

#at_tick_interval(num_of_ticks) { ... } ⇒ void

This method returns an undefined value.

Run block every 'num_of_ticks'

Yields:


18
19
20
# File 'lib/rtanque/bot/brain_helper.rb', line 18

def at_tick_interval(num_of_ticks)
  yield if sensors.ticks % num_of_ticks == 0
end