gamebox 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +3 -2
  3. data/gamebox.gemspec +1 -1
  4. data/lib/gamebox/actors/collidable_debugger.rb +3 -4
  5. data/lib/gamebox/actors/label.rb +2 -0
  6. data/lib/gamebox/actors/score.rb +4 -25
  7. data/lib/gamebox/behaviors/animated_with_spritemap.rb +97 -0
  8. data/lib/gamebox/behaviors/collidable.rb +6 -14
  9. data/lib/gamebox/behaviors/collidable/aabb_collidable.rb +2 -3
  10. data/lib/gamebox/behaviors/graphical.rb +2 -1
  11. data/lib/gamebox/behaviors/physical.rb +1 -1
  12. data/lib/gamebox/behaviors/positioned.rb +10 -4
  13. data/lib/gamebox/core/actor.rb +1 -1
  14. data/lib/gamebox/core/actor_factory.rb +2 -0
  15. data/lib/gamebox/core/arbiter.rb +2 -0
  16. data/lib/gamebox/core/font_style.rb +2 -2
  17. data/lib/gamebox/core/input_mapper.rb +4 -4
  18. data/lib/gamebox/core/resource_manager.rb +2 -2
  19. data/lib/gamebox/core/viewport.rb +78 -54
  20. data/lib/gamebox/spec/helper.rb +2 -3
  21. data/lib/gamebox/tasks/gamebox_tasks.rake +1 -90
  22. data/lib/gamebox/version.rb +2 -2
  23. data/lib/gamebox/views/graphical_actor_view.rb +11 -6
  24. data/spec/acceptance/input_mapper_spec.rb +14 -14
  25. data/spec/actors/label_spec.rb +13 -4
  26. data/spec/behaviors/collidable_spec.rb +2 -2
  27. data/spec/behaviors/positioned_spec.rb +27 -30
  28. data/spec/core/actor_spec.rb +2 -2
  29. data/spec/core/input_mapper_spec.rb +1 -1
  30. data/spec/core/resource_manager_spec.rb +20 -4
  31. data/spec/core/viewport_spec.rb +202 -108
  32. data/spec/views/graphical_actor_view_spec.rb +4 -1
  33. data/templates/app/Gemfile.tt +3 -1
  34. data/templates/app/Rakefile +51 -0
  35. data/templates/app/config/environment.rb +2 -1
  36. data/templates/app/config/game.yml +0 -1
  37. data/templates/app/spec/helper.rb +1 -1
  38. data/templates/app/src/views/.gitkeep +0 -0
  39. metadata +51 -97
@@ -34,6 +34,9 @@ describe :graphical_actor_view do
34
34
 
35
35
  it 'creates the color with the correct alpha' do
36
36
  image.stubs(draw: nil)
37
+ image.expects(:draw_rot).with(anything, anything, anything,
38
+ anything, anything, anything, anything, anything,
39
+ :full_color)
37
40
  Color.expects(:new).with(0xFF, 0xFF, 0xFF, 0xFF).returns(:full_color)
38
41
  subject.draw(:target, 0, 0, 0)
39
42
  end
@@ -45,7 +48,7 @@ describe :graphical_actor_view do
45
48
  end
46
49
 
47
50
  it 'handles draw correctly for plain actors w/o rotation' do
48
- image.expects(:draw).with(2, 3, 1, 1, 1, :color)
51
+ image.expects(:draw_rot).with(anything,anything,anything, 0, anything, anything, anything, anything, anything)
49
52
  subject.draw(:target, 0, 0, 1)
50
53
  end
51
54
 
@@ -1,7 +1,9 @@
1
- source "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
  # uncomment for chipmunk
3
3
  # gem 'chipmunk'
4
4
  gem 'require_all'
5
5
  gem "gamebox", '<%= @gamebox_version %>'
6
6
  gem "conject"
7
7
  gem "rspec"
8
+ gem "releasy"
9
+ gem "rake"
@@ -14,3 +14,54 @@ STATS_DIRECTORIES = [
14
14
  %w(Libraries lib/),
15
15
  ].collect { |name, dir| [ name, "#{APP_ROOT}/#{dir}" ] }.select { |name, dir| File.directory?(dir) }
16
16
 
