Sha256: 7173b0750979288274c0bda1efbc64139e94e6c9eeec17833308d2051b9d474c

Contents?: true

Size: 677 Bytes

Versions: 7

Compression:

Stored size: 677 Bytes

Contents

module RTanque
  module Movable
    def tick
      update_position
    end

    def dead?
      false # should overwrite
    end

    def arena
      @arena
    end

    def arena=(val)
      @arena = val
    end

    def position
      @position
    end

    def position=(val)
      @position = val
    end

    def bound_to_arena
      true
    end

    def update_position
      @position = @position.move(self.heading, self.speed, self.bound_to_arena)
    end

    def heading
      @heading
    end

    def heading=(val)
      @heading = Heading.new(val) if val
    end

    def speed
      @speed
    end

    def speed=(val)
      @speed = val if val
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
rtanque-0.1.3 lib/rtanque/movable.rb
colstrom-rtanque-0.1.4 lib/rtanque/movable.rb
colstrom-rtanque-0.1.3 lib/rtanque/movable.rb
rtanque-0.1.2 lib/rtanque/movable.rb
rtanque-0.1.1 lib/rtanque/movable.rb
rtanque-0.1.0 lib/rtanque/movable.rb
rtanque-0.0.2 lib/rtanque/movable.rb