gamebox 0.2.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -8
- data/Rakefile +13 -37
- data/TODO.txt +27 -27
- data/docs/getting_started.rdoc +2 -2
- data/gamebox.gemspec +33 -191
- data/lib/gamebox.rb +18 -14
- data/lib/gamebox/actor.rb +37 -27
- data/lib/gamebox/actor_factory.rb +4 -5
- data/lib/gamebox/actor_view.rb +8 -0
- data/lib/gamebox/actors/collidable_debugger.rb +2 -2
- data/lib/gamebox/actors/curtain.rb +3 -3
- data/lib/gamebox/actors/emitter.rb +51 -0
- data/lib/gamebox/actors/label.rb +27 -7
- data/lib/gamebox/actors/logo.rb +1 -1
- data/lib/gamebox/actors/spatial_debugger.rb +25 -10
- data/lib/gamebox/arbiter.rb +61 -34
- data/lib/gamebox/behavior.rb +3 -3
- data/lib/gamebox/behaviors/animated.rb +1 -1
- data/lib/gamebox/behaviors/audible.rb +1 -1
- data/lib/gamebox/behaviors/collidable.rb +9 -4
- data/lib/gamebox/behaviors/collidable/aabb_collidable.rb +26 -1
- data/lib/gamebox/behaviors/collidable/circle_collidable.rb +3 -3
- data/lib/gamebox/behaviors/collidable/polygon_collidable.rb +1 -1
- data/lib/gamebox/behaviors/graphical.rb +30 -4
- data/lib/gamebox/behaviors/layered.rb +1 -1
- data/lib/gamebox/behaviors/physical.rb +113 -30
- data/lib/gamebox/behaviors/timed.rb +33 -0
- data/lib/gamebox/behaviors/updatable.rb +1 -1
- data/lib/gamebox/class_finder.rb +1 -21
- data/lib/gamebox/console_app.rb +33 -31
- data/lib/gamebox/constants.rb +481 -0
- data/lib/gamebox/data/config/objects.yml +7 -0
- data/lib/gamebox/gamebox_application.rb +10 -33
- data/lib/gamebox/gamebox_generator.rb +32 -32
- data/lib/gamebox/input_manager.rb +73 -32
- data/lib/gamebox/lib/inflector.rb +1 -1
- data/lib/gamebox/lib/range_ext.rb +5 -0
- data/lib/gamebox/lib/rect.rb +548 -548
- data/lib/gamebox/lib/sorted_list.rb +1 -1
- data/lib/gamebox/lib/symbol_ext.rb +8 -0
- data/lib/gamebox/physical_director.rb +1 -1
- data/lib/gamebox/physical_stage.rb +3 -3
- data/lib/gamebox/physics.rb +0 -3
- data/lib/gamebox/resource_manager.rb +22 -17
- data/lib/gamebox/sound_manager.rb +3 -2
- data/lib/gamebox/spatial_hash.rb +60 -31
- data/lib/gamebox/spatial_stagehand.rb +30 -6
- data/lib/gamebox/spec/helper.rb +7 -7
- data/lib/gamebox/stage.rb +18 -19
- data/lib/gamebox/stage_manager.rb +33 -23
- data/lib/gamebox/stagehand.rb +3 -0
- data/lib/gamebox/svg_document.rb +1 -1
- data/lib/gamebox/tasks/gamebox_tasks.rake +133 -0
- data/lib/gamebox/templates/actor.erb +0 -2
- data/lib/gamebox/templates/actor_view.erb +1 -3
- data/lib/gamebox/templates/template_app/Gemfile +3 -2
- data/lib/gamebox/templates/template_app/Rakefile +3 -8
- data/lib/gamebox/templates/template_app/config/environment.rb +7 -39
- data/lib/gamebox/templates/template_app/src/demo_stage.rb +1 -2
- data/lib/gamebox/templates/template_app/src/my_actor.rb +0 -3
- data/lib/gamebox/version.rb +2 -2
- data/lib/gamebox/viewport.rb +44 -8
- data/lib/gamebox/views/graphical_actor_view.rb +22 -16
- data/lib/gamebox/wrapped_screen.rb +9 -1
- data/script/perf_spatial_hash.rb +49 -58
- data/script/perf_struct_vs_array.rb +32 -0
- data/spec/actor_factory_spec.rb +61 -0
- data/spec/actor_spec.rb +24 -18
- data/spec/actor_view_spec.rb +51 -6
- data/spec/animated_spec.rb +27 -6
- data/spec/arbiter_spec.rb +12 -24
- data/spec/backstage_spec.rb +1 -1
- data/spec/behavior_spec.rb +3 -3
- data/spec/class_finder_spec.rb +13 -0
- data/spec/collidable_spec.rb +30 -10
- data/spec/emitter_spec.rb +20 -0
- data/spec/helper.rb +5 -21
- data/spec/input_manager_spec.rb +134 -0
- data/spec/label_spec.rb +0 -1
- data/spec/physical_spec.rb +114 -5
- data/spec/resource_manager_spec.rb +1 -2
- data/spec/spatial_hash_spec.rb +23 -7
- data/spec/spatial_stagehand_spec.rb +97 -0
- data/spec/stage_manager_spec.rb +0 -1
- data/spec/stage_spec.rb +2 -2
- data/spec/viewport_spec.rb +92 -48
- metadata +223 -119
- data/.gitignore +0 -11
- data/History.txt +0 -80
- data/VERSION +0 -1
- data/lib/gamebox/event_compat.rb +0 -285
- data/lib/gamebox/lib/diy.rb +0 -371
- data/lib/gamebox/lib/numbers_ext.rb +0 -3
- data/lib/gamebox/tasks/gamebox_tasks.rb +0 -61
- data/load_paths.rb +0 -20
@@ -1,61 +0,0 @@
|
|
1
|
-
require 'gamebox/lib/platform'
|
2
|
-
|
3
|
-
desc "Run the game"
|
4
|
-
task :run do |t|
|
5
|
-
sh "ruby src/app.rb"
|
6
|
-
end
|
7
|
-
task :default => :run
|
8
|
-
|
9
|
-
desc "Report code statistics (KLOCs, etc) from the application"
|
10
|
-
task :stats do
|
11
|
-
require 'gamebox/lib/code_statistics'
|
12
|
-
CodeStatistics.new(*STATS_DIRECTORIES).to_s
|
13
|
-
end
|
14
|
-
|
15
|
-
|
16
|
-
desc "Run the game with debug server"
|
17
|
-
task :debug do |t|
|
18
|
-
sh "ruby src/app.rb -debug-server"
|
19
|
-
end
|
20
|
-
|
21
|
-
desc "Bundle in all required gems"
|
22
|
-
task :bundle do |t|
|
23
|
-
sh "bundle package"
|
24
|
-
sh "bundle install vendor/bundle --disable-shared-gems"
|
25
|
-
end
|
26
|
-
|
27
|
-
begin
|
28
|
-
require 'spec/rake/spectask'
|
29
|
-
desc "Run all specs"
|
30
|
-
Spec::Rake::SpecTask.new('spec') do |t|
|
31
|
-
t.spec_opts = ["-r", "./spec/helper"]
|
32
|
-
t.spec_files = FileList['spec//*_spec.rb']
|
33
|
-
end
|
34
|
-
task :rspec => :spec
|
35
|
-
task :test => :spec
|
36
|
-
rescue LoadError
|
37
|
-
puts "warning: rspec not installed"
|
38
|
-
puts "install with gem install rspec"
|
39
|
-
end
|
40
|
-
|
41
|
-
namespace :dist do
|
42
|
-
task :vendor do
|
43
|
-
sh 'wget http://github.com/downloads/shawn42/gamebox/vendor.zip; unzip vendor.zip; rm vendor.zip'
|
44
|
-
end
|
45
|
-
task :win do
|
46
|
-
# create dist dir
|
47
|
-
FileUtils.mkdir "dist" unless File.exist? "dist"
|
48
|
-
# pull down windows app shell
|
49
|
-
# expand into place
|
50
|
-
sh 'cd dist; wget http://github.com/downloads/shawn42/gamebox/gamebox_app.zip; unzip gamebox_app.zip; mv gamebox_app/* .; rm gamebox_app.zip; rm -rf gamebox_app'
|
51
|
-
|
52
|
-
# copy config/src/lib/data into dist/src
|
53
|
-
%w{vendor config data }.each do |dir|
|
54
|
-
FileUtils.cp_r dir, File.join('dist','src', dir) if File.exist? dir
|
55
|
-
end
|
56
|
-
FileUtils.cp_r 'src', File.join('dist', 'src')
|
57
|
-
|
58
|
-
# create zip of dist?
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
data/load_paths.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
begin
|
2
|
-
require File.expand_path('../.bundle/environment', __FILE__)
|
3
|
-
rescue LoadError
|
4
|
-
begin
|
5
|
-
# bust gem prelude
|
6
|
-
if defined? Gem
|
7
|
-
Gem.cache
|
8
|
-
gem 'bundler'
|
9
|
-
else
|
10
|
-
require 'rubygems'
|
11
|
-
end
|
12
|
-
require 'bundler'
|
13
|
-
Bundler.setup
|
14
|
-
rescue LoadError
|
15
|
-
module Bundler
|
16
|
-
def self.require(*args, &block); end
|
17
|
-
def self.method_missing(*args, &block); end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|