17
+
18
+ # more info on releasy here: https://github.com/Spooner/releasy
19
+ Releasy::Builders::OsxApp::SOURCE_GEMS_TO_REMOVE.concat %w(chingu chingu.rb chipmunk.bundle chipmunk.rb)
20
+
21
+ Releasy::Project.new do
22
+ name Gamebox.configuration.game_name.gsub(' ','')
23
+ version "0.0.1"
24
+
25
+ executable "src/app.rb"
26
+ files ["config/**/*.*", "src/**/*.rb", "data/**/*.*"]
27
+ exclude_encoding # Applications that don't use advanced encoding (e.g. Japanese characters) can save build size with this.
28
+
29
+ # Create a variety of releases, for all platforms.
30
+ add_build :osx_app do
31
+ url "io.gamebox.my_game"
32
+ gosu_downloads = ENV['GOSU_DOWNLOADS'] || "#{ENV['HOME']}/tmp"
33
+ wrapper "#{gosu_downloads}/gosu-mac-wrapper-0.7.47.tar.gz"
34
+ add_package :tar_gz
35
+ end
36
+
37
+ add_build :source do
38
+ add_package :tar_gz
39
+ end
40
+
41
+ # If building on a Windows machine, :windows_folder and/or :windows_installer are recommended.
42
+ add_build :windows_folder do
43
+ icon "data/icons/seedlife.ico"
44
+ executable_type :windows # Assuming you don't want it to run with a console window.
45
+ add_package :exe # Windows self-extracting archive.
46
+ end
47
+
48
+ # add_build :windows_installer do
49
+ # icon "media/icon.ico"
50
+ # start_menu_group "Spooner Games"
51
+ # readme "README.html" # User asked if they want to view readme after install.
52
+ # license "LICENSE.txt" # User asked to read this and confirm before installing.
53
+ # executable_type :windows # Assuming you don't want it to run with a console window.
54
+ # add_package :zip
55
+ # end
56
+
57
+ # # If unable to build on a Windows machine, :windows_wrapped is the only choice.
58
+ # add_build :windows_wrapped do
59
+ # wrapper "wrappers/ruby-1.9.3-p0-i386-mingw32.7z" # Assuming this is where you downloaded this file.
60
+ # executable_type :windows # Assuming you don't want it to run with a console window.
61
+ # exclude_tcl_tk # Assuming application doesn't use Tcl/Tk, then it can save a lot of size by using this.
62
+ # add_package :zip
63
+ # end
64
+
65
+ # add_deploy :local # Only deploy locally.
66
+ end
67
+
@@ -2,6 +2,7 @@ APP_ROOT = "#{File.join(File.dirname(__FILE__),"..")}/"
2
2
 
3
3
  require 'yaml'
4
4
  require 'gamebox'
5
+ require 'releasy'
5
6
 
6
7
  Gamebox.configure do |config|
7
8
  config.config_path = APP_ROOT + "config/"
@@ -25,7 +26,7 @@ end
25
26
  [GAMEBOX_PATH, APP_ROOT, File.join(APP_ROOT,'src')].each{|path| $: << path }
26
27
  require "gamebox_application"
27
28
 
28
- require_all Dir.glob("**/*.rb").reject{ |f| f.match("spec") || f.match("src/app.rb")}
29
+ require_all Dir.glob("{src,lib}/**/*.rb").reject{ |f| f.match("src/app.rb")}
29
30
 
30
31
 
31
32
 
@@ -1,5 +1,4 @@
1
1
  ---
2
- :title: My Gamebox Game!
3
2
  :sound: true
4
3
  :auto_quit: KbEscape
5
4
  :fullscreen: false
@@ -1,4 +1,4 @@
1
1
  $LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__), '..', 'config'))
2
- require 'spec'
2
+ require 'rspec'
3
3
  require 'environment'
4
4
  require 'spec/helper'
File without changes
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gamebox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
5
- prerelease:
4
+ version: 0.5.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Shawn Anderson
@@ -11,326 +10,286 @@ authors:
11
10
  autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2013-07-25 00:00:00.000000000 Z
13
+ date: 2014-02-21 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: gosu
18
17
  requirement: !ruby/object:Gem::Requirement
19
- none: false
20
18
  requirements:
21
- - - ! '>='
19
+ - - ">="
22
20
  - !ruby/object:Gem::Version
23
21
  version: '0'
24
22
  type: :runtime
25
23
  prerelease: false
26
24
  version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
25
  requirements:
29
- - - ! '>='
26
+ - - ">="
30
27
  - !ruby/object:Gem::Version
31
28
  version: '0'
32
29
  - !ruby/object:Gem::Dependency
33
30
  name: publisher
34
31
  requirement: !ruby/object:Gem::Requirement
35
- none: false
36
32
  requirements:
37
- - - ! '>='
33
+ - - ">="
38
34
  - !ruby/object:Gem::Version
39
35
  version: '0'
40
36
  type: :runtime
