ehb_game_lib 0.0.5 → 0.0.6

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
- SHA1:
3
- metadata.gz: e2dd328f0f04eb106f0d5583057e3327c7e2ed15
4
- data.tar.gz: 635f13624ba391b24b80a9403ae987db25d53d80
2
+ SHA256:
3
+ metadata.gz: d643f13e6d8b07eaa4619f06e90dc4560ad05cecb7fa87bda94d1ddb929ac608
4
+ data.tar.gz: fecab868437c73851309abed83e4baa9090c6b8e460c9e96e9e3722af0c690aa
5
5
  SHA512:
6
- metadata.gz: 95094355b73f2229f9c976314f12b2ae364f9640e05e32e289bf05731b2bd736382ed508af0876be125d9953dc4eead42e4b3ffda5f2ea503474a682e536334c
7
- data.tar.gz: 763dd1a5d99ee835996d3faf697c7668c0bb95fbf6b612794116aa7e0dd5673a0f1907ac44fdb2ca0222896ac130a3a3f36ee88b7745ece671c1f4091ea21d13
6
+ metadata.gz: 2860f3c38dbce468873ea6c2802c4175c69af94f245c5a3c151ca52863e7f5320cb5c1bed61a94c5a0a7a6d5dc8031e3ba034a1a2fe6c50b8f7bfe86aecdb52e
7
+ data.tar.gz: 03e53f34ec987f63960fc5e046d364603df4c3ccaec23482ac1e5aaebaa9db3e4c09214c44a9e96262a10a06fdf982a2b7bf5d6fd9a9953f644c8c44390bc4ae
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_support'
2
4
  require 'active_support/core_ext'
3
5
  require 'chingu'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EhbGameLib
2
4
  class Gfx
3
5
  class << self
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EhbGameLib
2
4
  # No-global variables bridge to Chingu global variables.
3
5
  class Globals
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EhbGameLib
2
4
  module Math
3
5
  class Circle
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EhbGameLib
2
4
  module Math
3
5
  module Intersection
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EhbGameLib
2
4
  module Math
3
5
  module Intersection
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EhbGameLib
2
4
  module Math
3
5
  class Line
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EhbGameLib
2
4
  module Math
3
5
  class LineSegment
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EhbGameLib
2
4
  module Math
3
5
  class QuadraticEquation
@@ -12,6 +14,7 @@ module EhbGameLib
12
14
  def roots
13
15
  return [root(1), root(-1)] if delta > 0.0
14
16
  return [root(1)] if delta == 0.0
17
+
15
18
  []
16
19
  end
17
20
 
@@ -20,7 +23,7 @@ module EhbGameLib
20
23
  end
21
24
 
22
25
  def root(signal)
23
- signal = signal < 0 ? -1 : 1
26
+ signal = signal.negative? ? -1 : 1
24
27
  (-b + signal * ::Math.sqrt(delta)) / (2 * a)
25
28
  end
26
29
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EhbGameLib
2
4
  module Math
3
5
  module RectableObject
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EhbGameLib
2
4
  module Math
3
5
  class Vector
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EhbGameLib
2
4
  module Nes
3
5
  class AllColorsPalette
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EhbGameLib
2
4
  module Nes
3
5
  class Color
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EhbGameLib
2
4
  module Nes
3
5
  class Palette
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EhbGameLib
2
4
  module Patches
3
5
  module Chingu
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EhbGameLib
2
4
  module Patches
3
5
  module Gosu
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EhbGameLib
2
4
  module Traits
3
5
  # Interface required:
@@ -5,10 +7,12 @@ module EhbGameLib
5
7
  module BoundingLineSegment
6
8
  def nearest_circle_collision(klasses)
7
9
  return [nil, nil] unless line_segment?
10
+
8
11
  min_obj = min_p = min_dist = nil
9
12
  each_circle_collision(klasses) do |object, p|
10
13
  dist = Gosu.distance(last_x, last_y, p.x, p.y)
11
14
  next unless min_dist.nil? || dist < min_dist
15
+
12
16
  min_dist = dist
13
17
  min_obj = object
14
18
  min_p = p
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EhbGameLib
2
4
  module Utils
3
5
  class Cursor
@@ -38,7 +40,7 @@ module EhbGameLib
38
40
  @index = 0
39
41
  elsif @index >= @set.count
40
42
  @index = @set.count - 1
41
- elsif @index < 0
43
+ elsif @index.negative?
42
44
  @index = 0
43
45
  end
44
46
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EhbGameLib
2
- VERSION = '0.0.5'.freeze
4
+ VERSION = '0.0.6'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'test_helper'
2
4
 
3
5
  module EhbGameLib
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'test_helper'
2
4
 
3
5
  module EhbGameLib
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'test_helper'
2
4
 
3
5
  module EhbGameLib
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'test_helper'
2
4
 
3
5
  module EhbGameLib
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'test_helper'
2
4
 
3
5
  module EhbGameLib
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'test_helper'
2
4
 
3
5
  module EhbGameLib
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'test_helper'
2
4
 
3
5
  module EhbGameLib
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'ehb_game_lib'
2
4
  require 'test/unit'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ehb_game_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo H. Bogoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-27 00:00:00.000000000 Z
11
+ date: 2020-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: rubocop
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '='
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.42.0
75
+ version: 0.79.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '='
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.42.0
82
+ version: 0.79.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: test-unit
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  version: '0'
148
148
  requirements: []
149
149
  rubyforge_project:
150
- rubygems_version: 2.6.14
150
+ rubygems_version: 2.7.7
151
151
  signing_key:
152
152
  specification_version: 4
153
153
  summary: EHB's game library for Ruby