Class: RubyArena::Level
- Inherits:
-
Object
- Object
- RubyArena::Level
- Defined in:
- lib/ruby_arena/level.rb
Constant Summary collapse
- LEVELS =
{ 0 => { robots: [ { ai: Level0Ai, x: 600, y: 300, heading: 90 } ], user_robot_options: { x: 200, y: 300, heading: 90 } }, 1 => { robots: [ { ai: Level1Ai, x: 600, y: 300, heading: 90 } ], user_robot_options: { x: 200, y: 300, heading: -90 } }, 2 => { robots: [ { ai: Level2Ai, x: 600, y: 300, heading: -90, energy: 200 } ], user_robot_options: { x: 200, y: 300, heading: 90 } }, 3 => { robots: [ { ai: Level3Ai, x: 600, y: 300 } ], user_robot_options: { x: 200, y: 300 } } }
Instance Attribute Summary collapse
-
#level ⇒ Object
readonly
Returns the value of attribute level.
Instance Method Summary collapse
-
#initialize(level) ⇒ Level
constructor
A new instance of Level.
- #options_for_cpu_robots ⇒ Object
- #options_for_user_robot ⇒ Object
Constructor Details
#initialize(level) ⇒ Level
Returns a new instance of Level.
32 33 34 35 |
# File 'lib/ruby_arena/level.rb', line 32 def initialize(level) @level = level exit_if_level_is_not_defined end |
Instance Attribute Details
#level ⇒ Object (readonly)
Returns the value of attribute level.
30 31 32 |
# File 'lib/ruby_arena/level.rb', line 30 def level @level end |