pario 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/docs/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ /* Copyright (c) 2011 Bill Davenport
2
+ *
3
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ * of this software and associated documentation files (the "Software"), to deal
5
+ * in the Software without restriction, including without limitation the rights
6
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ * copies of the Software, and to permit persons to whom the Software is
8
+ * furnished to do so, subject to the following conditions:
9
+ *
10
+ * The above copyright notice and this permission notice shall be included in
11
+ * all copies or substantial portions of the Software.
12
+ *
13
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ * SOFTWARE.
20
+ */
data/lib/docs/README ADDED
@@ -0,0 +1,53 @@
1
+ == Welcome to Pario
2
+
3
+ Pario is a Gosu Game framework that helps to give you structure and a start for creating games.
4
+
5
+ == Getting Started
6
+
7
+ 1. At the command prompt, create a new Pario game
8
+ <tt>gosu create my_game</tt> (where <tt>my_game</tt> is the game name)
9
+
10
+ 2. Change the directory to <tt>myapp</tt> and start the game
11
+ <tt>gosu play</tt>
12
+
13
+ 3. NOT YET IMPLEMENTED: To create more classes for your game (which will appear in the game folder)
14
+ <tt>gosu add my_class</tt> (where <tt>my_class</tt> is the name of your class)
15
+
16
+ Also, just as <tt>create</tt>, subsequent words will become subclasses of the first named class.
17
+ However, the game folder will not create subfolders but relate the classes automatically.
18
+ <tt>gosu create my_class menu background</tt>
19
+
20
+ |-- my_class.rb
21
+ | |-- menu.rb
22
+ | `-- background.rb
23
+
24
+ == Learning Ruby
25
+
26
+ * Ruby4kids: http://www.ruby4kids.com
27
+ * HacketyHack: http://hackety-hack.com/
28
+ * Learn to Program: http://pine.fm/LearnToProgram/
29
+
30
+ These two resources will bring you up to speed on the Ruby language and also on
31
+ programming in general.
32
+
33
+ == Description of Contents
34
+
35
+ The default directory structure of a generated Pario application:
36
+
37
+ MyApp
38
+ |-- config
39
+ |-- game
40
+ |-- lib
41
+ |-- media
42
+
43
+ config
44
+ A basic configuration file is created for you. Configuration is a place where game setup information goes (like window size or fonts). Feel free to add to it.
45
+
46
+ game
47
+ Holds all of the code that's deals with your particular game.
48
+
49
+ lib
50
+ Contains any library or module you want to use to extend your game. Any files in here will be auto-loaded when your game starts.
51
+
52
+ media
53
+ A place to keep all of your images and sound files.
data/lib/pario/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pario #:nodoc:
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
data/lib/pario.rb CHANGED
@@ -4,7 +4,7 @@ require 'ostruct'
4
4
  require 'erb'
5
5
 
6
6
  class Pario
7
- Version = '0.3.2'
7
+ Version = '0.3.3'
8
8
  Directories = %w{game lib media config}
9
9
 
10
10
  attr_reader :options, :command, :game_name, :arguments
@@ -22,10 +22,10 @@ class Pario
22
22
 
23
23
  # Parse options, check arguments, then process the command
24
24
  def run
25
-
26
- if parsed_options? && arguments_valid?
25
+ if (parsed_options? && arguments_valid?) && !valid_pario_command?
27
26
  #TODO
28
- elsif valid_command?
27
+ elsif valid_pario_command?
28
+
29
29
  @command = arguments.delete_at(0)
30
30
  process_command
31
31
  else
@@ -87,7 +87,7 @@ class Pario
87
87
  puts "#{File.basename(__FILE__)} version #{Version}"
88
88
  end
89
89
 
90
- def valid_command?
90
+ def valid_pario_command?
91
91
  %w{create add play}.include? @command
92
92
  end
93
93
 
@@ -100,8 +100,11 @@ class Pario
100
100
  def create
101
101
  create_directories
102
102
  create_base_files
103
- # create_readme
104
- # create_licesnse
103
+ copy_files
104
+ end
105
+
106
+ def copy_files
107
+ # TODO copy over README, LICENSE and pario_background
105
108
  end
106
109
 
107
110
  # This will take ""
@@ -152,9 +155,21 @@ main_template.result(binding)
152
155
 
153
156
  def game_class
154
157
  game_template = ERB.new <<-EOF
155
- class #{game_name_upcase} < Gosu::Window
158
+ class #{game_name_upcase} < Main
156
159
  def initialize(window_width, window_height)
157
160
  super(window_width,window_height,0)
161
+ @background_image = background_image('media/pario_background.png')
162
+ end
163
+
164
+ def update
165
+ # Code to your object around goes here
166
+ # TODO: Need more details
167
+ end
168
+
169
+ def draw
170
+ @background_image.draw 0,0,0
171
+ # Code to draw what you see goes here
172
+ # TODO: Need more details
158
173
  end
159
174
  end
160
175
  EOF
data/pario.gemspec CHANGED
@@ -6,7 +6,7 @@ require 'pario/version'
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = 'pario'
9
- s.version = '0.3.2'
9
+ s.version = '0.3.3'
10
10
  s.platform = Gem::Platform::RUBY
11
11
  s.authors = ['Bill Davenport', 'Anthony Burns']
12
12
  s.email = ['bill@infoether.com', 'anthony@infoether.com']
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pario
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 2
10
- version: 0.3.2
9
+ - 3
10
+ version: 0.3.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bill Davenport
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-02-17 00:00:00 -05:00
19
+ date: 2011-02-18 00:00:00 -05:00
20
20
  default_executable: pario
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -49,6 +49,8 @@ files:
49
49
  - .gitignore
50
50
  - README.rdoc
51
51
  - bin/pario
52
+ - lib/docs/LICENSE
53
+ - lib/docs/README
52
54
  - lib/pario.rb
53
55
  - lib/pario/version.rb
54
56
  - pario.gemspec