scorched_earth 5.0.0.pre-java → 5.0.1.pre-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e60a9daf9b54210e93dc7b3f976b483b327e9227
4
- data.tar.gz: 3c33b9d2d7e31751af4a2b70b919684f70da8e62
3
+ metadata.gz: dfa1221f5544042db555d173cf834a693e8f45b2
4
+ data.tar.gz: d1a2e0323a1e430ff7c3d6d31091c7147e34e8f1
5
5
  SHA512:
6
- metadata.gz: b71e277cf4f593bdab66c9d42c47890074f54f81cf9a1987a38e813ec69fe6cd53d173b797f12f04d7e95e8632365b2ef443542f30da32ae3e24ede439acd9a0
7
- data.tar.gz: 2e0a0f18b34c94a69aaed1d8f3ec60f09650c59eac02c19188f6577abcfe69dcf566740a87fe9cad20dfe158f7537f8ddac27cc8ab2e6872ef2ff60001598e09
6
+ metadata.gz: ef23bc10966526eb981726d24ef69312758bf2bf87e2dc105b69477e158b385557206d42c2fd6333e8ac425f175425ea1323e6f6f1f78b7fc17a85fc97bc6a9d
7
+ data.tar.gz: 4e9fb4f997f614af6c8dfd71ce123acca2a2dc4963d8e652606f5a239fac0eb0dccaa9e8feb7faababf3cb4d4394e557b51e49917b84b1cc1274978bd5cca213
data/.rubocop.yml ADDED
@@ -0,0 +1,4 @@
1
+ Documentation:
2
+ Enabled: false
3
+ Metrics/LineLength:
4
+ Max: 120
data/README.md CHANGED
@@ -2,9 +2,7 @@
2
2
 
