module RTanque::Movable

Public Instance Methods

arena() click to toggle source
# File lib/rtanque/movable.rb, line 11
def arena
  @arena
end
arena=(val) click to toggle source
# File lib/rtanque/movable.rb, line 15
def arena=(val)
  @arena = val
end
bound_to_arena() click to toggle source
# File lib/rtanque/movable.rb, line 27
def bound_to_arena
  true
end
dead?() click to toggle source
# File lib/rtanque/movable.rb, line 7
def dead?
  false # should overwrite
end
heading() click to toggle source
# File lib/rtanque/movable.rb, line 35
def heading
  @heading
end
heading=(val) click to toggle source
# File lib/rtanque/movable.rb, line 39
def heading=(val)
  @heading = Heading.new(val) if val
end
position() click to toggle source
# File lib/rtanque/movable.rb, line 19
def position
  @position
end
position=(val) click to toggle source
# File lib/rtanque/movable.rb, line 23
def position=(val)
  @position = val
end
speed() click to toggle source
# File lib/rtanque/movable.rb, line 43
def speed
  @speed
end
speed=(val) click to toggle source
# File lib/rtanque/movable.rb, line 47
def speed=(val)
  @speed = val if val
end
tick() click to toggle source
# File lib/rtanque/movable.rb, line 3
def tick
  update_position
end
update_position() click to toggle source
# File lib/rtanque/movable.rb, line 31
def update_position
  @position = @position.move(self.heading, self.speed, self.bound_to_arena)
end