joyce 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c5093b30bd0defdbf53c6453b0d650f0f97c96c
4
- data.tar.gz: a71c98b65b59eeba9c05f451580a97fca09e998d
3
+ metadata.gz: 9f3f7e98db904127cefcca9ec0707630dc98e623
4
+ data.tar.gz: 57f1d846912a6954e4676d057036b098dcdd9308
5
5
  SHA512:
6
- metadata.gz: ab1ed1b2dcbc30c2418be1afe99810d6e31db40e924c3cda8ad1a3b3831093fac5b3b65edaa4ce2aa51f5df8bfefb967a510d12c5feca326c354be8bd741c912
7
- data.tar.gz: 59171c9b077b3b23578832f43ca26f5ff51758067fbf1e58368767c50533b038c93f2ce868b21a3ea6b495af07d42ae84cce5d74c05720d7ddf50ef443f98ff6
6
+ metadata.gz: bed3d1ef1be0507643775a96251b7a6b59328165ba97f6d470ef693dbb062e281d0a75ce53861e6ea25143d87d4cb5ad8cbe65d724f274425c53b17ac3b44737
7
+ data.tar.gz: b42084dee6ea088c408d52eacb3a91de3e42bfd45d3cbeb15a9d9e30c491a0e60be07b8a955e9c4bd110321ae8dd0a23fd3fa839fe5dc39bd3d6482fcfc25763
@@ -31,7 +31,7 @@ module Joyce
31
31
  end
32
32
 
33
33
  def font
34
- @font ||= Gosu::Font.new(24)
34
+ @font ||= Gosu::Font.new(20)
35
35
  end
36
36
 
37
37
  def mouse_position
@@ -59,6 +59,12 @@ module Joyce
59
59
  app.tick
60
60
  end
61
61
 
62
+ def button_down(id)
63
+ if id == Gosu::MsLeft then
64
+ app.click
65
+ end
66
+ end
67
+
62
68
  def mouse_position
63
69
  [ mouse_x, mouse_y ]
64
70
  end
@@ -1,5 +1,8 @@
1
1
  module Joyce
2
2
  class Application
3
+ DEFAULT_WIDTH = 800
4
+ DEFAULT_HEIGHT = 600
5
+
3
6
  def initialize(headless: false)
4
7
  @headless = headless
5
8
  end
@@ -12,6 +15,10 @@ module Joyce
12
15
  # ...
13
16
  end
14
17
 
18
+ def click
19
+ # ...
20
+ end
21
+
15
22
  def launch
16
23
  sim.conduct!
17
24
  setup
@@ -36,7 +43,15 @@ module Joyce
36
43
  end
37
44
 
38
45
  def window
39
- @window ||= @headless ? NullWindow.new(self) : ApplicationWindow.new(self)
46
+ @window ||= @headless ? NullWindow.new(self) : ApplicationWindow.new(self, width: width, height: height)
47
+ end
48
+
49
+ def width
50
+ DEFAULT_WIDTH
51
+ end
52
+
53
+ def height
54
+ DEFAULT_HEIGHT
40
55
  end
41
56
 
42
57
  private
@@ -1,4 +1,4 @@
1
1
  module Joyce
2
2
  # joyce version
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: joyce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Weissman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-18 00:00:00.000000000 Z
11
+ date: 2016-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gosu