3
3
  [![Code Climate](https://codeclimate.com/github/jamesmoriarty/scorched-earth-rb/badges/gpa.svg)](https://codeclimate.com/github/jamesmoriarty/scorched-earth-rb) [![Test Coverage](https://codeclimate.com/github/jamesmoriarty/scorched-earth-rb/badges/coverage.svg)](https://codeclimate.com/github/jamesmoriarty/scorched-earth-rb/coverage)
4
4
 
5
- A little [Scorched Earth](https://en.wikipedia.org/wiki/ScorchedEarth_Earth_(video_game)) clone in the Ruby Programming Language.
6
-
7
- With a segue into procedurally generated color palettes:
5
+ A little [Scorched Earth](https://en.wikipedia.org/wiki/ScorchedEarth_Earth_(video_game)) clone in the Ruby Programming Language (JRuby). Now including a segue into procedurally generated color palettes:
8
6
  - [TriadMixing](http://devmag.org.za/2012/07/29/how-to-choose-colours-procedurally-algorithms/)
9
7
  - [CIE94](https://en.wikipedia.org/wiki/Color_difference#CIE94)
10
8
 
@@ -12,33 +10,20 @@ With a segue into procedurally generated color palettes:
12
10
 
13
11
  ## Installation
14
12
 
15
- ```
16
- brew install glew libsndfile
17
- ```
18
-
19
- Add this line to your application's Gemfile:
20
-
21
- ```ruby
22
- gem 'scorched_earth'
23
- ```
24
-
25
- And then execute:
26
-
27
- $ bundle
28
-
29
- Or install it yourself as:
30
-
31
- $ gem install scorched_earth
13
+ $ brew install jruby
14
+ $ jruby -S gem install scorched_earth --pre
32
15
 
33
16
  ## Usage
34
17
 
35
- $ scorched
18
+ $ jruby -S scorched
36
19
 
37
20
  ## Development
38
21
 
39
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
40
-
41
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
22
+ $ uname
23
+ Darwin
24
+ $ jruby --version
25
+ jruby 9.1.5.0 (2.3.1) 2016-09-07 036ce39 Java HotSpot(TM) 64-Bit Server VM 25.74-b02 on 1.8.0_74-b02 +jit [darwin-x86_64]
26
+ $ jruby -S bundle exec rake
42
27
 
43
28
  ## Contributing
44
29
 
data/Rakefile CHANGED
@@ -1,10 +1,10 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
3
 
4
4
  Rake::TestTask.new(:test) do |t|
5
- t.libs << "test"
6
- t.libs << "lib"
5
+ t.libs << 'test'
6
+ t.libs << 'lib'
7
7
  t.test_files = FileList['test/**/*_test.rb']
8
8
  end
9
9
 
10
- task :default => :test
10
+ task default: :test
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "bundler/setup"
4
- require "scorched_earth"
3
+ require 'bundler/setup'
4
+ require 'scorched_earth'
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -10,5 +10,5 @@ require "scorched_earth"
10
10
  # require "pry"
11
11
  # Pry.start
12
12
 
13
- require "irb"
13
+ require 'irb'
14
14
  IRB.start
data/exe/scorched CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env jruby
2
2
 
3
- require_relative "../lib/scorched_earth"
3
+ require_relative '../lib/scorched_earth'
4
4
 
5
5
  ScorchedEarth::GameWindow.new(800, 600).run
@@ -1,6 +1,6 @@
1
- $:.unshift File.dirname(__FILE__)
1
+ $LOAD_PATH.unshift File.dirname(__FILE__)
2
2
 
3
- require "scorched_earth/version"
4
- require "scorched_earth/game_window"
3
+ require 'scorched_earth/version'
4
+ require 'scorched_earth/game_window'
5
5
 
6
6
  module ScorchedEarth; end
@@ -44,7 +44,7 @@ module ScorchedEarth
44
44
  Color.new(
45
45
  (mix.red + color.red * scale).to_i,
46
46
  (mix.green + color.green * scale).to_i,
47
- (mix.blue + color.blue * scale).to_i,
47
+ (mix.blue + color.blue * scale).to_i
48
48
  )
49
49
  end
50
50
  end
@@ -0,0 +1,28 @@
1
+ module ScorchedEarth
2
+ class EventRunner
3
+ attr_reader :events, :subscribers
4
+
5
+ def initialize
6
+ @events = Queue.new
7
+ @subscribers = []
8
+ end
9
+
10
+ def publish(event)
11
+ events << event
12
+ end
13
+
14
+ def subscribe(klass, &block)
15
+ subscribers << [klass, block]
16
+ end
17
+
18
+ def process_events!
19
+ until events.empty?
20
+ event = events.pop
21
+
22
+ subscribers.each do |klass, block|
23
+ block.call event if event.is_a? klass
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -1,5 +1,5 @@
1
1
  module ScorchedEarth
2
2
  module Events
3
- EntityCreated = Struct.new(:entity)
3
+ EntityCreated = Struct.new(:entity)
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module ScorchedEarth
2
2
  module Events
3
- GameEnding = Struct.new(:time)
3
+ GameEnding = Struct.new(:time)
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module ScorchedEarth
2
2
  module Events
3
- MouseMoved = Struct.new(:x, :y)
3
+ MouseMoved = Struct.new(:x, :y)
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module ScorchedEarth
2
2
  module Events
3
- MousePressed = Struct.new(:x, :y)
3
+ MousePressed = Struct.new(:x, :y)
4
4
  end
5
5
  end
@@ -3,10 +3,12 @@ module ScorchedEarth
3
3
  attr_reader :x, :y, :color, :radius
4
4
 
5
5
  def initialize(x, y)
6
- @x, @y, @radius = x, y, 25
6
+ @x = x
7
+ @y = y
8
+ @radius = 25
7
9
  end
8
10
 
9
- def update(delta)
11
+ def update(_delta)
10
12
  @radius += 25
11
13
  @x -= 1_000_000 if radius > 100
12
14
  end
@@ -1,12 +1,13 @@
1
- require "scorched_earth/helpers"
2
- require "scorched_earth/terrain"
3
- require "scorched_earth/player"
4
- require "scorched_earth/shot"
5
- require "scorched_earth/explosion"
6
- require "scorched_earth/mouse"
7
- require "scorched_earth/color_palette"
8
- require "scorched_earth/events/entity_created"
9
- require "scorched_earth/events/game_ending"
1
+ require 'scorched_earth/helpers'
2
+ require 'scorched_earth/terrain'
3
+ require 'scorched_earth/player'
4
+ require 'scorched_earth/shot'
5
+ require 'scorched_earth/explosion'
6
+ require 'scorched_earth/mouse'
7
+ require 'scorched_earth/color_palette'
8
+ require 'scorched_earth/event_runner'
9
+ require 'scorched_earth/events/entity_created'
10
+ require 'scorched_earth/events/game_ending'
10
11
 
11
12
  include Java
12
13
 
@@ -17,52 +18,43 @@ module ScorchedEarth
17
18
  include Helpers
18
19
 
19
20
  attr_reader :width, :height,
20
- :color_palette, :entities, :mouse, :players, :terrain,
21
- :events, :event_listeners
21
+ :color_palette, :entities, :mouse, :players, :terrain,
22
+ :event_runner
22
23
 
23
- def initialize width, height
24
- @width, @height = width, height
24
+ def initialize(width, height)
25
+ @width = width
26
+ @height = height
25
27
  end
26
28
 
27
29
  def setup
28
- @color_palette = ColorPalette.new Color::RED, Color::YELLOW, Color::WHITE
29
- @entities = []
30
- @events = Queue.new
31
- @event_listeners = []
32
- @players = 2.times.map { |index| Player.new rand(width), color_palette.get("player_#{index}") }
33
- @terrain = Terrain.new width, height, rand(10), color_palette.get("terrain")
34
- @mouse = Mouse.new self
35
-
36
- on Events::EntityCreated do |event|
37
- entities << event.entity
38
- end
39
-
40
- on Events::GameEnding do |event|
41
- if event.time < Time.now
42
- setup
43
- else
44
- emit event
45
- end
46
- end
30
+ @color_palette = ColorPalette.new Color::RED, Color::YELLOW, Color::WHITE
31
+ @entities = []
32
+ @event_runner = EventRunner.new
33
+ @players = Array.new(2) { |index| Player.new rand(width), color_palette.get("player_#{index}") }
34
+ @terrain = Terrain.new width, height, rand(10), color_palette.get('terrain')
35
+ @mouse = Mouse.new event_runner, players, terrain
36
+
37
+ event_runner.subscribe(Events::EntityCreated) { |event| entities << event.entity }
38
+ event_runner.subscribe(Events::GameEnding) { |event| event.time < Time.now ? setup : event_runner.publish(event) }
47
39
  end
48
40
 
49
- def update delta
50
- process_events!
41
+ def update(delta)
42
+ event_runner.process_events!
51
43
 
52
- radius = 50
44
+ radius = 50
53
45
  @entities.each { |entity| entity.update delta }
54
46
  @entities, @dead = *@entities.partition { |entity| terrain.fetch(entity.x, 0) < entity.y }
55
47
  @dead
56
48
  .select { |entity| entity.is_a? Shot }
57
49
  .select { |entity| entity.x < terrain.width && entity.x > 0 }
58
- .each { |entity| terrain.bite entity.x, radius }
59
- .each { |entity| emit Events::EntityCreated.new(Explosion.new entity.x, entity.y) }
50
+ .each { |entity| terrain.bite entity.x, radius }
51
+ .each { |entity| event_runner.publish Events::EntityCreated.new(Explosion.new(entity.x, entity.y)) }
60
52
  .select { |entity| players.any? { |player| inside_radius? entity.x - player.x, 0, radius } }
61
- .each { emit Events::GameEnding.new(Time.now + 1) }
53
+ .each { event_runner.publish Events::GameEnding.new(Time.now + 1) }
62
54
  end
63
55
 
64
- def render graphics
65
- graphics.set_color color_palette.get("sky")
56
+ def render(graphics)
57
+ graphics.set_color color_palette.get('sky')
66
58
  graphics.fill_rect 0, 0, width, height
67
59
 
68
60
  entities.each do |entity|
@@ -78,26 +70,8 @@ module ScorchedEarth
78
70
  terrain.draw graphics
79
71
  end
80
72
 
81
- def emit event
82
- events << event
83
- end
84
-
85
- def on klass, &block
86
- event_listeners << [klass, block]
87
- end
88
-
89
- private
90
-
91
- def process_events!
92
- until events.empty? do
93
- event = events.pop
94
-
95
- event_listeners.each do |klass, block|
96
- if event.is_a? klass
97
- block.call event
98
- end
99
- end
100
- end
73
+ def publish(event)
74
+ event_runner.publish event
101
75
  end
102
76
  end
103
77
  end
@@ -8,16 +8,16 @@ import java.awt.Dimension
8
8
  import javax.swing.JPanel
9
9
  import java.awt.Color
10
10
 
11
- require "scorched_earth/game"
12
- require "scorched_earth/events/mouse_pressed"
13
- require "scorched_earth/events/mouse_released"
14
- require "scorched_earth/events/mouse_moved"
11
+ require 'scorched_earth/game'
12
+ require 'scorched_earth/events/mouse_pressed'
13
+ require 'scorched_earth/events/mouse_released'
14
+ require 'scorched_earth/events/mouse_moved'
15
15
 
16
16
  module ScorchedEarth
17
17
  class GameWindow
18
18
  attr_reader :buffer_strategy, :canvas, :game
19
19
 
20
- def initialize width, height
20
+ def initialize(width, height)
21
21
  @container = JFrame.new
22
22
  @canvas = Canvas.new
23
23
  @panel = @container.get_content_pane
@@ -62,39 +62,39 @@ module ScorchedEarth
62
62
  graphics.dispose
63
63
  buffer_strategy.show
64
64
 
65
- sleep 1.0/60
65
+ sleep 1.0 / 60
66
66
  end
67
67
  end
68
68
 
69
69
  private
70
70
 
71
- def mouse_moved event
71
+ def mouse_moved(event)
72
72
  x = event.point.x
73
73
  y = event.point.y
74
74
 
75
- Events::MouseMoved.new x, y
75
+ game.publish Events::MouseMoved.new x, y
76
76
  end
77
77
 
78
- def mouse_dragged *args; end
78
+ def mouse_dragged(*args); end
79
79
 
80
- def mouse_pressed event
80
+ def mouse_pressed(event)
81
81
  x = event.point.x
82
82
  y = event.point.y
83
83
 
84
- game.emit Events::MousePressed.new x, y
84
+ game.publish Events::MousePressed.new x, y
85
85
  end
86
86
 
87
- def mouse_released event
87
+ def mouse_released(event)
88
88
  x = event.point.x
89
89
  y = event.point.y
90
90
 
91
- game.emit Events::MouseReleased.new x, y
91
+ game.publish Events::MouseReleased.new x, y
92
92
  end
93
93
 
94
- def mouse_clicked *args; end
94
+ def mouse_clicked(*args); end
95
95
 
96
- def mouse_entered *args; end
96
+ def mouse_entered(*args); end
97
97
 
98
- def mouse_exited *args; end
98
+ def mouse_exited(*args); end
99
99
  end
100
100
  end
@@ -38,7 +38,7 @@ module ScorchedEarth
38
38
  end
39
39
 
40
40
  def inside_radius?(x, y, radius)
41
- x ** 2 + y ** 2 < radius ** 2
41
+ x**2 + y**2 < radius**2
42
42
  end
43
43
 
44
44
  module_function :angle, :circle, :inside_radius?, :radians_to_degrees, :degrees_to_radians, :normalize_degrees, :offset_x, :offset_y
@@ -1,28 +1,22 @@
1
- require "scorched_earth/helpers"
2
- require "scorched_earth/events/mouse_pressed"
3
- require "scorched_earth/events/mouse_released"
4
- require "scorched_earth/events/mouse_moved"
1
+ require 'scorched_earth/helpers'
2
+ require 'scorched_earth/events/mouse_pressed'
3
+ require 'scorched_earth/events/mouse_released'
4
+ require 'scorched_earth/events/mouse_moved'
5
5
 
6
6
  module ScorchedEarth
7
7
  class Mouse
8
8
  include Helpers
9
9
 
10
- attr_reader :game, :mouse_pressed_at, :x, :y
10
+ attr_reader :event_runner, :players, :terrain, :mouse_pressed_at, :x, :y
11
11
 
12
- def initialize game
13
- @game = game
12
+ def initialize(event_runner, players, terrain)
13
+ @event_runner = event_runner
14
+ @players = players
15
+ @terrain = terrain
14
16
 
15
- game.on Events::MousePressed, &method(:mouse_pressed)
16
- game.on Events::MouseReleased, &method(:mouse_released)
17
- game.on Events::MouseMoved, &method(:mouse_moved)
18
- end
19
-
20
- def terrain
21
- game.terrain
22
- end
23
-
24
- def players
25
- game.players
17
+ event_runner.subscribe Events::MousePressed, &method(:mouse_pressed)
18
+ event_runner.subscribe Events::MouseReleased, &method(:mouse_released)
19
+ event_runner.subscribe Events::MouseMoved, &method(:mouse_moved)
26
20
  end
27
21
 
28
22
  def current_player
@@ -33,40 +27,45 @@ module ScorchedEarth
33
27
  players.rotate!
34
28
  end
35
29
 
36
- def mouse_released event
30
+ def mouse_released(event)
37
31
  return unless mouse_pressed_at
38
32
 
39
- delta = (Time.now - mouse_pressed_at) * 1000 + 1000
40
- x1, y1 = event.x, event.y
41
- x2, y2 = current_player.x, height - terrain[current_player.x]
42
- degrees = angle(y2 - y1, x2 - x1) + 180
43
- velocity_x = offset_x(degrees, delta)
44
- velocity_y = offset_y(degrees, delta)
45
- shot = Shot.new current_player.x, terrain[current_player.x], velocity_x, velocity_y, Color.white
33
+ delta = (Time.now - mouse_pressed_at) * 1000 + 1000
34
+ x1 = event.x
35
+ y1 = event.y
36
+ x2 = current_player.x
37
+ y2 = height - terrain[current_player.x]
38
+ degrees = angle(y2 - y1, x2 - x1) + 180
39
+ velocity_x = offset_x(degrees, delta)
40
+ velocity_y = offset_y(degrees, delta)
41
+ shot = Shot.new current_player.x, terrain[current_player.x], velocity_x, velocity_y, Color.white
46
42
 
47
- game.emit Events::EntityCreated.new shot
43
+ event_runner.publish Events::EntityCreated.new shot
48
44
 
49
45
  next_player
50
46
  end
51
47
 
52
- def mouse_pressed event
48
+ def mouse_pressed(_event)
53
49
  @mouse_pressed_at = Time.now
54
50
  end
55
51
 
56
- def mouse_moved event
57
- @x, @y = event.x, event.y
52
+ def mouse_moved(event)
53
+ @x = event.x
54
+ @y = event.y
58
55
  end
59
56
 
60
57
  def height
61
- game.height
58
+ terrain.height
62
59
  end
63
60
 
64
61
  def draw(graphics)
65
62
  return unless x && y
66
63
 
67
64
  height = graphics.destination.height
68
- x1, y1 = x, y
69
- x2, y2 = current_player.x, height - terrain[current_player.x]
65
+ x1 = x
66
+ y1 = y
67
+ x2 = current_player.x
68
+ y2 = height - terrain[current_player.x]
70
69
 
71
70
  graphics.set_color player.color
72
71
  graphics.draw_line x1, y1, x2, y2
@@ -3,7 +3,8 @@ module ScorchedEarth
3
3
  attr_reader :x, :color
4
4
 
5
5
  def initialize(x, color)
6
- @x, @color = x, color
6
+ @x = x
7
+ @color = color
7
8
  end
8
9
 
9
10
  def draw(graphics, y)
@@ -1,4 +1,4 @@
1
- require "scorched_earth/helpers"
1
+ require 'scorched_earth/helpers'
2
2
 
3
3
  module ScorchedEarth
4
4
  class Shot
@@ -6,21 +6,27 @@ module ScorchedEarth
6
6
 
7
7
  attr_reader :x, :y, :velocity_x, :velocity_y, :color
8
8
 
9
- def initialize x, y, velocity_x, velocity_y, color
10
- @x, @y, @velocity_x, @velocity_y, @color = x, y, velocity_x, velocity_y, color
9
+ def initialize(x, y, velocity_x, velocity_y, color)
10
+ @x = x
11
+ @y = y
12
+ @velocity_x = velocity_x
13
+ @velocity_y = velocity_y
14
+ @color = color
11
15
  end
12
16
 
13
- def update delta
17
+ def update(delta)
14
18
  @velocity_y -= gravity * delta
15
19
  @x += velocity_x * delta
16
20
  @y += velocity_y * delta
17
21
  end
18
22
 
19
- def draw graphics
23
+ def draw(graphics)
20
24
  height = graphics.destination.height
21
25
  degrees = angle(velocity_y, velocity_x)
22
- x1, y1 = x, height - y
23
- x2, y2 = x1 + offset_x(degrees, length), y1 + offset_y(degrees, length)
26
+ x1 = x
27
+ y1 = height - y
28
+ x2 = x1 + offset_x(degrees, length)
29
+ y2 = y1 + offset_y(degrees, length)
24
30
 
25
31
  graphics.set_color color
26
32
  graphics.draw_line x1, y1, x2, y2
@@ -1,4 +1,4 @@
1
- require "scorched_earth/helpers"
1
+ require 'scorched_earth/helpers'
2
2
 
3
3
  include Java
4
4
 
@@ -11,7 +11,8 @@ module ScorchedEarth
11
11
  attr_reader :color, :height
12
12
 
13
13
  def initialize(width, height, cycles, color)
14
- @color, @height = color, height
14
+ @color = color
15
+ @height = height
15
16
 
16
17
  super(width) do |index|
17
18
  Math.sin(index.to_f / width * cycles) * height / 4 + (height / 4)
@@ -23,25 +24,25 @@ module ScorchedEarth
23
24
  end
24
25
 
25
26
  def draw(graphics)
26
- cached_image = cache do
27
- image = graphics.get_device_configuration.create_compatible_image width, height, Transparency.TRANSLUCENT
28
-
29
- each_with_index do |y, x|
30
- image.graphics.tap do |graphics|
31
- graphics.set_color color
32
- graphics.draw_line x, height - y, x, height
33
- end
34
- end
27
+ graphics.draw_image cache { _draw(graphics) }, 0, 0, nil
28
+ end
29
+
30
+ def _draw(graphics)
31
+ image = graphics
32
+ .get_device_configuration
33
+ .create_compatible_image width, height, Transparency::TRANSLUCENT
35
34
 
36
- image
35
+ each_with_index do |y, x|
36
+ image.graphics.tap do |image_graphics|
37
+ image_graphics.set_color color
38
+ image_graphics.draw_line x, height - y, x, height
39
+ end
37
40
  end
38
41
 
39
- graphics.draw_image cached_image, 0, 0, nil
42
+ image
40
43
  end
41
44
 
42
- def bite(center_x, radius)
43
- center_y = self[center_x]
44
-
45
+ def bite(center_x, radius, center_y = self[center_x])
45
46
  circle(radius) do |offset_x, offset_y|
46
47
  x = center_x + offset_x
47
48
  y = self[x]
@@ -1,3 +1,3 @@
1
1
  module ScorchedEarth
2
- VERSION = "5.0.0.pre"
2
+ VERSION = '5.0.1.pre'.freeze
3
3
  end
@@ -4,24 +4,24 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'scorched_earth/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "scorched_earth"
7
+ spec.name = 'scorched_earth'
8
8
  spec.version = ScorchedEarth::VERSION
9
- spec.authors = ["James Moriarty"]
10
- spec.email = ["jamespaulmoriarty@gmail.com"]
9
+ spec.authors = ['James Moriarty']
10
+ spec.email = ['jamespaulmoriarty@gmail.com']
11
11
 
12
- spec.summary = %q{A simple clone of the classic game ScorchedEarth Earth.}
13
- spec.homepage = "https://github.com/jamesmoriarty/scorched-earth"
14
- spec.license = "MIT"
15
- spec.platform = "java"
12
+ spec.summary = 'A simple clone of the classic game ScorchedEarth Earth.'
13
+ spec.homepage = 'https://github.com/jamesmoriarty/scorched-earth'
14
+ spec.license = 'MIT'
15
+ spec.platform = 'java'
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
- spec.bindir = "exe"
18
+ spec.bindir = 'exe'
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
- spec.require_paths = ["lib"]
20
+ spec.require_paths = ['lib']
21
21
 
22
- spec.add_development_dependency "pry"
23
- spec.add_development_dependency "bundler", "~> 1.12"
24
- spec.add_development_dependency "rake", "~> 10.0"
25
- spec.add_development_dependency "minitest", "~> 5.0"
26
- spec.add_development_dependency "simplecov"
22
+ spec.add_development_dependency 'pry'
23
+ spec.add_development_dependency 'bundler', '~> 1.12'
24
+ spec.add_development_dependency 'rake', '~> 10.0'
25
+ spec.add_development_dependency 'minitest', '~> 5.0'
26
+ spec.add_development_dependency 'simplecov'
27
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scorched_earth
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0.pre
4
+ version: 5.0.1.pre
5
5
  platform: java
6
6
  authors:
7
7
  - James Moriarty
@@ -89,6 +89,7 @@ extensions: []
89
89
  extra_rdoc_files: []
90
90
  files:
91
91
  - .gitignore
92
+ - .rubocop.yml
92
93
  - .travis.yml
93
94
  - Gemfile
94
95
  - LICENSE.txt
@@ -99,6 +100,7 @@ files:
99
100
  - exe/scorched
100
101
  - lib/scorched_earth.rb
101
102
  - lib/scorched_earth/color_palette.rb
103
+ - lib/scorched_earth/event_runner.rb
102
104
  - lib/scorched_earth/events/entity_created.rb
103
105
  - lib/scorched_earth/events/game_ending.rb
104
106
  - lib/scorched_earth/events/mouse_moved.rb