redmocha 0.3.8-java → 0.3.9-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/redmocha.rb +12 -14
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 85dc21e547207e63e498a5e8d68857d8e44bbbc9
4
- data.tar.gz: ca893e9a00d2451163cfb0fce8ee5a0e3356754d
3
+ metadata.gz: 1a99d950a1fc9a86624a133f444633d92a950529
4
+ data.tar.gz: bb8ce5a42f6de175bc6f8fdffa90ebb9fe1e8cac
5
5
  SHA512:
6
- metadata.gz: ada429cf2b0140c0e90ab5e80cd6aaa0b239ded9cc135d55f580fff436cc617cbef287d72709db005b98d6656182320a7d17736cad66c3b02029da88f54df415
7
- data.tar.gz: aab562f4f33ebeb106c4559363bfd6d26d6383091cc31ab1a295a88a2e691f1c0e65dc7e5acaca6a8d9d5e541a5c5f0ab2b0144a11e518b96c5e16e341773571
6
+ metadata.gz: 99032598bf0742adbf24d5dcddedb513533d87d0a4532d65187e8c57b93f64253e3a76a292bd32ae797ddfddc3a87b961fd12e14ae646a5c2370bbe1e2226ee4
7
+ data.tar.gz: bbfb7b78352f92c9f37c1d46c87422fb12882aced6f44909157b64e92d3a62c823eaf438c03d4388097ed97e7161227d83eb8da8d8802365cdbe4760b44a9e8f
data/lib/redmocha.rb CHANGED
@@ -29,36 +29,34 @@ end
29
29
  class RMGame
30
30
  include com.badlogic.gdx.ApplicationListener
31
31
  attr_reader :batch, :font, :shape, :config
32
+ attr_writer :shape_type
32
33
 
33
34
  # When Application is first created
34
35
  def create
35
36
  @batch = com.badlogic.gdx.graphics.g2d.SpriteBatch.new
36
37
  @font = com.badlogic.gdx.graphics.g2d.BitmapFont.new
38
+ @shape = com.badlogic.gdx.graphics.glutils.ShapeRenderer.new
37
39
  end
38
40
 
39
41
  # Everytime Appication renders itself
40
42
  def render
41
43
  update
42
44
  @batch.begin
43
- @shape.begin unless @shape.nil?
45
+ case @shape_type
46
+ when :filled
47
+ @shape.begin(com.badlogic.gdx.graphics.glutils.ShapeRenderer::ShapeType::Filled)
48
+ when :point
49
+ @shape.begin(com.badlogic.gdx.graphics.glutils.ShapeRenderer::ShapeType::Point)
50
+ when :line
51
+ @shape.begin(com.badlogic.gdx.graphics.glutils.ShapeRenderer::ShapeType::Line)
52
+ else
53
+ @shape.begin(com.badlogic.gdx.graphics.glutils.ShapeRenderer::ShapeType::Filled)
54
+ end
44
55
  display
45
56
  @shape.end unless @shape.nil?
46
57
  @batch.end
47
58
  end
48
59
 
49
- # Enable ShapeRenderer
50
- def enable_shape_drawer
51
- @shape = com.badlogic.gdx.graphics.glutils.ShapeRenderer.new if @shape.nil?
52
- end
53
-
54
- # Disable ShapeRenderer
55
- def disable_shape_drawer
56
- unless @shape.nil?
57
- @shape.dispose
58
- @shape = nil
59
- end
60
- end
61
-
62
60
  # Get rid of resources used by Application
63
61
  def dispose
64
62
  @shape.dispose unless @shape.nil?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmocha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  platform: java
6
6
  authors:
7
7
  - Julio Berina