rtanque 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +0 -1
- data/README.md +11 -2
- data/bin/rtanque +2 -0
- data/lib/rtanque.rb +1 -10
- data/lib/rtanque/bot/sensors.rb +6 -2
- data/lib/rtanque/gui.rb +7 -6
- data/lib/rtanque/gui/bot.rb +30 -1
- data/lib/rtanque/gui/bot/health_color_calculator.rb +37 -0
- data/lib/rtanque/heading.rb +4 -14
- data/lib/rtanque/match.rb +1 -1
- data/lib/rtanque/point.rb +2 -2
- data/lib/rtanque/version.rb +1 -1
- data/rtanque.gemspec +1 -0
- data/spec/rtanque/heading_spec.rb +2 -2
- data/spec/rtanque_spec.rb +30 -2
- data/templates/bot.erb +7 -1
- metadata +28 -36
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2710b201f052939f4fdf9e2816050597b26e948e
|
4
|
+
data.tar.gz: 8273925c71ec90ecce35e5c8041674fe300dfeb7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 38ccf85cf7d8c1a36d9ede963892303865b611db05111e283d8baccdc27f3b86db48b384a6e5dd5535cb88aef076c27f60f0eb7646c7eefd7acc73f4b08d3752
|
7
|
+
data.tar.gz: be0f95f95194b3e72f0574478869a756615aafbaa0b10772e588eee2aee5e2c37495f53524e3883f5b6a97288d2873fb5a5aa19cc127be1f33dc067ed0c855b7
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -50,11 +50,20 @@ Make a project directory, init bundler, add the RTanque gem, and create a bot:
|
|
50
50
|
* [RTanque::Heading](http://rubydoc.info/github/awilliams/RTanque/master/frames/RTanque/Heading)
|
51
51
|
* [RTanque::Point](http://rubydoc.info/github/awilliams/RTanque/master/frames/RTanque/Point)
|
52
52
|
|
53
|
+
## Sharing
|
54
|
+
At some point you'll want to compete against other bots, or maybe you'll even organize a small tournament. Sharing bots is easy.
|
55
|
+
|
56
|
+
Ask your friends to upload their bot(s) in a [gist](https://gist.github.com/), which you can then download with the following command:
|
57
|
+
|
58
|
+
bundle exec rtanque get_gist <gist_id> ...
|
59
|
+
|
60
|
+
If you'd like to publicly share your bot, post its gist id on the wiki https://github.com/awilliams/RTanque/wiki/bot-gists
|
61
|
+
|
53
62
|
## Bot API
|
54
63
|
|
55
64
|
The tank api consists of reading input from Brain#sensors and giving output to Brain#command
|
56
65
|
|
57
|
-
**Brain#sensors**
|
66
|
+
**[Brain#sensors](http://rubydoc.info/github/awilliams/RTanque/master/frames/RTanque/Bot/Sensors)**
|
58
67
|
|
59
68
|
```ruby
|
60
69
|
class Bot < RTanque::Bot::Brain
|
@@ -75,7 +84,7 @@ class Bot < RTanque::Bot::Brain
|
|
75
84
|
end
|
76
85
|
end
|
77
86
|
```
|
78
|
-
**Brain#command**
|
87
|
+
**[Brain#command](http://rubydoc.info/github/awilliams/RTanque/master/frames/RTanque/Bot/Command)**
|
79
88
|
|
80
89
|
```ruby
|
81
90
|
class Bot < RTanque::Bot::Brain
|
data/bin/rtanque
CHANGED
@@ -26,7 +26,9 @@ LONGDESC
|
|
26
26
|
method_option :gui, :default => true, :type => :boolean, :banner => 'false to run headless'
|
27
27
|
method_option :gc, :default => true, :type => :boolean, :banner => 'disable GC (EXPERIMENTAL)'
|
28
28
|
method_option :quiet, :aliases => '-q', :default => false, :type => :boolean, :banner => 'disable chatter'
|
29
|
+
method_option :seed, :default => Kernel.srand, :type => :numeric, :banner => 'random number seed value'
|
29
30
|
def start(*brain_paths)
|
31
|
+
Kernel.srand(options[:seed])
|
30
32
|
runner = RTanque::Runner.new(options[:width], options[:height], options[:max_ticks])
|
31
33
|
brain_paths.each { |brain_path|
|
32
34
|
begin
|
data/lib/rtanque.rb
CHANGED
@@ -7,17 +7,8 @@
|
|
7
7
|
# * {RTanque::Bot::Command} Instance provided to {RTanque::Bot::Brain#command}
|
8
8
|
# * {RTanque::Heading} Handles angles
|
9
9
|
# * {RTanque::Point} Handles coordinates
|
10
|
-
# * {RTanqueCLI} CLI
|
11
10
|
module RTanque
|
12
|
-
|
13
|
-
def self.round(numeric, precision = nil)
|
14
|
-
if RUBY_VERSION >= '1.9'
|
15
|
-
numeric.round(precision)
|
16
|
-
else
|
17
|
-
# https://github.com/rails/rails/blob/v2.3.8/activesupport/lib/active_support/core_ext/float/rounding.rb
|
18
|
-
precision ? numeric.round : (numeric * (10 ** precision)).round / (10 ** precision).to_f
|
19
|
-
end
|
20
|
-
end
|
11
|
+
|
21
12
|
end
|
22
13
|
|
23
14
|
require 'rtanque/version'
|
data/lib/rtanque/bot/sensors.rb
CHANGED
@@ -21,8 +21,12 @@ module RTanque
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def button_down?(button_id)
|
24
|
-
|
25
|
-
|
24
|
+
if self.class.const_defined?(:Gosu)
|
25
|
+
button_id = Gosu::Window.char_to_button_id(button_id) unless button_id.kind_of?(Integer)
|
26
|
+
@gui_window && @gui_window.button_down?(button_id)
|
27
|
+
else
|
28
|
+
false
|
29
|
+
end
|
26
30
|
end
|
27
31
|
|
28
32
|
def gui_window=(gui_window)
|
data/lib/rtanque/gui.rb
CHANGED
@@ -7,12 +7,13 @@ module RTanque
|
|
7
7
|
|
8
8
|
module ZOrder
|
9
9
|
BACKGROUND = -1
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
10
|
+
BOT_HEALTH = 5
|
11
|
+
BOT_NAME = 6
|
12
|
+
BOT_BODY = 7
|
13
|
+
BOT_TURRET = 8
|
14
|
+
BOT_RADAR = 9
|
15
|
+
SHELL = 10
|
16
|
+
EXPLOSION = 20
|
16
17
|
end
|
17
18
|
end
|
18
19
|
end
|
data/lib/rtanque/gui/bot.rb
CHANGED
@@ -1,16 +1,23 @@
|
|
1
1
|
require 'gosu'
|
2
|
+
require 'texplay'
|
3
|
+
|
4
|
+
require 'rtanque/gui/bot/health_color_calculator'
|
2
5
|
|
3
6
|
module RTanque
|
4
7
|
module Gui
|
5
8
|
class Bot
|
6
9
|
attr_reader :bot
|
7
10
|
|
11
|
+
HEALTH_BAR_HEIGHT = 3
|
12
|
+
HEALTH_BAR_WIDTH = 100
|
13
|
+
|
8
14
|
def initialize(window, bot)
|
9
15
|
@window = window
|
10
16
|
@bot = bot
|
11
17
|
@body_image = Gosu::Image.new(@window, Gui.resource_path("images/body.png"))
|
12
18
|
@turret_image = Gosu::Image.new(@window, Gui.resource_path("images/turret.png"))
|
13
19
|
@radar_image = Gosu::Image.new(@window, Gui.resource_path("images/radar.png"))
|
20
|
+
@score_bar_image = TexPlay.create_blank_image(@window, HEALTH_BAR_WIDTH, HEALTH_BAR_HEIGHT)
|
14
21
|
@name_font = Gosu::Font.new(@window, Window::FONT_NAME, Window::SMALL_FONT_SIZE)
|
15
22
|
@x_factor = 1
|
16
23
|
@y_factor = 1
|
@@ -20,6 +27,7 @@ module RTanque
|
|
20
27
|
position = [@bot.position.x, @window.height - @bot.position.y]
|
21
28
|
draw_bot(position)
|
22
29
|
draw_name(position)
|
30
|
+
draw_health(position)
|
23
31
|
end
|
24
32
|
|
25
33
|
def grow(factor = 2, step = 0.002)
|
@@ -37,6 +45,27 @@ module RTanque
|
|
37
45
|
x,y = *position
|
38
46
|
@name_font.draw_rel(self.bot.name, x, y + (RTanque::Bot::RADIUS * @y_factor) + Window::SMALL_FONT_SIZE.to_i, ZOrder::BOT_NAME, 0.5, 0.5, @x_factor, @y_factor)
|
39
47
|
end
|
48
|
+
|
49
|
+
def draw_health(position)
|
50
|
+
x,y = *position
|
51
|
+
x_health = health.round(0)
|
52
|
+
health_color = color_for_health
|
53
|
+
@score_bar_image.paint {
|
54
|
+
rect 0, 0, HEALTH_BAR_WIDTH, HEALTH_BAR_HEIGHT, :color => [0,0,0,0], :fill => true
|
55
|
+
rect 0, 0, x_health, HEALTH_BAR_HEIGHT, :color => health_color, :fill => true
|
56
|
+
}
|
57
|
+
@score_bar_image.draw(x - (HEALTH_BAR_WIDTH/2) * @x_factor, y + (5 + RTanque::Bot::RADIUS) * @y_factor, ZOrder::BOT_HEALTH, @x_factor, @y_factor)
|
58
|
+
end
|
59
|
+
|
60
|
+
private
|
61
|
+
|
62
|
+
def color_for_health
|
63
|
+
HealthColorCalculator.new(health).color_as_rgb
|
64
|
+
end
|
65
|
+
|
66
|
+
def health
|
67
|
+
self.bot.health
|
68
|
+
end
|
40
69
|
end
|
41
70
|
end
|
42
|
-
end
|
71
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module RTanque
|
2
|
+
module Gui
|
3
|
+
class Bot
|
4
|
+
class HealthColorCalculator
|
5
|
+
|
6
|
+
# different health-clors as RGB values
|
7
|
+
FULL_HEALTH_COLOR = [ 74, 190, 74].map { |v| v/255.0 }
|
8
|
+
MEDIUM_HEALTH_COLOR = [255, 190, 0].map { |v| v/255.0 }
|
9
|
+
LOW_HEALTH_COLOR = [220, 0, 0].map { |v| v/255.0 }
|
10
|
+
|
11
|
+
attr_reader :health
|
12
|
+
|
13
|
+
def initialize(health)
|
14
|
+
@health = health
|
15
|
+
end
|
16
|
+
|
17
|
+
def color_as_rgb
|
18
|
+
if health > 50
|
19
|
+
percentage = ((100 - health) / 50)
|
20
|
+
color_between FULL_HEALTH_COLOR, MEDIUM_HEALTH_COLOR, percentage
|
21
|
+
else
|
22
|
+
percentage = ((50 - health) / 50)
|
23
|
+
color_between MEDIUM_HEALTH_COLOR, LOW_HEALTH_COLOR, percentage
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def color_between(color_a, color_b, percentage)
|
28
|
+
[
|
29
|
+
(color_b[0] - color_a[0]) * percentage + color_a[0],
|
30
|
+
(color_b[1] - color_a[1]) * percentage + color_a[1],
|
31
|
+
(color_b[2] - color_a[2]) * percentage + color_a[2]
|
32
|
+
]
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/lib/rtanque/heading.rb
CHANGED
@@ -59,7 +59,7 @@ module RTanque
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def self.rand
|
62
|
-
self.new(
|
62
|
+
self.new(Kernel.rand * FULL_ANGLE)
|
63
63
|
end
|
64
64
|
|
65
65
|
attr_reader :radians
|
@@ -67,7 +67,7 @@ module RTanque
|
|
67
67
|
# Creates a new RTanque::Heading
|
68
68
|
# @param [#to_f] radians degree to wrap (in radians)
|
69
69
|
def initialize(radians = NORTH)
|
70
|
-
@radians =
|
70
|
+
@radians = radians.to_f % FULL_ANGLE
|
71
71
|
@memoized = {} # allow memoization since @some_var ||= x doesn't work when frozen
|
72
72
|
self.freeze
|
73
73
|
end
|
@@ -108,7 +108,7 @@ module RTanque
|
|
108
108
|
# @param [#to_f] other_heading
|
109
109
|
# @return [RTanque::Heading]
|
110
110
|
def +(other_heading)
|
111
|
-
self.class.new(self.radians +
|
111
|
+
self.class.new(self.radians + other_heading.to_f)
|
112
112
|
end
|
113
113
|
|
114
114
|
# @param [#to_f] other_heading
|
@@ -120,7 +120,7 @@ module RTanque
|
|
120
120
|
# @param [#to_f] other_heading
|
121
121
|
# @return [RTanque::Heading]
|
122
122
|
def *(other_heading)
|
123
|
-
self.class.new(self.radians *
|
123
|
+
self.class.new(self.radians * other_heading.to_f)
|
124
124
|
end
|
125
125
|
|
126
126
|
# @param [#to_f] other_heading
|
@@ -158,15 +158,5 @@ module RTanque
|
|
158
158
|
def to_degrees
|
159
159
|
@memoized[:to_degrees] ||= (self.radians * 180.0) / Math::PI
|
160
160
|
end
|
161
|
-
|
162
|
-
protected
|
163
|
-
|
164
|
-
def extract_radians_from_value(value)
|
165
|
-
if value.respond_to?(:radians)
|
166
|
-
value.radians
|
167
|
-
else
|
168
|
-
value.to_f
|
169
|
-
end
|
170
|
-
end
|
171
161
|
end
|
172
162
|
end
|
data/lib/rtanque/match.rb
CHANGED
@@ -49,7 +49,7 @@ module RTanque
|
|
49
49
|
|
50
50
|
def pre_shell_tick(shell)
|
51
51
|
shell.hits(self.bots.all_but(shell.bot)) do |origin_bot, bot_hit|
|
52
|
-
damage = (shell.fire_power
|
52
|
+
damage = (shell.fire_power**RTanque::Shell::RATIO)
|
53
53
|
bot_hit.reduce_health(damage)
|
54
54
|
if bot_hit.dead?
|
55
55
|
@explosions.add(Explosion.new(bot_hit.position))
|
data/lib/rtanque/point.rb
CHANGED
@@ -111,8 +111,8 @@ module RTanque
|
|
111
111
|
|
112
112
|
def move(heading, speed, bound_to_arena = true)
|
113
113
|
# round to avoid floating point errors
|
114
|
-
x =
|
115
|
-
y =
|
114
|
+
x = (self.x + (Math.sin(heading) * speed)).round(10)
|
115
|
+
y = (self.y + (Math.cos(heading) * speed)).round(10)
|
116
116
|
self.class.new(x, y, self.arena) { |point| point.bind_to_arena if bound_to_arena }
|
117
117
|
end
|
118
118
|
|
data/lib/rtanque/version.rb
CHANGED
data/rtanque.gemspec
CHANGED
@@ -26,6 +26,7 @@ Have fun competing against friends' tanks or the sample ones included. Maybe you
|
|
26
26
|
gem.add_dependency 'configuration', '~> 1.3.2'
|
27
27
|
gem.add_dependency 'octokit', '~> 1.23.0'
|
28
28
|
gem.add_dependency 'thor', '~> 0.17.0'
|
29
|
+
gem.add_dependency 'texplay'
|
29
30
|
|
30
31
|
gem.add_development_dependency 'pry'
|
31
32
|
gem.add_development_dependency 'rspec', '~> 2.13.0'
|
@@ -52,8 +52,8 @@ describe RTanque::Heading do
|
|
52
52
|
|
53
53
|
it 'correctly handles when a and b are on both sides of 180' do
|
54
54
|
@instance = described_class.new(RTanque::Heading::S - RTanque::Heading::ONE_DEGREE)
|
55
|
-
delta =
|
56
|
-
expected =
|
55
|
+
delta = (@instance.delta(RTanque::Heading::S + RTanque::Heading::ONE_DEGREE)).round(5)
|
56
|
+
expected = (RTanque::Heading::ONE_DEGREE * 2).round(5)
|
57
57
|
expect(delta).to eq(expected)
|
58
58
|
end
|
59
59
|
end
|
data/spec/rtanque_spec.rb
CHANGED
@@ -1,6 +1,34 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe RTanque do
|
4
|
-
|
5
|
-
|
4
|
+
|
5
|
+
context 'face-off' do
|
6
|
+
before(:each) {
|
7
|
+
@winner = brain_bot { self.command.fire(RTanque::Bot::MAX_GUN_ENERGY) }
|
8
|
+
@looser = brain_bot { }
|
9
|
+
@winner.position = RTanque::Point.new(0, 0, @arena)
|
10
|
+
@winner.turret.heading = RTanque::Heading.new(RTanque::Heading::N)
|
11
|
+
@looser.position = RTanque::Point.new(0, @arena.height, @arena)
|
12
|
+
@match = RTanque::Match.new(@arena, 1000)
|
13
|
+
@match.add_bots(@winner, @looser)
|
14
|
+
}
|
15
|
+
|
16
|
+
it 'winner bot should win' do
|
17
|
+
@match.start
|
18
|
+
expect(@match.bots.to_a).to eq [@winner]
|
19
|
+
expect(@match.ticks).to be < @match.max_ticks
|
20
|
+
expect(@winner.health).to be(RTanque::Configuration.bot.health.max)
|
21
|
+
expect(@looser.health).to be <= RTanque::Configuration.bot.health.min
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'no bot should win' do
|
25
|
+
@winner.turret.heading = RTanque::Heading.new(RTanque::Heading::E)
|
26
|
+
@match.start
|
27
|
+
expect(@match.bots.to_a).to eq [@winner, @looser]
|
28
|
+
expect(@match.ticks).to be(@match.max_ticks)
|
29
|
+
expect(@winner.health).to be(RTanque::Configuration.bot.health.max)
|
30
|
+
expect(@looser.health).to be(RTanque::Configuration.bot.health.max)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
6
34
|
end
|
data/templates/bot.erb
CHANGED
@@ -4,8 +4,14 @@ class <%= @bot_class_name %> < RTanque::Bot::Brain
|
|
4
4
|
|
5
5
|
def tick!
|
6
6
|
## main logic goes here
|
7
|
+
|
7
8
|
# use self.sensors to detect things
|
9
|
+
# See http://rubydoc.info/github/awilliams/RTanque/master/RTanque/Bot/Sensors
|
10
|
+
|
8
11
|
# use self.command to control tank
|
12
|
+
# See http://rubydoc.info/github/awilliams/RTanque/master/RTanque/Bot/Command
|
13
|
+
|
9
14
|
# self.arena contains the dimensions of the arena
|
15
|
+
# See http://rubydoc.info/github/awilliams/RTanque/master/frames/RTanque/Arena
|
10
16
|
end
|
11
|
-
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rtanque
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Adam Williams
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-04-23 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: gosu
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: configuration
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: octokit
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ~>
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ~>
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -62,7 +55,6 @@ dependencies:
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: thor
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ~>
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,31 +62,41 @@ dependencies:
|
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ~>
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: 0.17.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: texplay
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
78
83
|
- !ruby/object:Gem::Dependency
|
79
84
|
name: pry
|
80
85
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
86
|
requirements:
|
83
|
-
- -
|
87
|
+
- - '>='
|
84
88
|
- !ruby/object:Gem::Version
|
85
89
|
version: '0'
|
86
90
|
type: :development
|
87
91
|
prerelease: false
|
88
92
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
93
|
requirements:
|
91
|
-
- -
|
94
|
+
- - '>='
|
92
95
|
- !ruby/object:Gem::Version
|
93
96
|
version: '0'
|
94
97
|
- !ruby/object:Gem::Dependency
|
95
98
|
name: rspec
|
96
99
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
100
|
requirements:
|
99
101
|
- - ~>
|
100
102
|
- !ruby/object:Gem::Version
|
@@ -102,7 +104,6 @@ dependencies:
|
|
102
104
|
type: :development
|
103
105
|
prerelease: false
|
104
106
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
107
|
requirements:
|
107
108
|
- - ~>
|
108
109
|
- !ruby/object:Gem::Version
|
@@ -110,7 +111,6 @@ dependencies:
|
|
110
111
|
- !ruby/object:Gem::Dependency
|
111
112
|
name: rspec-mocks
|
112
113
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
114
|
requirements:
|
115
115
|
- - ~>
|
116
116
|
- !ruby/object:Gem::Version
|
@@ -118,24 +118,16 @@ dependencies:
|
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
121
|
requirements:
|
123
122
|
- - ~>
|
124
123
|
- !ruby/object:Gem::Version
|
125
124
|
version: 2.13.0
|
126
|
-
description:
|
127
|
-
tank and then send their tank+brain into battle with other tanks. All tanks are
|
128
|
-
otherwise equal.
|
129
|
-
|
130
|
-
|
131
|
-
Rules of the game are simple: Last bot standing wins. Gameplay is also pretty simple.
|
132
|
-
Each tank has a base, turret and radar, each of which rotate independently. The
|
133
|
-
base moves the tank, the turret has a gun mounted to it which can fire at other
|
134
|
-
tanks, and the radar detects other tanks in its field of vision.
|
125
|
+
description: |-
|
126
|
+
RTanque is a game for programmers. Players program the brain of a tank and then send their tank+brain into battle with other tanks. All tanks are otherwise equal.
|
135
127
|
|
128
|
+
Rules of the game are simple: Last bot standing wins. Gameplay is also pretty simple. Each tank has a base, turret and radar, each of which rotate independently. The base moves the tank, the turret has a gun mounted to it which can fire at other tanks, and the radar detects other tanks in its field of vision.
|
136
129
|
|
137
|
-
Have fun competing against friends'
|
138
|
-
start a small league at your local Ruby meetup.'
|
130
|
+
Have fun competing against friends' tanks or the sample ones included. Maybe you'll start a small league at your local Ruby meetup.
|
139
131
|
email:
|
140
132
|
- pwnfactory@gmail.com
|
141
133
|
executables:
|
@@ -167,6 +159,7 @@ files:
|
|
167
159
|
- lib/rtanque/explosion.rb
|
168
160
|
- lib/rtanque/gui.rb
|
169
161
|
- lib/rtanque/gui/bot.rb
|
162
|
+
- lib/rtanque/gui/bot/health_color_calculator.rb
|
170
163
|
- lib/rtanque/gui/draw_group.rb
|
171
164
|
- lib/rtanque/gui/explosion.rb
|
172
165
|
- lib/rtanque/gui/shell.rb
|
@@ -275,27 +268,26 @@ files:
|
|
275
268
|
homepage: https://github.com/awilliams/RTanque
|
276
269
|
licenses:
|
277
270
|
- MIT
|
271
|
+
metadata: {}
|
278
272
|
post_install_message:
|
279
273
|
rdoc_options: []
|
280
274
|
require_paths:
|
281
275
|
- lib
|
282
276
|
required_ruby_version: !ruby/object:Gem::Requirement
|
283
|
-
none: false
|
284
277
|
requirements:
|
285
|
-
- -
|
278
|
+
- - '>='
|
286
279
|
- !ruby/object:Gem::Version
|
287
280
|
version: '0'
|
288
281
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
289
|
-
none: false
|
290
282
|
requirements:
|
291
|
-
- -
|
283
|
+
- - '>='
|
292
284
|
- !ruby/object:Gem::Version
|
293
285
|
version: '0'
|
294
286
|
requirements: []
|
295
287
|
rubyforge_project:
|
296
|
-
rubygems_version:
|
288
|
+
rubygems_version: 2.0.3
|
297
289
|
signing_key:
|
298
|
-
specification_version:
|
290
|
+
specification_version: 4
|
299
291
|
summary: RTanque is a game for programmers. Players program the brain of a tank and
|
300
292
|
then send their tank into battle against other tanks.
|
301
293
|
test_files:
|