cyberarm_engine 0.10.1 → 0.10.2

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
  SHA256:
3
- metadata.gz: 3ec219cb96ebc60b0d56ff7d7bdce4905acdf1add506e4364c2ebb4c0489533f
4
- data.tar.gz: 4a989ce45d26a5a76c4d76a330dc42bb594956f0edf051bff39667087a2a85ef
3
+ metadata.gz: 48b0f91fa28c566c872aa5fba6fcc3e34d68a1e6df80eb33ec9ae1d229780c91
4
+ data.tar.gz: df059b7335fac48a38654ab85d271b096d010e2f6f0e6cb64a96d8b086883799
5
5
  SHA512:
6
- metadata.gz: 250d4e9c70bd1132a087d778e9b6ef136e101f168bef9b7297e308169f89b26adbd59670fe0f6e11ce2842e9fde52683d2078dc2509f573ccc31dc271109b0f8
7
- data.tar.gz: f7e0b9756864eba037c0a04bbbb504dcccfcd851bd648f86bd6558210292d27867190be7c57d941bbaf55003d5ea9c144c8ed1b680aeda7672ae9ffb5bab4b5e
6
+ metadata.gz: '090c7d78a563a9d4c12ec886c6a42ecdef0feab89d98f5a395bdd7b03e9de0f837725e25aeeba03ff754194ed422bef1b732e391e6961d571e2688e035dbdabc'
7
+ data.tar.gz: 845517dfb3f09c58b4787c3b71a901f95382cccf71c68fc59e7434f4a8e9430b61513413886fc98c9379a6170d66e577deaa5196cc67355a2495f732bd2ea295
@@ -5,7 +5,7 @@ module CyberarmEngine
5
5
  SONGS = {}
6
6
 
7
7
  attr_accessor :show_cursor
8
- attr_reader :current_state, :last_frame_time
8
+ attr_reader :last_frame_time
9
9
 
10
10
  def self.now
11
11
  Gosu.milliseconds
@@ -3,7 +3,8 @@ module CyberarmEngine
3
3
  include Common
4
4
 
5
5
  attr_accessor :image, :angle, :position, :velocity, :center_x, :center_y, :scale_x, :scale_y,
6
- :color, :alpha, :mode, :options, :paused, :radius, :last_position
6
+ :color, :mode, :options, :paused, :radius, :last_position
7
+ attr_reader :alpha
7
8
  def initialize(options={})
8
9
  if options[:auto_manage] || options[:auto_manage] == nil
9
10
  $window.current_state.add_game_object(self)
@@ -141,7 +142,7 @@ module CyberarmEngine
141
142
  self.angle%=360
142
143
  end
143
144
 
144
- def alpha=int # 0-255
145
+ def alpha=(int) # 0-255
145
146
  @alpha = int
146
147
  @alpha = 255 if @alpha > 255
147
148
  @color = Gosu::Color.rgba(@color.red, @color.green, @color.blue, int)
@@ -49,11 +49,17 @@ module CyberarmEngine
49
49
  return temp
50
50
  end
51
51
 
52
- # returns whether both bounding boxes intersect
52
+ # returns whether bounding box intersects other
53
53
  def intersect?(other)
54
- (@min.x <= other.max.x && @max.x >= other.min.x) &&
55
- (@min.y <= other.max.y && @max.y >= other.min.y) &&
56
- (@min.z <= other.max.z && @max.z >= other.min.z)
54
+ if other.is_a?(Ray)
55
+ other.intersect?(self)
56
+ elsif other.is_a?(BoundingBox)
57
+ (@min.x <= other.max.x && @max.x >= other.min.x) &&
58
+ (@min.y <= other.max.y && @max.y >= other.min.y) &&
59
+ (@min.z <= other.max.z && @max.z >= other.min.z)
60
+ else
61
+ raise "Unknown collider: #{other.class}"
62
+ end
57
63
  end
58
64
 
59
65
  # does this bounding box envelop other bounding box? (inclusive of border)
@@ -21,6 +21,10 @@ module CyberarmEngine
21
21
  @@shaders.dig(name).is_a?(Shader)
22
22
  end
23
23
 
24
+ def self.get(name)
25
+ @@shaders.dig(name)
26
+ end
27
+
24
28
  def self.active_shader
25
29
  @active_shader
26
30
  end
@@ -1,4 +1,4 @@
1
1
  module CyberarmEngine
2
2
  NAME = "InDev"
3
- VERSION = "0.10.1"
3
+ VERSION = "0.10.2"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cyberarm_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyberarm
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-10 00:00:00.000000000 Z
11
+ date: 2019-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gosu