Class: Rubygoal::FastPlayer

Inherits:
Player
  • Object
show all
Defined in:
lib/rubygoal/players/fast.rb

Constant Summary

Constants inherited from Player

Player::STRAIGHT_ANGLE

Constants included from Moveable

Moveable::MIN_DISTANCE

Instance Attribute Summary

Attributes inherited from Player

#coach_defined_position, #name, #side, #type

Attributes included from Moveable

#destination, #position, #rotation, #velocity

Instance Method Summary collapse

Methods inherited from Player

#can_kick?, #kick, #move_to_coach_position, #update

Methods included from Moveable

#distance, #move_to, #moving?, #position_after_update, #stop, #update

Constructor Details

#initialize(*args) ⇒ FastPlayer

Returns a new instance of FastPlayer.



5
6
7
8
9
10
11
12
13
14
# File 'lib/rubygoal/players/fast.rb', line 5

def initialize(*args)
  super
  config = Rubygoal.configuration
  error_range = config.fast_lower_error..config.fast_upper_error

  @error = Random.rand(error_range)
  @speed = config.fast_speed

  @type = :fast
end