41
37
  prerelease: false
42
38
  version_requirements: !ruby/object:Gem::Requirement
43
- none: false
44
39
  requirements:
45
- - - ! '>='
40
+ - - ">="
46
41
  - !ruby/object:Gem::Version
47
42
  version: '0'
48
43
  - !ruby/object:Gem::Dependency
49
44
  name: conject
50
45
  requirement: !ruby/object:Gem::Requirement
51
- none: false
52
46
  requirements:
53
- - - ! '>='
47
+ - - ">="
54
48
  - !ruby/object:Gem::Version
55
49
  version: 0.0.8
56
50
  type: :runtime
57
51
  prerelease: false
58
52
  version_requirements: !ruby/object:Gem::Requirement
59
- none: false
60
53
  requirements:
61
- - - ! '>='
54
+ - - ">="
62
55
  - !ruby/object:Gem::Version
63
56
  version: 0.0.8
64
57
  - !ruby/object:Gem::Dependency
65
58
  name: tween
66
59
  requirement: !ruby/object:Gem::Requirement
67
- none: false
68
60
  requirements:
69
- - - ! '>='
61
+ - - ">="
70
62
  - !ruby/object:Gem::Version
71
63
  version: '0'
72
64
  type: :runtime
73
65
  prerelease: false
74
66
  version_requirements: !ruby/object:Gem::Requirement
75
- none: false
76
67
  requirements:
77
- - - ! '>='
68
+ - - ">="
78
69
  - !ruby/object:Gem::Version
79
70
  version: '0'
80
71
  - !ruby/object:Gem::Dependency
81
72
  name: i18n
82
73
  requirement: !ruby/object:Gem::Requirement
83
- none: false
84
74
  requirements:
85
- - - ! '>='
75
+ - - ">="
86
76
  - !ruby/object:Gem::Version
87
77
  version: '0'
88
78
  type: :runtime
89
79
  prerelease: false
90
80
  version_requirements: !ruby/object:Gem::Requirement
91
- none: false
92
81
  requirements:
93
- - - ! '>='
82
+ - - ">="
94
83
  - !ruby/object:Gem::Version
95
84
  version: '0'
96
85
  - !ruby/object:Gem::Dependency
97
86
  name: thor
98
87
  requirement: !ruby/object:Gem::Requirement
99
- none: false
100
88
  requirements:
101
- - - ! '>='
89
+ - - ">="
102
90
  - !ruby/object:Gem::Version
103
91
  version: '0'
104
92
  type: :runtime
105
93
  prerelease: false
106
94
  version_requirements: !ruby/object:Gem::Requirement
107
- none: false
108
95
  requirements:
109
- - - ! '>='
96
+ - - ">="
110
97
  - !ruby/object:Gem::Version
111
98
  version: '0'
112
99
  - !ruby/object:Gem::Dependency
113
100
  name: require_all
114
101
  requirement: !ruby/object:Gem::Requirement
115
- none: false
116
102
  requirements:
117
- - - ! '>='
103
+ - - ">="
118
104
  - !ruby/object:Gem::Version
119
105
  version: '0'
120
106
  type: :runtime
121
107
  prerelease: false
122
108
  version_requirements: !ruby/object:Gem::Requirement
123
- none: false
124
109
  requirements:
125
- - - ! '>='
110
+ - - ">="
126
111
  - !ruby/object:Gem::Version
127
112
  version: '0'
128
113
  - !ruby/object:Gem::Dependency
129
114
  name: kvo
130
115
  requirement: !ruby/object:Gem::Requirement
131
- none: false
132
116
  requirements:
133
- - - ! '>='
117
+ - - ">="
134
118
  - !ruby/object:Gem::Version
135
119
  version: 0.1.0
136
120
  type: :runtime
137
121
  prerelease: false
138
122
  version_requirements: !ruby/object:Gem::Requirement
139
- none: false
140
123
  requirements:
141
- - - ! '>='
124
+ - - ">="
142
125
  - !ruby/object:Gem::Version
143
126
  version: 0.1.0
144
127
  - !ruby/object:Gem::Dependency
145
128
  name: listen
146
129
  requirement: !ruby/object:Gem::Requirement
147
- none: false
148
130
  requirements:
149
- - - ! '>='
131
+ - - ">="
150
132
  - !ruby/object:Gem::Version
151
- version: 0.5.3
133
+ version: 2.4.0
152
134
  type: :runtime
153
135
  prerelease: false
154
136
  version_requirements: !ruby/object:Gem::Requirement
155
- none: false
156
137
  requirements:
