metro-ld26 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +17 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +6 -0
  5. data/Gemfile +14 -0
  6. data/Guardfile +4 -0
  7. data/LICENSE.txt +22 -0
  8. data/README.md +177 -0
  9. data/Rakefile +18 -0
  10. data/bin/metro +16 -0
  11. data/changelog.md +153 -0
  12. data/lib/assets/menu-movement.wav +0 -0
  13. data/lib/assets/menu-selection.wav +0 -0
  14. data/lib/assets/missing.ogg +0 -0
  15. data/lib/assets/missing.png +0 -0
  16. data/lib/assets/missing.wav +0 -0
  17. data/lib/assets/missing_animation.png +0 -0
  18. data/lib/commands/generate_game.rb +13 -0
  19. data/lib/commands/generate_model.rb +25 -0
  20. data/lib/commands/generate_scene.rb +36 -0
  21. data/lib/commands/generate_view.rb +21 -0
  22. data/lib/commands/thor.rb +83 -0
  23. data/lib/core_ext/class.rb +14 -0
  24. data/lib/core_ext/numeric.rb +59 -0
  25. data/lib/gosu_ext/color.rb +62 -0
  26. data/lib/gosu_ext/gosu_constants.rb +53 -0
  27. data/lib/locale/en.yml +35 -0
  28. data/lib/locale/locale.rb +1 -0
  29. data/lib/metro.rb +144 -0
  30. data/lib/metro/animation.rb +135 -0
  31. data/lib/metro/animation/after_interval_factory.rb +12 -0
  32. data/lib/metro/animation/animation_factory.rb +15 -0
  33. data/lib/metro/animation/easing/ease_in.rb +15 -0
  34. data/lib/metro/animation/easing/easing.rb +51 -0
  35. data/lib/metro/animation/easing/linear.rb +15 -0
  36. data/lib/metro/animation/has_animations.rb +70 -0
  37. data/lib/metro/animation/implicit_animation.rb +100 -0
  38. data/lib/metro/animation/on_update_operation.rb +96 -0
  39. data/lib/metro/animation/scene_animation.rb +16 -0
  40. data/lib/metro/asset_path.rb +97 -0
  41. data/lib/metro/events/control_definition.rb +11 -0
  42. data/lib/metro/events/controls.rb +42 -0
  43. data/lib/metro/events/event_data.rb +60 -0
  44. data/lib/metro/events/event_dictionary.rb +52 -0
  45. data/lib/metro/events/event_factory.rb +17 -0
  46. data/lib/metro/events/event_relay.rb +342 -0
  47. data/lib/metro/events/event_state_manager.rb +70 -0
  48. data/lib/metro/events/events.rb +3 -0
  49. data/lib/metro/events/has_events.rb +108 -0
  50. data/lib/metro/events/hit_list.rb +75 -0
  51. data/lib/metro/events/unknown_sender.rb +5 -0
  52. data/lib/metro/font.rb +69 -0
  53. data/lib/metro/game.rb +102 -0
  54. data/lib/metro/game/dsl.rb +68 -0
  55. data/lib/metro/image.rb +75 -0
  56. data/lib/metro/logging.rb +33 -0
  57. data/lib/metro/missing_scene.rb +21 -0
  58. data/lib/metro/models/audio/song.rb +33 -0
  59. data/lib/metro/models/draws.rb +86 -0
  60. data/lib/metro/models/key_value_coding.rb +38 -0
  61. data/lib/metro/models/model.rb +246 -0
  62. data/lib/metro/models/model_factory.rb +32 -0
  63. data/lib/metro/models/models.rb +62 -0
  64. data/lib/metro/models/properties/animation_property.rb +115 -0
  65. data/lib/metro/models/properties/array_property.rb +24 -0
  66. data/lib/metro/models/properties/boolean_property.rb +27 -0
  67. data/lib/metro/models/properties/color_property.rb +116 -0
  68. data/lib/metro/models/properties/dimensions_property.rb +84 -0
  69. data/lib/metro/models/properties/font_property.rb +130 -0
  70. data/lib/metro/models/properties/image_property.rb +96 -0
  71. data/lib/metro/models/properties/model_property.rb +84 -0
  72. data/lib/metro/models/properties/numeric_property.rb +29 -0
  73. data/lib/metro/models/properties/options_property/no_option.rb +29 -0
  74. data/lib/metro/models/properties/options_property/options.rb +98 -0
  75. data/lib/metro/models/properties/options_property/options_property.rb +125 -0
  76. data/lib/metro/models/properties/position_property.rb +90 -0
  77. data/lib/metro/models/properties/property.rb +221 -0
  78. data/lib/metro/models/properties/property_owner.rb +137 -0
  79. data/lib/metro/models/properties/sample_property.rb +84 -0
  80. data/lib/metro/models/properties/scale_property.rb +80 -0
  81. data/lib/metro/models/properties/song_property.rb +89 -0
  82. data/lib/metro/models/properties/text_property.rb +75 -0
  83. data/lib/metro/models/ui/animated_sprite.rb +85 -0
  84. data/lib/metro/models/ui/border.rb +95 -0
  85. data/lib/metro/models/ui/fps.rb +54 -0
  86. data/lib/metro/models/ui/generic.rb +66 -0
  87. data/lib/metro/models/ui/grid_drawer.rb +74 -0
  88. data/lib/metro/models/ui/image.rb +87 -0
  89. data/lib/metro/models/ui/label.rb +175 -0
  90. data/lib/metro/models/ui/menu.rb +214 -0
  91. data/lib/metro/models/ui/model_label.rb +65 -0
  92. data/lib/metro/models/ui/model_labeler.rb +79 -0
  93. data/lib/metro/models/ui/rectangle.rb +59 -0
  94. data/lib/metro/models/ui/sprite.rb +79 -0
  95. data/lib/metro/models/ui/tile_map.rb +132 -0
  96. data/lib/metro/models/ui/tmx/isometric_position.rb +43 -0
  97. data/lib/metro/models/ui/tmx/orthogonal_position.rb +15 -0
  98. data/lib/metro/models/ui/tmx/tile_layer.rb +78 -0
  99. data/lib/metro/models/ui/ui.rb +13 -0
  100. data/lib/metro/parameters/command_line_args_parser.rb +68 -0
  101. data/lib/metro/parameters/options.rb +25 -0
  102. data/lib/metro/parameters/parameters.rb +2 -0
  103. data/lib/metro/sample.rb +40 -0
  104. data/lib/metro/scene.rb +478 -0
  105. data/lib/metro/scenes.rb +154 -0
  106. data/lib/metro/song.rb +56 -0
  107. data/lib/metro/template_message.rb +60 -0
  108. data/lib/metro/transitions/edit_transition_scene.rb +100 -0
  109. data/lib/metro/transitions/fade_transition_scene.rb +66 -0
  110. data/lib/metro/transitions/scene_transitions.rb +44 -0
  111. data/lib/metro/transitions/transition_scene.rb +19 -0
  112. data/lib/metro/units/bounds.rb +8 -0
  113. data/lib/metro/units/calculation_validations.rb +74 -0
  114. data/lib/metro/units/dimensions.rb +60 -0
  115. data/lib/metro/units/point.rb +51 -0
  116. data/lib/metro/units/rectangle_bounds.rb +148 -0
  117. data/lib/metro/units/scale.rb +46 -0
  118. data/lib/metro/units/units.rb +6 -0
  119. data/lib/metro/version.rb +32 -0
  120. data/lib/metro/views/json_view.rb +60 -0
  121. data/lib/metro/views/no_view.rb +34 -0
  122. data/lib/metro/views/parsers.rb +42 -0
  123. data/lib/metro/views/scene_view.rb +107 -0
  124. data/lib/metro/views/view.rb +133 -0
  125. data/lib/metro/views/writers.rb +43 -0
  126. data/lib/metro/views/yaml_view.rb +94 -0
  127. data/lib/metro/window.rb +95 -0
  128. data/lib/setup_handlers/exit_if_dry_run.rb +26 -0
  129. data/lib/setup_handlers/game_execution.rb +65 -0
  130. data/lib/setup_handlers/load_game_configuration.rb +65 -0
  131. data/lib/setup_handlers/load_game_files.rb +101 -0
  132. data/lib/setup_handlers/move_to_game_directory.rb +25 -0
  133. data/lib/setup_handlers/reload_game_on_game_file_changes.rb +79 -0
  134. data/lib/templates/game/README.md.tt +43 -0
  135. data/lib/templates/game/assets/brand.jpg +0 -0
  136. data/lib/templates/game/assets/hero.png +0 -0
  137. data/lib/templates/game/lib/custom_easing.rb +32 -0
  138. data/lib/templates/game/metro.tt +63 -0
  139. data/lib/templates/game/models/hero.rb +62 -0
  140. data/lib/templates/game/scenes/brand_scene.rb +19 -0
  141. data/lib/templates/game/scenes/brand_to_title_scene.rb +13 -0
  142. data/lib/templates/game/scenes/first_scene.rb +28 -0
  143. data/lib/templates/game/scenes/game_scene.rb +43 -0
  144. data/lib/templates/game/scenes/title_scene.rb +15 -0
  145. data/lib/templates/game/views/brand.yaml +4 -0
  146. data/lib/templates/game/views/brand_to_title.yaml +8 -0
  147. data/lib/templates/game/views/first.yaml +26 -0
  148. data/lib/templates/game/views/title.yaml +11 -0
  149. data/lib/templates/message.erb +23 -0
  150. data/lib/templates/model.rb.tt +111 -0
  151. data/lib/templates/scene.rb.tt +140 -0
  152. data/lib/templates/view.yaml.tt +11 -0
  153. data/lib/tmx_ext/object.rb +26 -0
  154. data/lib/tmx_ext/tile_set.rb +41 -0
  155. data/metro.gemspec +57 -0
  156. data/metro.png +0 -0
  157. data/spec/core_ext/numeric_spec.rb +78 -0
  158. data/spec/core_ext/string_spec.rb +33 -0
  159. data/spec/gosu_ext/color_spec.rb +80 -0
  160. data/spec/metro/image_spec.rb +33 -0
  161. data/spec/metro/models/key_value_coding_spec.rb +61 -0
  162. data/spec/metro/models/properties/array_property_spec.rb +60 -0
  163. data/spec/metro/models/properties/color_property_spec.rb +85 -0
  164. data/spec/metro/models/properties/dimensions_spec.rb +29 -0
  165. data/spec/metro/models/properties/font_property_spec.rb +127 -0
  166. data/spec/metro/models/properties/numeric_property_spec.rb +46 -0
  167. data/spec/metro/models/properties/options_property/no_option_spec.rb +25 -0
  168. data/spec/metro/models/properties/options_property/options_property_spec.rb +133 -0
  169. data/spec/metro/models/properties/options_property/options_spec.rb +125 -0
  170. data/spec/metro/models/properties/position_property_spec.rb +90 -0
  171. data/spec/metro/models/ui/label_spec.rb +259 -0
  172. data/spec/metro/parameters/command_line_args_parser_spec.rb +42 -0
  173. data/spec/metro/scene_spec.rb +15 -0
  174. data/spec/metro/scene_views/json_view_spec.rb +27 -0
  175. data/spec/metro/scene_views/yaml_view_spec.rb +38 -0
  176. data/spec/metro/scenes_spec.rb +77 -0
  177. data/spec/metro/units/point_spec.rb +132 -0
  178. data/spec/metro/units/rectangle_bounds_spec.rb +56 -0
  179. data/spec/metro/views/view_spec.rb +53 -0
  180. data/spec/setup_handlers/exit_if_dry_run_spec.rb +27 -0
  181. data/spec/setup_handlers/reload_game_on_game_file_changes_spec.rb +68 -0
  182. data/spec/spec_helper.rb +20 -0
  183. data/spec/tmx_ext/object_spec.rb +96 -0
  184. data/spec/tmx_ext/tile_set_spec.rb +24 -0
  185. metadata +379 -0
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YTU1OTI4NDhhNmM2NmFkZDM2YjJlMGJhMjhmMmIxMmZiMmVlODczNA==
5
+ data.tar.gz: !binary |-
6
+ YWVmMzRkYTNmYzIxM2YwNmI0MTBlNTc2MWVlNGY3MTU4ZjQyYTU0Ng==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ M2VmMWMyNGM4ZWM4NTBlNDFkYTM1NzQ2MTcwYjg5NTZmMmE1YWJjNDdkMjcz
10
+ MzAxN2NiZGUzMDQxNDk5NGEzOTdmOTAzOTY2NDI0MjA2ZTI4YmNmODgzZDM2
11
+ MDU4NzQzMWM1Mjk0MTdhNWYxY2FiOWVjNzg1ODkwNGViM2JjOGE=
12
+ data.tar.gz: !binary |-
13
+ NjM0N2FiYmU3YTI4NTA1MmM2NGEzZmEyMDA3NjBkZjBkYjlmMTcyNTcyZWIy
14
+ ZmNmMDJiYmNlNzVmMDRjYjUzYjQ5Zjk3MDg5NzFlZmQyZmUwYmVkMDlkY2E0
15
+ Zjk3Mjc4ODY2ZjE5NTdkZGJhYWMzODQ5MGVmMGZhMzY4NTRkNzc=
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.2
4
+ - 1.9.3
5
+ before_install:
6
+ - sudo apt-get install build-essential freeglut3-dev libfreeimage-dev libgl1-mesa-dev libopenal-dev libpango1.0-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsndfile-dev libxinerama-dev
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in metro.gemspec
4
+ gemspec
5
+
6
+ gem 'chipmunk'
7
+
8
+ gem 'rake'
9
+
10
+ group 'development' do
11
+ gem 'guard'
12
+ gem 'guard-rspec'
13
+ gem 'rb-fsevent', '~> 0.9.1'
14
+ end
data/Guardfile ADDED
@@ -0,0 +1,4 @@
1
+ guard 'rspec', version: 2, cli: "-c -f d" do
2
+ watch(%r{^spec/.+_spec\.rb$})
3
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
4
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Franklin Webber
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,177 @@
1
+ ![Metro Image](metro.png)
2
+
3
+ Metro is a framework built around [gosu](https://github.com/jlnr/gosu) (the 2D
4
+ game development library in Ruby). The goal of Metro is to enforce common
5
+ conceptual structures and conventions making it easier to quickly generate a
6
+ game.
7
+
8
+ [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/burtlo/metro)
9
+
10
+ [![Build Status](https://travis-ci.org/burtlo/metro.png)](https://travis-ci.org/burtlo/metro)
11
+
12
+ [![Dependency Status](https://gemnasium.com/burtlo/metro.png)](https://gemnasium.com/burtlo/metro)
13
+
14
+ ## Why Use Metro?
15
+
16
+ You want to develop games in Ruby.
17
+
18
+ ### Why not just use Gosu?
19
+
20
+ Gosu does a lot of great work bringing OpenGL to Ruby. However, when you finish
21
+ the [initial tutorial](https://github.com/jlnr/gosu/wiki/Ruby-Tutorial) you are
22
+ left with a brittle game that is very resistant to changes or new features.
23
+
24
+ * Metro provides the concept of a
25
+ [Scene](https://github.com/burtlo/metro/wiki/Scenes) which is the first
26
+ abstraction you would likely build after completing the tutorial.
27
+
28
+ > Developing your game in individual scenes will make it easier to logically
29
+ layout your game.
30
+
31
+ * Sane management of images, animations, fonts, songs, and samples through
32
+ [model properties](https://github.com/burtlo/metro/wiki/Model-properties).
33
+
34
+ > Having to load and cache fonts and images in every one of your models is
35
+ tedious. It is also is wasteful as several of the same fonts are being used all
36
+ over the place.
37
+
38
+ * [Key-frame animations](https://github.com/burtlo/metro/wiki/Animations)
39
+
40
+ > Metro makes it simple to move an actor from one position to another position.
41
+ So simple movements, fades, color changes, and really any property change over
42
+ time is defined very simply.
43
+
44
+ * [Event Handling](https://github.com/burtlo/metro/wiki/Events)
45
+
46
+ > Delete those huge `if ... elsif ... else` input checking structures for
47
+ keyboard, gamepad, and mouse button presses (down,up, and held). Metro makes it
48
+ easy to define them and an attach a course of action to take when the event
49
+ happens.
50
+
51
+ ### Why not use Chingu or Gamebox?
52
+
53
+ Both [Gamebox](https://github.com/shawn42/gamebox) and
54
+ [Chingu](https://github.com/ippa/chingu) are more mature libraries with a
55
+ larger set of features. I encourage you to check out those libraries.
56
+
57
+ Metro's primary goal is to be a framework of features that make game development
58
+ joyful.
59
+
60
+ * Active Reloading while building your scenes.
61
+
62
+ > Adjustments to your game code while working on a scene will automatically
63
+ reload your game code. The template game sets up a shortcut key (**Ctrl+R**)
64
+ that allows you to explicitly reload the game and the current scene.
65
+
66
+ * Scene Edit Support
67
+
68
+ > Scenes can enter an edit mode which allows you to re-position actors within
69
+ the scene. The changes can then be saved back to the view. This allows you to
70
+ fine tune the layout of those scene elements, making it easier to get things
71
+ pixel perfect.
72
+
73
+ Metro's secondary goal is to make it easier for individuals familiar with Rails
74
+ get into game development. That is the reason for some of the design choices,
75
+ the opinionated structure, and generators that come with Metro.
76
+
77
+ ### Why you shouldn't use Metro?
78
+
79
+ Metro has some the following limitations:
80
+
81
+ * Limited to the gems defined within Metro
82
+
83
+ > At this point in time you are not able to define and package additional
84
+ dependencies with your game. This means if you are using a gem that is not
85
+ already defined by Metro you will run into trouble when running it on alternate
86
+ systems. This will likely be addressed in the future when more demand arises.
87
+
88
+ * Difficult Deployment
89
+
90
+ > For individuals to play your game, they will also have to install Metro.
91
+ However, work is being made to bring some simple packaging to Metro games to
92
+ make them stand-along executables.
93
+
94
+ ## Installation
95
+
96
+ ```bash
97
+ $ gem install metro
98
+ ```
99
+
100
+ ## Usage
101
+
102
+ ### Running a Game
103
+
104
+ By default `metro` will look for a file named 'metro' within the current working
105
+ directory if no *gamefilename* has been provided.
106
+
107
+ ```bash
108
+ $ metro GAMEFILENAME
109
+ ```
110
+
111
+ Please take a look at the [example game project](https://github.com/burtlo/starry-knight) that is being built alongside of 'metro'. It currently showcases all the current features available to the game.
112
+
113
+ ```bash
114
+ $ git clone git://github.com/burtlo/starry-knight.git
115
+ $ cd starry-knight
116
+ $ metro
117
+ ```
118
+
119
+ ### Creating a Game
120
+
121
+ Metro contains content generators to assist you.
122
+
123
+ Creating a Game can be done with a single command.
124
+
125
+ ```bash
126
+ $ metro new GAMENAME
127
+ ```
128
+
129
+ This should generate for you a starting game with a branding scene, title
130
+ scene and first game scene. The game allows the player to start the game.
131
+
132
+ ## Resources
133
+
134
+ ### Metro Documentation
135
+
136
+ The Metro [wiki](../../wiki) contains lots of documentation:
137
+
138
+ * [Game Configuration](wiki/game-configuration)
139
+ * [Scenes](../../wiki/scenes)
140
+ * [Views](../../wiki/views)
141
+ * [Animations](../../wiki/animations)
142
+ * [Scene Transitions](../../wiki/transitions)
143
+ * [Models](../../wiki/models)
144
+ * [Metro Models](../../wiki/metro-models)
145
+ * [Model Properties](../../wiki/properties)
146
+ * [Events](../../wiki/events)
147
+ * [Units](../../wiki/units)
148
+
149
+ ### Programming
150
+
151
+ * [YAML for Ruby](http://www.yaml.org/YAML_for_ruby.html) reference which can help you define views in the game.
152
+ * [JSONLint](http://jsonlint.com/) is a JSON Validator
153
+
154
+ ### Art
155
+
156
+ * [Lost Garden](http://www.lostgarden.com/2007/05/dancs-miraculously-flexible-game.html)
157
+ * [TimelineFX](http://www.rigzsoft.co.uk/) particle editor allows you to export animations.
158
+ * [Text to ASCII Art Generator](http://patorjk.com/software/taag)
159
+ * [Icons](http://css-tricks.com/flat-icons-icon-fonts/)
160
+ * [Subtle Patterns](http://subtlepatterns.com/) various backgrounds and textures.
161
+
162
+ ### Sound
163
+
164
+ * [as3sfxr](http://www.superflashbros.net/as3sfxr/) generates unique sounds.
165
+ * [Ableton](https://www.ableton.com/en/) music generation tool.
166
+
167
+ ### Books
168
+
169
+ * [Rules of Play](http://www.amazon.com/dp/0262240459)
170
+ * [Game Programming Gems 8](http://www.amazon.com/dp/1584507020)
171
+ * [Game Feel](http://www.amazon.com/dp/0123743281)
172
+ * [Game Coding Complete](http://www.amazon.com/dp/1584506806)
173
+ * [Game Design Workshop](http://www.amazon.com/dp/0240809742)
174
+ * [Challenges For Game Designers](http://www.amazon.com/dp/158450580X)
175
+ * [The Art of Game Design: A book of lenses](http://www.amazon.com/dp/0123694965)
176
+ * [A Theory of Fun](http://www.theoryoffun.com)
177
+ * [Andrew Rollings and Ernest Adams on Game Design](http://www.amazon.com/dp/1592730019)
data/Rakefile ADDED
@@ -0,0 +1,18 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ begin
4
+
5
+ require 'rspec/core/rake_task'
6
+
7
+ desc "Run all rspecs"
8
+ RSpec::Core::RakeTask.new(:spec) do |t|
9
+ t.pattern = 'spec/**/*_spec.rb'
10
+ t.rspec_opts = '-c'
11
+ end
12
+
13
+ task :default => :spec
14
+
15
+ rescue LoadError
16
+ puts "please install rspec to run tests"
17
+ puts "install with gem install rspec"
18
+ end
data/bin/metro ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ path = __FILE__
4
+ while File.symlink?(path)
5
+ path = File.expand_path(File.readlink(__FILE__), File.dirname(__FILE__))
6
+ end
7
+ $:.unshift(File.join(File.dirname(File.expand_path(path)), '..', 'lib'))
8
+
9
+ require 'metro'
10
+ require 'commands/thor'
11
+
12
+ if Metro::Thor.tasks.keys.include? ARGV.first
13
+ Metro::Thor.start
14
+ else
15
+ Metro.run(*ARGV)
16
+ end
data/changelog.md ADDED
@@ -0,0 +1,153 @@
1
+ # Metro
2
+
3
+ ## 0.3.4 / 2012-12-14
4
+
5
+ * `metro::ui::sprite` and `metro::ui::animated_sprite` model classes
6
+ to make it easier to take care of all the basic model attributes.
7
+ * Event Management changed in the background. The API remains the
8
+ same.
9
+
10
+ ## 0.3.3 / 2012-11-28
11
+
12
+ * Edit Mode - actors within a scene can have their position edited
13
+ and saved. Actors within the scene that have a valid bounds
14
+ specified will appear within the scene with name and bounding box.
15
+ * Dimensions can now be defined as strings
16
+ * Game bounds and Game dimensions return objects of that type
17
+ * `metro::ui::fps` added and has some shortcut placements settings
18
+
19
+ ## 0.3.2 / 2012-11-26
20
+
21
+ * Debug Mode will now automatically reload the game and scene on source
22
+ file changes.
23
+ * Reloading the game will no longer take down the app for syntax errors
24
+ and other errors that are easily detected by simply loading the code.
25
+ * Template game is now automatically has debug mode enabled by default
26
+
27
+ ## 0.3.1 / 2012-11-25
28
+
29
+ * FIX issue with some Gosu example code left in the oven
30
+
31
+ ## 0.3.0 / 2012-11-25
32
+
33
+ * FIX lots of typos in the documentation
34
+ * Removed `up_action_missing` and `down_ation_missing` event handling
35
+ * Notification events now have block support for 0, 1 and 2 parameters
36
+ * FIX Registration of custom defined custom view parsers
37
+ * FIX Grid Layer layout for Edit Mode
38
+
39
+
40
+ ## 0.2.7 / 2012/11-20
41
+
42
+ * FIX to the new game template
43
+ * Updated the game template to give more movement to the hero in the first scene
44
+ * Added the fade-in, fade-out helper to show all the instructions
45
+
46
+ ## 0.2.6 / 2012/11-20
47
+
48
+ * Menus now support vertical and horizontal layout
49
+ * Menus now support movement and selection noises
50
+ * Menus can now have a default selection
51
+ * Menus can be enabled/disabled
52
+ * Added Array Property, Boolean Property, and Menu Options Property
53
+ * FIX label horizontal center and right alignments
54
+ * Generic Models will now show a warning instead of raising an exception
55
+ * Removed event chain debug messaging
56
+
57
+ ## 0.2.5 / 2012-11-18
58
+
59
+ * FIX metro::ui::rectangle calculation
60
+ * FIX remaining references to metro::models::* to metro::ui::*
61
+ * FIX Models will use their setters over setting raw properties
62
+ * Metro::UI::Label now supports horizontal alignment, vertical alignment, and multiple lines
63
+
64
+ ## 0.2.4 / 2012-11-15
65
+
66
+ * All retrieved models from properties are now cached for better performance
67
+ * Animations were re-vamped to accept more parameters
68
+ * Metro models names in code are now referred to as "metro::models::*" to "metro::ui::*"
69
+
70
+ ## 0.2.3 / 2012-11-11
71
+
72
+ * FIX metro generators and templates generating out-of-date formats
73
+ * FIX YAML views will now return an empty hash instead of false on empty files
74
+ * Added first scene and model to template.
75
+ * FIX better error message when a directory is specified
76
+ * Added the `g` generator shortcut: `metro g scene NAME`
77
+
78
+ ## 0.2.2 / 2012-11-10
79
+
80
+ * Song support added (scene methods and model properties)
81
+ * Sample support added (model properties)
82
+ * Added a missing sample/song
83
+ * Implicit Animation easings can now be more easily created and registered.
84
+ * Properties can now be defined with a block
85
+ * FIX Dimensions parse creation called wrong method
86
+ * Removed support for specifying a color in animation
87
+
88
+ ## 0.2.1 / 2012-11-08
89
+
90
+ * FIX Scene fade transition color changing and implicit animations
91
+ for colors
92
+ * Games creating custom properties will appear in the property list
93
+ * Properties now correctly default to numeric properties
94
+ * Point objects can be added to other point objects.
95
+
96
+ ## 0.2.0 / 2012-11-07
97
+
98
+ * Views now use position instead of `x`, `y`, and `z-order`
99
+ * Point, Scale, and Dimensions is available in model and scenes.
100
+ * Events are shared from superclasses to subclasses.
101
+ * Templates updated to use GameScene and GameModel for each game.
102
+ * Models are automatically added to the update loop
103
+ * Model properties now make it easier to store/retrieve various
104
+ common numeric, position font, image, and animation properties.
105
+
106
+
107
+ ## 0.1.6 / 2012-11-07
108
+
109
+ * Events are shared from superclasses to subclasses.
110
+ * Templates updated to use GameScene and GameModel for each game.
111
+ * Models are automatically added to the update loop
112
+ * Model properties now make it easier to store/retrieve various
113
+ common numeric, position font, image, and animation properties.
114
+
115
+ ## 0.1.5 / 2012-11-01
116
+
117
+ * Metro.reload! will reload all game classes
118
+ * Scenes can now an editable state where the position of items can be
119
+ updated and saved.
120
+ * Event blocks can optionally receive an event object. The event object
121
+ includes modifier key information.
122
+
123
+
124
+ ## 0.1.4 / 2012-10-28
125
+
126
+ * Removed dependency on the sender gem so metro is playable on Windows
127
+
128
+ ## 0.1.3 / 2012-10-28
129
+
130
+ * Fade Scene Transition support added
131
+ * Numeric#seconds and Numeric#ticks helpers added
132
+ * Scenes can now define delayed events `after 2.seconds do ; end`
133
+ * Labels have more defaults and more font options and size
134
+ * Labels and images will default to center of screen
135
+ * Able to define game controls within your metro file
136
+ * Implicit animations support color change.
137
+
138
+ ## 0.1.2 / 2012-10-26
139
+
140
+ * Generators for games, scenes, models, and views
141
+
142
+ ## 0.1.1 / 2012-10-25
143
+
144
+ * FIX: Requiring the sender gem
145
+
146
+ ## 0.1.0 / 2012-10-25
147
+
148
+ * Better error handling for missing metro file and missing scene
149
+ * FIX: Scenes without Scene suffix will work again
150
+ * Gosu::Color supports creation with various formats: rgb, rgba, and hex
151
+ * Animations can be defined with class level helpers
152
+ * Removed Scene#events as Events can be defined at the class level
153
+ * Scenes and Models can generate custom notification events