gamebox 0.4.0.rc5 → 0.4.0.rc11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. data/README.md +205 -127
  2. data/bin/gamebox +49 -3
  3. data/bin/gb +87 -0
  4. data/gamebox.gemspec +4 -3
  5. data/lib/gamebox.rb +1 -1
  6. data/lib/gamebox/actors/collidable_debugger.rb +4 -4
  7. data/lib/gamebox/actors/icon.rb +7 -0
  8. data/lib/gamebox/actors/label.rb +41 -42
  9. data/lib/gamebox/behaviors/animated.rb +6 -0
  10. data/lib/gamebox/behaviors/audible.rb +1 -2
  11. data/lib/gamebox/behaviors/collidable.rb +1 -1
  12. data/lib/gamebox/behaviors/graphical.rb +8 -4
  13. data/lib/gamebox/behaviors/physical.rb +6 -1
  14. data/lib/gamebox/behaviors/positioned.rb +4 -11
  15. data/lib/gamebox/behaviors/projectile.rb +8 -0
  16. data/lib/gamebox/behaviors/visible.rb +3 -3
  17. data/lib/gamebox/core/aabb_tree.rb +1 -1
  18. data/lib/gamebox/core/actor.rb +37 -50
  19. data/lib/gamebox/core/actor_definition.rb +41 -0
  20. data/lib/gamebox/core/actor_view.rb +6 -21
  21. data/lib/gamebox/core/actor_view_definition.rb +19 -0
  22. data/lib/gamebox/core/actor_view_factory.rb +9 -3
  23. data/lib/gamebox/core/behavior.rb +8 -27
  24. data/lib/gamebox/core/behavior_definition.rb +24 -0
  25. data/lib/gamebox/core/config_manager.rb +45 -30
  26. data/lib/gamebox/core/configuration.rb +5 -0
  27. data/lib/gamebox/core/core.rb +4 -0
  28. data/lib/gamebox/core/debug_helpers.rb +46 -0
  29. data/lib/gamebox/core/director.rb +32 -5
  30. data/lib/gamebox/core/event_symbols.rb +214 -0
  31. data/lib/gamebox/core/game.rb +1 -1
  32. data/lib/gamebox/core/input_manager.rb +1 -4
  33. data/lib/gamebox/core/input_mapper.rb +85 -0
  34. data/lib/gamebox/core/physics.rb +7 -3
  35. data/lib/gamebox/core/physics_manager.rb +5 -1
  36. data/lib/gamebox/core/renderer.rb +72 -0
  37. data/lib/gamebox/core/stage.rb +25 -81
  38. data/lib/gamebox/core/stage_definition.rb +60 -0
  39. data/lib/gamebox/core/stage_factory.rb +56 -0
  40. data/lib/gamebox/core/stage_manager.rb +5 -11
  41. data/lib/gamebox/core/timer_manager.rb +6 -2
  42. data/lib/gamebox/core/viewport.rb +12 -5
  43. data/lib/gamebox/core/wrapped_screen.rb +8 -5
  44. data/lib/gamebox/gamebox_application.rb +21 -19
  45. data/lib/gamebox/lib/array_ext.rb +9 -0
  46. data/lib/gamebox/lib/observable_attributes.rb +24 -0
  47. data/lib/gamebox/lib/vector2.rb +432 -0
  48. data/lib/gamebox/post_setup_handlers/file_watcher.rb +37 -0
  49. data/lib/gamebox/post_setup_handlers/gamebox_debug_helpers.rb +13 -0
  50. data/lib/gamebox/post_setup_handlers/pry_remote_server.rb +29 -0
  51. data/lib/gamebox/spec/helper.rb +165 -17
  52. data/lib/gamebox/tasks/gamebox_tasks.rake +27 -12
  53. data/lib/gamebox/version.rb +1 -1
  54. data/lib/gamebox/views/graphical_actor_view.rb +4 -5
  55. data/script/perf_aabb.rb +13 -8
  56. data/spec/acceptance/animation_spec.rb +1 -3
  57. data/spec/acceptance/basic_actor_lifecycle_spec.rb +1 -1
  58. data/spec/acceptance/fps_actor_spec.rb +8 -12
  59. data/spec/acceptance/input_mapper_spec.rb +17 -24
  60. data/spec/acceptance/update_ordering_spec.rb +64 -0
  61. data/spec/actors/label_spec.rb +90 -5
  62. data/spec/behaviors/animated_spec.rb +1 -1
  63. data/spec/behaviors/collidable_spec.rb +7 -15
  64. data/spec/behaviors/positioned_spec.rb +12 -5
  65. data/spec/core/actor_spec.rb +31 -3
  66. data/spec/core/actor_view_spec.rb +1 -1
  67. data/spec/core/behavior_spec.rb +3 -0
  68. data/spec/core/configuration_spec.rb +49 -2
  69. data/spec/core/input_mapper_spec.rb +7 -0
  70. data/spec/core/renderer_spec.rb +89 -0
  71. data/spec/core/stage_definition_spec.rb +41 -0
  72. data/spec/core/stage_manager_spec.rb +11 -11
  73. data/spec/core/stage_spec.rb +38 -78
  74. data/spec/core/viewport_spec.rb +5 -2
  75. data/spec/core/wrapped_screen_spec.rb +18 -12
  76. data/spec/views/graphical_actor_view_spec.rb +33 -62
  77. data/templates/actor_template.erb +11 -0
  78. data/templates/app/README.md +1 -0
  79. data/templates/app/src/actors/{player.rb → player_actor.rb} +3 -1
  80. data/templates/app/src/behaviors/.gitkeep +0 -0
  81. data/templates/app/src/stages/demo_stage.rb +14 -0
  82. data/templates/behavior_template.erb +13 -0
  83. data/templates/stage_template.erb +13 -0
  84. metadata +60 -21
  85. data/component_generators/actor_generator.rb +0 -17
  86. data/lib/gamebox/actors/emitter.rb +0 -12
  87. data/lib/gamebox/behaviors/emitting.rb +0 -48
  88. data/lib/gamebox/behaviors/input_mapper.rb +0 -11
  89. data/lib/gamebox/lib/ftor.rb +0 -372
  90. data/spec/actors/emitter_spec.rb +0 -5
  91. data/templates/app/NEXT_STEPS.txt +0 -1
  92. data/templates/app/README.rdoc +0 -24
  93. data/templates/app/src/demo_stage.rb +0 -7