157
- - - ! '>='
138
+ - - ">="
158
139
  - !ruby/object:Gem::Version
159
- version: 0.5.3
140
+ version: 2.4.0
160
141
  - !ruby/object:Gem::Dependency
161
142
  name: pry
162
143
  requirement: !ruby/object:Gem::Requirement
163
- none: false
164
144
  requirements:
165
- - - ~>
145
+ - - "~>"
166
146
  - !ruby/object:Gem::Version
167
147
  version: 0.9.7
168
148
  type: :development
169
149
  prerelease: false
170
150
  version_requirements: !ruby/object:Gem::Requirement
171
- none: false
172
151
  requirements:
173
- - - ~>
152
+ - - "~>"
174
153
  - !ruby/object:Gem::Version
175
154
  version: 0.9.7
176
155
  - !ruby/object:Gem::Dependency
177
156
  name: pry-remote
178
157
  requirement: !ruby/object:Gem::Requirement
179
- none: false
180
158
  requirements:
181
- - - ! '>='
159
+ - - ">="
182
160
  - !ruby/object:Gem::Version
183
161
  version: '0'
184
162
  type: :development
185
163
  prerelease: false
186
164
  version_requirements: !ruby/object:Gem::Requirement
187
- none: false
188
165
  requirements:
189
- - - ! '>='
166
+ - - ">="
190
167
  - !ruby/object:Gem::Version
191
168
  version: '0'
192
169
  - !ruby/object:Gem::Dependency
193
170
  name: rspec-core
194
171
  requirement: !ruby/object:Gem::Requirement
195
- none: false
196
172
  requirements:
197
- - - ! '>='
173
+ - - ">="
198
174
  - !ruby/object:Gem::Version
199
175
  version: '0'
200
176
  type: :development
201
177
  prerelease: false
202
178
  version_requirements: !ruby/object:Gem::Requirement
203
- none: false
204
179
  requirements:
205
- - - ! '>='
180
+ - - ">="
206
181
  - !ruby/object:Gem::Version
207
182
  version: '0'
208
183
  - !ruby/object:Gem::Dependency
209
184
  name: rspec-mocks
210
185
  requirement: !ruby/object:Gem::Requirement
211
- none: false
212
186
  requirements:
213
- - - ! '>='
187
+ - - ">="
214
188
  - !ruby/object:Gem::Version
215
189
  version: '0'
216
190
  type: :development
217
191
  prerelease: false
218
192
  version_requirements: !ruby/object:Gem::Requirement
219
- none: false
220
193
  requirements:
221
- - - ! '>='
194
+ - - ">="
222
195
  - !ruby/object:Gem::Version
223
196
  version: '0'
224
197
  - !ruby/object:Gem::Dependency
225
198
  name: rspec-expectations
226
199
  requirement: !ruby/object:Gem::Requirement
227
- none: false
228
200
  requirements:
229
- - - ! '>='
201
+ - - ">="
230
202
  - !ruby/object:Gem::Version
231
203
  version: '0'
232
204
  type: :development
233
205
  prerelease: false
234
206
  version_requirements: !ruby/object:Gem::Requirement
235
- none: false
236
207
  requirements:
237
- - - ! '>='
208
+ - - ">="
238
209
  - !ruby/object:Gem::Version
239
210
  version: '0'
240
211
  - !ruby/object:Gem::Dependency
241
212
  name: mocha
242
213
  requirement: !ruby/object:Gem::Requirement
243
- none: false
244
214
  requirements:
245
- - - ! '>='
215
+ - - ">="
246
216
  - !ruby/object:Gem::Version
247
217
  version: '0'
248
218
  type: :development
249
219
  prerelease: false
250
220
  version_requirements: !ruby/object:Gem::Requirement
251
- none: false
252
221
  requirements:
253
- - - ! '>='
222
+ - - ">="
254
223
  - !ruby/object:Gem::Version
255
224
  version: '0'
256
225
  - !ruby/object:Gem::Dependency
257
226
  name: rspec
258
227
  requirement: !ruby/object:Gem::Requirement
259
- none: false
260
228
  requirements:
261
- - - ! '>='
229
+ - - ">="
262
230
  - !ruby/object:Gem::Version
263
231
  version: '0'
264
232
  type: :development
265
233
  prerelease: false
266
234
  version_requirements: !ruby/object:Gem::Requirement
267
- none: false
268
235
  requirements:
269
- - - ! '>='
236
+ - - ">="
270
237
  - !ruby/object:Gem::Version
271
238
  version: '0'
272
239
  - !ruby/object:Gem::Dependency
273
240
  name: rake