data/README.md CHANGED
@@ -1,174 +1,252 @@
1
1
  # Gamebox
2
- ![http://travis-ci.org/shawn42/gamebox](https://secure.travis-ci.org/shawn42/gamebox.png)
3
- ![https://gemnasium.com/shawn42/gamebox](https://gemnasium.com/shawn42/gamebox.png)
4
2
 
5
- * A game template for building and distributing Gosu games.
6
- * Quickly generate a game and have it up and running.
7
- * Provide conventions and DSL for building your game.
8
- * Facilitate quickly building distributable artifacts.
9
- * http://shawn42.github.com/gamebox/
10
- * see [gamebox on rubygems.org](https://rubygems.org/gems/gamebox) for the list of requirements
3
+ [![Gamebox Build Status](https://secure.travis-ci.org/shawn42/gamebox.png)](http://travis-ci.org/shawn42/gamebox)
4
+ [![Gamebox Deps Status](https://gemnasium.com/shawn42/gamebox.png)](https://gemnasium.com/shawn42/gamebox)
5
+ [![Code Climate](https://codeclimate.com/github/shawn42/gamebox.png)](https://codeclimate.com/github/shawn42/gamebox)
11
6
 
7
+ * A **game template** for building and distributing Gosu games.
8
+ * Quickly **generate a game** and have it **up and running**.
9
+ * Provide **conventions and DSL** for building your game.
10
+ * Facilitate quickly building **distributable artifacts**.
11
+ * http://shawn42.github.com/gamebox/
12
+ * see [gamebox on rubygems.org](https://rubygems.org/gems/gamebox) for the list of requirements
12
13
 
13
- # Getting started with Gamebox
14
+ ## Getting started with Gamebox
14
15
 
15
- ## Purpose
16
+ ### Purpose
16
17
 
17
- Why use Gamebox? Gamebox was designed to spring board game development. It allows the developer to define business rules about a game very quickly without having to worry about resource loading, sound/music management, creating windows, or messing with viewports. Gamebox allows you to define a game's business rules within minutes.
18
+ **Why use Gamebox?** Gamebox was designed to spring board game development. It allows the developer to define business rules about a game very quickly without having to worry about resource loading, sound/music management, creating windows, or messing with viewports. Gamebox allows you to define a game's business rules within minutes, using the metaphor of a 5th grade play.
18
19
 
19
- The driving idea behind Gamebox is to provide the ability to have as many of the basic common pieces of a 2D game at the developers disposal from the beginning.
20
+ The driving idea behind Gamebox is to provide the ability to have as many of the basic common pieces of a **2D game** at the developers disposal from the beginning.
20
21
 
21
22
  The reason I wrote Gamebox is twofold: first, to aid in 48 hour game writing competitions and second, to allow me to write simple educational games for my kids.
22
23
 
23
- ## Installation
24
+ ### Installation
24
25
 
25
- * gem install gamebox
26
- * or [tar](http://shawn42.github.com/gamebox)
27
- * or git clone git://github.com/shawn42/gamebox.git
26
+ * `gem install gamebox`
27
+ * `git clone git://github.com/shawn42/gamebox.git && cd gamebox && bundle && rake install`
28
28
 
29
- ## Game Creation
29
+ ### Game Creation
30
30
 
31
- ``` $ gamebox zapper```
31
+ To create a new Gamebox project run:
32
32
 
33
- ```$ this will create the directory structure and needed files to get a basic actor up on the screen```
33
+ ```bash
34
+ gamebox zapper
35
+ ```
34
36
 
37
+ This will create the directory structure and needed files to get a basic actor up on the screen:
38
+
39
+ ```
35
40
  zapper
36
- ├── Gemfile
37
- ├── README.rdoc
38
- ├── Rakefile
39
- ├── config
40
- │ ├── boot.rb
41
- │ ├── environment.rb
42
- │ └── game.yml
43
- ├── data
44
- │ ├── fonts
45
- │ └── FONTS_GO_HERE
46
- │ ├── graphics
47
- └── GRAPHICS_GO_HERE
48
- ├── music
49
- └── MUSIC_GOES_HERE
50
- └── sounds
51
- │ └── SOUND_FX_GO_HERE
52
- ├── spec
53
- │ └── helper.rb
54
- └── src
55
- ├── actors
56
- │ └── player.rb
57
- ├── app.rb
58
- └── demo_stage.rb
59
-
60
-
61
- you now have a runnable gamebox game
62
- `
63
- ` cd zapper
64
- rake
65
-
66
- ## Actors to the Stage
67
-
68
- An actor is the base class for any game object. A building, the player, the score, the bullet are all examples of actors. Actors can even be invisible. Any number of behaviors can be added to an actor to define how it will react to the world via the define_actor method. Actors are simply buckets of data and behaviors. The interactions with system are all driven by their behaviors.
69
-
70
- So Actors sound fun, how do I get one? That's where the ActorFactory comes in. In your Stage class (demo_stage.rb by default) you can use the create_actor helper method as shown below.
71
- `
72
- ` @score # create_actor :score, x: 10, y: 10
73
-
74
- This call will return an instance of a score (the first arg is the symbolized version of the actor type). It will also create the view for the actor and register it to be drawn. Which view is instantiated depends on the actor requested. The factory will always look for a view named the same as the actor with _view on the end. So the actor score will look for score_view. If score_view does not exist, a generic view class will be used based on the behaviors of the actor. Each view is constructed with a reference to the actor it is displaying. See ActorFactor#build for more details.
75
-
76
- That's great, but how do I tell my actors what to do? By defining their behaviors!
77
- `
78
- `define_actor :score do
79
- has_behaviors :positioned, :score_keeping
41
+ ├── Gemfile
42
+ ├── README.rdoc
43
+ ├── Rakefile
44
+ ├── config
45
+ │ ├── boot.rb
46
+ │ ├── environment.rb
47
+ │ └── game.yml
48
+ ├── data
49
+ │ ├── fonts
50
+ ├── graphics
51
+ │ ├── music
52
+ │ └── sounds
53
+ ├── spec
54
+ │ └── helper.rb
55
+ └── src
56
+ ├── actors
57
+ │ └── player.rb
58
+ ├── app.rb
59
+ └── demo_stage.rb
60
+ ```
61
+
62
+ To run your game:
63
+
64
+ ```bash
65
+ cd zapper
66
+ bundle
67
+ rake
68
+ ```
69
+
70
+ ## Stages
71
+
72
+ A stage is where all the magic happens. Each new play type in your game will use a different stage. An example game may have a number of stages such as: `main_menu`, `play`, or `credits`. A `demo_stage.rb` is created for you by using the `gamebox new` command.
73
+
74
+ ```ruby
75
+ define_stage :demo do
76
+ curtain_up do
77
+ ...
78
+ end
80
79
  end
80
+ ```
81
81
 
82
+ ## Actors
82
83
 
83
- ## Sound
84
+ Actors are the basic building blocks of games in Gamebox. Everything in the game is an actor: the player, an alien, the bullet, even the score on the screen. Internally, actors are just named collections of behaviors and observable attributes.
84
85
 
85
- There are two ways to play sounds in Gamebox. From your stage you can simple access the SoundManager via the sound_manager method. From your actors, you can play sounds via the play_sound helper method in the audible behavior.
86
- `
87
- ` # music
88
- sound_manager.play_music :overworld
89
-
90
- # sounds
91
- sound_manager.play_sound :death
86
+ ```ruby
87
+ define_actor :player do
88
+ has_behaviors do
89
+ shooter recharge_time: 4_000, shot_power: 15, kickback: 0.7
90
+ shielded
91
+ bomber kickback: 5
92
92
 
93
- or
94
- `
95
- ` # from an actor
96
- has_behavior :audible
97
- actor.react_to :play_sound, :jump
93
+ die_by_sword
94
+ die_by_bullet
95
+ die_by_bomb
96
+ blasted_by_bomb
98
97
 
99
- ## Resources
98
+ jumper
99
+ end
100
+ end
101
+ ```
100
102
 
101
- All file loading is handled by the ResourceManager. It handles loading images, sounds, fonts, config files, and even svg files. The resource manager caches images based on their name and fonts based on their name/size pair. Example usage from the ScoreView class:
102
- `
103
- ` font # @mode.resource_manager.load_font 'Asimov.ttf', 30
103
+ ### Behaviors
104
104
 
105
- ## Behaviors
105
+ Behaviors are what bring life to actors. They interact interact with the actor's internal data, input, audio, etc.
106
106
 
107
- Behaviors are designed to allow you to build Actors from previously built chunks of code. Lets look at the built in Animated behavior.
108
- `
109
- ` define_behavior :shooting do
110
- requires :input_manager
111
- setup do
112
- input_manager.reg :down, KbSpace do
113
- shoot
114
- end
115
- end
107
+ ```ruby
108
+ define_behavior :projectile do
116
109
 
117
- helpers do
118
- def shoot
119
- # shoot
120
- end
110
+ requires :director
111
+ requires_behaviors :positioned
112
+ setup do
113
+ actor.has_attributes vel_x: 0,
114
+ vel_y: 0
115
+
116
+ director.when :update do |delta_ms, delta_secs|
117
+ actor.x += (actor.vel_x * delta_secs)
118
+ actor.y += (actor.vel_y * delta_secs)
121
119
  end
122
120
  end
121
+ end
122
+ ```
123
123
 
124
+ ### Views
124
125
 
125
- This snippet show us that our Actor wants to be updated on every gameloop and that it wants to be animated. Gamebox favors convention over configuration. This means that there are default locations and setting for most things. They can be overridden but you are not required to do so. The animated behavior assumes that your animated images are in a directory structure based on the Actor's underscored name and its current action.
126
- `
127
- ` zapper/
128
- `-- data
129
- `-- graphics
130
- `-- super_hero
131
- |-- flying
132
- | |-- 1.png
133
- | |-- 2.png
134
- | |-- ...
135
- | `-- 8.png
136
- |-- idle.png
137
- `-- walking
138
- |-- 1.png
139
- `-- 2.png
140
-
141
- Here we can see that the SuperHere class has three actions (flying, walking, idle). These actions will be set by calling action# on your Actor.
126
+ Actor views are the mechanism for drawing an actor in Gamebox. When an actor is created, Gamebox will see if there is a matching actor view by name. It will register the view to be drawn by the renderer. The draw callback is called with the rendering target, the x and y offsets based on the viewport, and the z layer to be used for drawing this actor (see the section on parallax layers for more on z layers).
142
127
 
143
- batman # create_actor :super_hero
144
- batman.action # :flying
128
+ ```ruby
129
+ define_actor_view :label_view do
130
+ draw do |target, x_off, y_off, z|
131
+ target.print actor.text, actor.x, actor.y, z, actor.font_style
132
+ end
133
+ end
134
+ ```
145
135
 
146
- The animation will cycle through all the numbered png files for the current action. To stop animating you simple call stop_animating.
136
+ ### Getting actors on stage
147
137
 
148
- batman.stop_animating
138
+ To get an actor on the stage, use the `create_actor` method on stage. This can be done directly from a stage or from a behavior that has required stage via `requires :stage`.
149
139
 
140
+ ```ruby
141
+ curtain_up do
142
+ @player = create_actor :label, x: 20, y: 30, text: "Hello World!"
143
+ end
150
144
 
151
- Animated and Updatable are just two behaviors available in Gamebox. Other include graphical, audible, layered, and physical. You can easily add your own game specific behaviors by extending Behavior. (see Wanderer in rague example for a simple behavior).
145
+ # or
146
+ stage.create_actor ..
147
+ ```
152
148
 
153
- ## Stages
149
+ ## Input
150
+
151
+ Input comes from the InputManager. The stage has direct access via the `input_manager` method. Behaviors can request that they get the `input_manager` via `requires :input_manager`. The preferred way of getting input to your actors is via the actor's `input` method. It returns an InputMapper that can be built with a hash of events. Behaviors then subscribe for those events from the actor's input, or ask for it during updates.
152
+
153
+ ```ruby
154
+ actor.input.map_input '+space' => :shoot,
155
+ '+w' => :jump,
156
+ '+a' => :walk_left
157
+ '+s' => :duck
158
+ '+d' => :walk_right
159
+
160
+ actor.input.when :shoot do
161
+ # shoot code
162
+ end
163
+
164
+ # or
165
+ if actor.input.walk_left?
166
+ # walk left
167
+ end
168
+ ```
169
+
170
+ ## Updates
171
+
172
+ Updates all come from the Director. Again, the stage has direct access via `director` and behaviors must `requires :director`.
154
173
 
155
- A Stage is where all the magic happens. A Stage can be any gameplay mode in your game. The main menu has a different interactions than the _real_ game. In Gamebox, each should have their own Stage. Stages are configured via the stage_config.yml file in config. Listing :demo there will create DemoStage for you. Game.rb decides which stage to start on.
174
+ ```ruby
175
+ director.when :update do |t_ms, t_sec|
176
+ # update something
177
+ end
178
+ ```
179
+
180
+ ## Sound and Music
181
+
182
+ SoundManager handles the autoloading of sounds from `data/sounds` and `data/music`. The stage has direct access via `sound_manager`. To allow an actor to emit sounds or music, give them the `audible` behavior. See Reactions below for usage from actors.
183
+
184
+ ```ruby
185
+ # music
186
+ sound_manager.play_music :overworld
187
+
188
+ # sounds
189
+ sound_manager.play_sound :death
190
+ ```
191
+
192
+ ## Reactions
156
193
 
157
- ## StageManager
194
+ To ask to react to something we use the `react_to` method. It sends your message to all of the actors behaviors, giving them a chance to (you guessed it), react.
158
195
 
159
- So how do these actors end up on the screen? The StageManager. The stage manager handles contruction of new stages and drawing their actors too. Gamebox has built-in support for parallaxing. Parallax layers denote this distance from the audience an Actor should be. The clouds in the sky that are really far away can be set to INFINITY to have them not move at all as the viewport moves. Each parallax layer has layers to allow Actors to be on top of one another, but have the same distance from the audience. The StageManager respects Actor's layered behaviors, if specified. If no layer is specified, the StageManager puts the Actor on parallax layer one of layer one. Example layered behavior:
196
+ ```ruby
197
+ actor.react_to :play_sound, :jump
198
+ ```
160
199
 
161
- has_behavior :layered #> {:parallax #> 30, :layer #> 2}
200
+ If the actor has an audible behavior listening, he'll play the jump sound. But what if something else wants to know about playing sounds. Maybe the actor triggers an effect by making sound. If the actor had a `noise_alert` behavior, it too would be notified of the `:play_sound` event.
201
+
202
+ ```ruby
203
+ define_behavior :noise_alert do
204
+ setup do
205
+ reacts_with :play_sound
206
+ end
207
+
208
+ helpers do
209
+ def play_sound(*args)
210
+ # react here
211
+ end
212
+ end
213
+ end
214
+ ```
162
215
 
163
- This Actor will be 30 layers away from the audience, and will sit on top of anything in parallax layer 30 that has layer less than 2.
216
+ The `reacts_with` helper takes a list of events that your behavior is interested in, and maps them to helper methods.
164
217
 
218
+ ## TODO
165
219
 
166
- ## Publisher
167
- ## Physics
168
- ## SVG Levels
220
+ ### Configuration
169
221
 
170
- ## LICENSE:
222
+ 1. `Gamebox.configuration`
171
223
 
172
- (MIT)
224
+ ### Resources
225
+
226
+ 1. load paths
227
+ 2. fonts
228
+ 3. graphics (caching)
229
+ 4. sounds
230
+
231
+ ### Stages
232
+
233
+ 1. configuring stages
234
+ 1. changing stages
235
+
236
+ ### Physics
237
+
238
+ ## Links
239
+
240
+ [Frequently Asked Questions](https://github.com/shawn42/gamebox/wiki/Frequently-Asked-Questions)
241
+
242
+ ## License
243
+
244
+ The MIT License (MIT)
173
245
 
174
246
  Copyright © 2012 Shawn Anderson
247
+
248
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
249
+
250
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
251
+
252
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,12 +1,20 @@
1
1
  #!/usr/bin/env ruby
2
-
2
+ require 'rake'
3
3
  require 'thor'
4
4
  require 'gamebox'
5
+ include Rake::DSL
6
+
7
+ DIST_TYPES = %w(mac win linux)
8
+ load File.expand_path(File.join(File.dirname(__FILE__), "..", "/lib/gamebox/tasks/gamebox_tasks.rake"))
5
9
 
6
10
  def print_version
7
11
  puts "Gamebox #{Gamebox::VERSION::STRING}"
8
12
  end
9
13
 
14
+ def run_rake_task(*args)
15
+ sh "rake #{args.shift}[#{args.join(',')}]"
16
+ end
17
+
10
18
  if ARGV.include?('-v') || ARGV.include?('--version')
11
19
  print_version
12
20
  exit 0
@@ -31,11 +39,49 @@ class GameboxThorCommand < Thor
31
39
  end
32
40
 
33
41
  directory "app", "."
42
+ end
43
+ desc "n PATH", "Generates a new gamebox game at PATH."
44
+ alias_method :n, :new
45
+
46
+ desc "start", "starts the application"
47
+ def start
48
+ print_version
49
+ run_rake_task("run")
50
+ end
34
51
 
52
+ desc "s", "starts the application"
53
+ alias_method :s, :start
54
+
55
+ desc "debug", "starts the application in debug"
56
+ def debug
57
+ print_version
58
+ run_rake_task("debug")
35
59
  end
36
-
37
60
 
61
+ desc "d", "starts the application in debug"
62
+ alias_method :d, :debug
63
+
64
+ desc "dist [mac|linux|win|all]", "Build an executable for your app"
65
+ def dist(*args)
66
+ dist_type = args[0]
67
+ if DIST_TYPES.include?(dist_type)
68
+ run_rake_task("dist:#{dist_type}")
69
+ elsif dist_type == "all"
70
+ DIST_TYPES.each do |type|
71
+ run_rake_task("dist:#{type}")
72
+ end
73
+ else
74
+ p "Unrecognized dist type"
75
+ end
76
+ end
77
+
78
+ desc "generate [actor|behavior|stage] NAME", "Gamebox generator, this will generate templated files for you for quicker development"
79
+ def generate(*args)
80
+ run_rake_task("generate:#{args.shift}", *args)
81
+ end
82
+ desc "g [actor|behavior|stage] NAME", "Gamebox generator, this will generate templated files for you for quicker development"
83
+ alias_method :g, :generate
38
84
 
39
85
  end
40
86
 
41
- GameboxThorCommand.start
87
+ GameboxThorCommand.start