274
241
  requirement: !ruby/object:Gem::Requirement
275
- none: false
276
242
  requirements:
277
- - - ! '>='
243
+ - - ">="
278
244
  - !ruby/object:Gem::Version
279
245
  version: '0'
280
246
  type: :development
281
247
  prerelease: false
282
248
  version_requirements: !ruby/object:Gem::Requirement
283
- none: false
284
249
  requirements:
285
- - - ! '>='
250
+ - - ">="
286
251
  - !ruby/object:Gem::Version
287
252
  version: '0'
288
253
  - !ruby/object:Gem::Dependency
289
254
  name: polaris
290
255
  requirement: !ruby/object:Gem::Requirement
291
- none: false
292
256
  requirements:
293
- - - ! '>='
257
+ - - ">="
294
258
  - !ruby/object:Gem::Version
295
259
  version: '0'
296
260
  type: :development
297
261
  prerelease: false
298
262
  version_requirements: !ruby/object:Gem::Requirement
299
- none: false
300
263
  requirements:
301
- - - ! '>='
264
+ - - ">="
302
265
  - !ruby/object:Gem::Version
303
266
  version: '0'
304
267
  - !ruby/object:Gem::Dependency
305
268
  name: simplecov
306
269
  requirement: !ruby/object:Gem::Requirement
307
- none: false
308
270
  requirements:
309
- - - ! '>='
271
+ - - ">="
310
272
  - !ruby/object:Gem::Version
311
273
  version: '0'
312
274
  type: :development
313
275
  prerelease: false
314
276
  version_requirements: !ruby/object:Gem::Requirement
315
- none: false
316
277
  requirements:
317
- - - ! '>='
278
+ - - ">="
318
279
  - !ruby/object:Gem::Version
319
280
  version: '0'
320
281
  - !ruby/object:Gem::Dependency
321
282
  name: chipmunk
322
283
  requirement: !ruby/object:Gem::Requirement
323
- none: false
324
284
  requirements:
325
- - - ! '>='
285
+ - - ">="
326
286
  - !ruby/object:Gem::Version
327
287
  version: '0'
328
288
  type: :development
329
289
  prerelease: false
330
290
  version_requirements: !ruby/object:Gem::Requirement
331
- none: false
332
291
  requirements:
333
- - - ! '>='
292
+ - - ">="
334
293
  - !ruby/object:Gem::Version
335
294
  version: '0'
336
295
  description: Framework for building and distributing games using Gosu
@@ -363,6 +322,7 @@ files:
363
322
  - lib/gamebox/actors/score.rb
364
323
  - lib/gamebox/actors/svg_actor.rb
365
324
  - lib/gamebox/behaviors/animated.rb
325
+ - lib/gamebox/behaviors/animated_with_spritemap.rb
366
326
  - lib/gamebox/behaviors/audible.rb
367
327
  - lib/gamebox/behaviors/collidable.rb
368
328
  - lib/gamebox/behaviors/collidable/aabb_collidable.rb
@@ -522,37 +482,31 @@ files:
522
482
  - templates/app/src/app.rb
523
483
  - templates/app/src/behaviors/.gitkeep
524
484
  - templates/app/src/stages/demo_stage.rb
485
+ - templates/app/src/views/.gitkeep
525
486
  - templates/behavior_template.erb
526
487
  - templates/stage_template.erb
527
488
  homepage: http://shawn42.github.com/gamebox
528
489
  licenses: []
490
+ metadata: {}
529
491
  post_install_message:
530
492
  rdoc_options: []
531
493
  require_paths:
532
494
  - lib
533
495
  required_ruby_version: !ruby/object:Gem::Requirement
534
- none: false
535
496
  requirements:
536
- - - ! '>='
497
+ - - ">="
537
498
  - !ruby/object:Gem::Version
538
499
  version: '0'
539
- segments:
540
- - 0
541
- hash: 3939132703427340795
542
500
  required_rubygems_version: !ruby/object:Gem::Requirement
543
- none: false
544
501
  requirements:
545
- - - ! '>='
502
+ - - ">="
546
503
  - !ruby/object:Gem::Version
547
504
  version: '0'
548
- segments:
549
- - 0
550
- hash: 3939132703427340795
551
505
  requirements: []
552
506
  rubyforge_project: gamebox
553
- rubygems_version: 1.8.25
507
+ rubygems_version: 2.2.2
554
508
  signing_key:
555
- specification_version: 3
509
+ specification_version: 4
556
510
  summary: Framework for building and distributing games using Gosu
557
511
  test_files:
558
512
  - spec/acceptance/animation_spec.rb