chingu 0.6.8 → 0.6.9

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ begin
14
14
  gemspec.rubyforge_project = "chingu"
15
15
  gemspec.version = Chingu::VERSION
16
16
 
17
- gemspec.add_dependency 'gosu', '>= 0.7.15'
17
+ gemspec.add_dependency 'gosu', '>= 0.7.17'
18
18
  end
19
19
  Jeweler::GemcutterTasks.new
20
20
  rescue LoadError
data/chingu.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{chingu}
8
- s.version = "0.6.8"
8
+ s.version = "0.6.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["ippa"]
12
- s.date = %q{2009-12-27}
12
+ s.date = %q{2010-01-05}
13
13
  s.description = %q{OpenGL accelerated 2D game framework for Ruby. Builds on Gosu (Ruby/C++) which provides all the core functionality. Chingu adds simple yet powerful game states, prettier input handling, deployment safe asset-handling, a basic re-usable game object and stackable game logic.}
14
14
  s.email = %q{ippa@rubylicio.us}
15
15
  s.extra_rdoc_files = [
@@ -20,7 +20,6 @@ Gem::Specification.new do |s|
20
20
  ".gitignore",
21
21
  "History.txt",
22
22
  "LICENSE",
23
- "Manifest.txt",
24
23
  "README.rdoc",
25
24
  "Rakefile",
26
25
  "benchmarks/README.txt",
@@ -156,12 +155,12 @@ Gem::Specification.new do |s|
156
155
  s.specification_version = 3
157
156
 
158
157
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
159
- s.add_runtime_dependency(%q<gosu>, [">= 0.7.15"])
158
+ s.add_runtime_dependency(%q<gosu>, [">= 0.7.17"])
160
159
  else
161
- s.add_dependency(%q<gosu>, [">= 0.7.15"])
160
+ s.add_dependency(%q<gosu>, [">= 0.7.17"])
162
161
  end
163
162
  else
164
- s.add_dependency(%q<gosu>, [">= 0.7.15"])
163
+ s.add_dependency(%q<gosu>, [">= 0.7.17"])
165
164
  end
166
165
  end
167
166
 
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env ruby
1
2
  require 'rubygems'
2
3
  require 'opengl'
3
4
  require File.join(File.dirname($0), "..", "lib", "chingu")
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env ruby
1
2
  require 'rubygems'
2
3
  require 'opengl'
3
4
  require File.join(File.dirname($0), "..", "lib", "chingu")
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env ruby
1
2
  require 'rubygems'
2
3
  require File.join(File.dirname($0), "..", "lib", "chingu")
3
4
  include Gosu
@@ -21,9 +22,6 @@ class Cube < GameObject
21
22
 
22
23
  def initialize(options)
23
24
  super
24
- @white = Color.new(0xFFFFFFFF)
25
- @red = Color.new(0xFFFF0000)
26
- @blue = Color.new(0xFF0000FF)
27
25
  self.input = { :left => :left, :right => :right, :up => :up, :down => :down,
28
26
  :space => :shake1, :return => :shake2 }
29
27
  end
@@ -37,13 +35,13 @@ class Cube < GameObject
37
35
  end
38
36
 
39
37
  def up
40
- @color = @red
41
- during(500) { @y -= 1 }.then { @color = @white }
38
+ @color = Color::RED
39
+ during(500) { @y -= 1 }.then { @color = Color::WHITE }
42
40
  end
43
41
 
44
42
  def down
45
- @color = @blue
46
- during(500) { @y += 1 }.then { @color = @white }
43
+ @color = Color::BLUE
44
+ during(500) { @y += 1 }.then { @color = Color::WHITE }
47
45
  end
48
46
 
49
47
  def shake1
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env ruby
1
2
  require 'rubygems'
2
3
  require File.join(File.dirname($0), "..", "lib", "chingu")
3
4
  include Gosu
@@ -65,9 +66,6 @@ end
65
66
  #
66
67
  class PulsatingText < Text
67
68
  has_traits :timer, :effect
68
- @@red = Color.new(0xFFFF0000)
69
- @@green = Color.new(0xFF00FF00)
70
- @@blue = Color.new(0xFF0000FF)
71
69
 
72
70
  def initialize(text, options = {})
73
71
  super(text, options)
@@ -80,7 +78,7 @@ class PulsatingText < Text
80
78
 
81
79
  def create_pulse
82
80
  pulse = PulsatingText.create(@text, :x => @x, :y => @y, :height => @height, :pulse => true, :image => @image, :zorder => @zorder+1)
83
- colors = [@@red, @@green, @@blue]
81
+ colors = [Color::RED, Color::GREEN, Color::BLUE]
84
82
  pulse.color = colors[rand(colors.size)].dup
85
83
  pulse.mode = :additive
86
84
  pulse.alpha -= 150
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env ruby
1
2
  require 'rubygems'
2
3
  require File.join(File.dirname($0), "..", "lib", "chingu")
3
4
  include Gosu
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env ruby
1
2
  require 'rubygems'
2
3
  require File.join(File.dirname($0), "..", "lib", "chingu")
3
4
  include Gosu
@@ -19,14 +20,15 @@ class Stuff < GameState
19
20
 
20
21
  def initialize(options = {})
21
22
  super
22
- self.input = {:t => :toggle, :"1" => :fast, :"2" => :slow}
23
+ self.input = {:s => :stop, :"1" => :fast, :"2" => :slow}
23
24
  @thing = Thing.create(:x => $window.width/2, :y => $window.height / 2 )
24
25
 
25
26
  every(500, :name => :blink) { @thing.visible? ? @thing.hide! : @thing.show! }
26
27
  p timer_exists?(:blink)
28
+ $window.caption = "Timer-usage. 's' to stop timer, '1' for fast timer, '2' for slow timer"
27
29
  end
28
30
 
29
- def toggle
31
+ def stop
30
32
  stop_timer(:name => :blink)
31
33
  end
32
34
 
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env ruby
1
2
  require 'rubygems'
2
3
  require File.join(File.dirname($0), "..", "lib", "chingu")
3
4
  include Gosu
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env ruby
1
2
  require 'rubygems'
2
3
  require File.join(File.dirname($0), "..", "lib", "chingu")
3
4
  include Gosu
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env ruby
1
2
  require 'rubygems'
2
3
  require File.join(File.dirname($0), "..", "lib", "chingu")
3
4
  include Gosu
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env ruby
1
2
  require 'rubygems'
2
3
  require File.join(File.dirname($0), "..", "lib", "chingu")
3
4
  include Gosu
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env ruby
1
2
  require 'rubygems'
2
3
  require File.join(File.dirname($0), "..", "lib", "chingu")
3
4
  include Gosu
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env ruby
1
2
  require 'rubygems'
2
3
  require File.join(File.dirname($0), "..", "lib", "chingu")
3
4
  include Gosu
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env ruby
1
2
  require 'rubygems'
2
3
  require File.join(File.dirname($0), "..", "lib", "chingu")
3
4
  include Gosu
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env ruby
1
2
  require 'rubygems'
2
3
  require File.join(File.dirname($0), "..", "lib", "chingu")
3
4
  include Gosu
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env ruby
1
2
  require 'rubygems'
2
3
  require File.join(File.dirname($0), "..", "lib", "chingu")
3
4
  include Gosu
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env ruby
1
2
  require 'rubygems'
2
3
  require File.join(File.dirname($0), "..", "lib", "chingu")
3
4
  include Gosu
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env ruby
1
2
  require 'rubygems'
2
3
  require File.join(File.dirname($0), "..", "lib", "chingu")
3
4
  include Gosu
data/examples/game1.rb CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env ruby
1
2
  #
2
3
  #
3
4
  # A "full" simple game in Chingu, using GameState, GameObject, Paralaxx, has_traits etc
data/lib/chingu.rb CHANGED
@@ -33,7 +33,7 @@ require_all "#{CHINGU_ROOT}/chingu/traits"
33
33
  require_all "#{CHINGU_ROOT}/chingu"
34
34
 
35
35
  module Chingu
36
- VERSION = "0.6.8"
36
+ VERSION = "0.6.9"
37
37
 
38
38
  DEBUG_COLOR = Gosu::Color.new(0xFFFF0000)
39
39
  DEBUG_ZORDER = 9999
@@ -29,6 +29,10 @@ module Chingu
29
29
  # It will make call new() on a class, and just push an object.
30
30
  #
31
31
  module GameState
32
+ def game_states
33
+ game_state_manager.game_states
34
+ end
35
+
32
36
  def push_game_state(state, options = {})
33
37
  #$window.game_state_manager.push_game_state(state, options)
34
38
  game_state_manager.push_game_state(state, options)
data/lib/chingu/input.rb CHANGED
@@ -21,8 +21,8 @@
21
21
 
22
22
  module Chingu
23
23
  module Input
24
- include Gosu::Button
25
-
24
+ include Gosu
25
+
26
26
  #
27
27
  # Ruby symbols describing http://www.libgosu.org/rdoc/classes/Gosu.html
28
28
  #
@@ -50,6 +50,8 @@ module Chingu
50
50
  ## puts "Effect#setup_trait(#{options})"
51
51
  @rotation_rate = options[:rotation_rate] || nil
52
52
  @scale_rate = options[:scale_rate] || nil
53
+ @scale_x_rate = options[:scale_x_rate] || nil
54
+ @scale_y_rate = options[:scale_y_rate] || nil
53
55
  @fade_rate = options[:fade_rate] || nil
54
56
  super
55
57
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chingu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.8
4
+ version: 0.6.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - ippa
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-27 00:00:00 +01:00
12
+ date: 2010-01-05 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 0.7.15
23
+ version: 0.7.17
24
24
  version:
25
25
  description: OpenGL accelerated 2D game framework for Ruby. Builds on Gosu (Ruby/C++) which provides all the core functionality. Chingu adds simple yet powerful game states, prettier input handling, deployment safe asset-handling, a basic re-usable game object and stackable game logic.
26
26
  email: ippa@rubylicio.us
@@ -35,7 +35,6 @@ files:
35
35
  - .gitignore
36
36
  - History.txt
37
37
  - LICENSE
38
- - Manifest.txt
39
38
  - README.rdoc
40
39
  - Rakefile
41
40
  - benchmarks/README.txt
data/Manifest.txt DELETED
@@ -1,102 +0,0 @@
1
- History.txt
2
- LICENSE
3
- Manifest.txt
4
- README.rdoc
5
- Rakefile
6
- benchmarks/README.txt
7
- benchmarks/benchmark.rb
8
- benchmarks/benchmark3.rb
9
- benchmarks/benchmark4.rb
10
- benchmarks/benchmark5.rb
11
- benchmarks/benchmark6.rb
12
- benchmarks/meta_benchmark.rb
13
- benchmarks/meta_benchmark2.rb
14
- chingu.gemspec
15
- examples/example1.rb
16
- examples/example10.rb
17
- examples/example11.rb
18
- examples/example12.rb
19
- examples/example13.rb
20
- examples/example14.rb
21
- examples/example15.rb
22
- examples/example16.rb
23
- examples/example2.rb
24
- examples/example3.rb
25
- examples/example4.rb
26
- examples/example5.rb
27
- examples/example6.rb
28
- examples/example7.rb
29
- examples/example8.rb
30
- examples/example9.rb
31
- examples/game1.rb
32
- examples/high_score_list.yml
33
- examples/media/Parallax-scroll-example-layer-0.png
34
- examples/media/Parallax-scroll-example-layer-1.png
35
- examples/media/Parallax-scroll-example-layer-2.png
36
- examples/media/Parallax-scroll-example-layer-3.png
37
- examples/media/background1.png
38
- examples/media/bullet.png
39
- examples/media/bullet_hit.wav
40
- examples/media/circle.png
41
- examples/media/city1.csv
42
- examples/media/city1.png
43
- examples/media/city2.png
44
- examples/media/droid.bmp
45
- examples/media/enemy_bullet.png
46
- examples/media/explosion.wav
47
- examples/media/fire_bullet.png
48
- examples/media/fireball.png
49
- examples/media/laser.wav
50
- examples/media/particle.png
51
- examples/media/plane.csv
52
- examples/media/plane.png
53
- examples/media/rect.png
54
- examples/media/ruby.png
55
- examples/media/saucer.csv
56
- examples/media/saucer.gal
57
- examples/media/saucer.png
58
- examples/media/spaceship.png
59
- examples/media/stickfigure.bmp
60
- examples/media/stickfigure.png
61
- examples/media/video_games.png
62
- examples/media/wood.png
63
- lib/chingu.rb
64
- lib/chingu/animation.rb
65
- lib/chingu/assets.rb
66
- lib/chingu/basic_game_object.rb
67
- lib/chingu/core_ext/array.rb
68
- lib/chingu/fpscounter.rb
69
- lib/chingu/game_object.rb
70
- lib/chingu/game_object_list.rb
71
- lib/chingu/game_state.rb
72
- lib/chingu/game_state_manager.rb
73
- lib/chingu/game_states/debug.rb
74
- lib/chingu/game_states/edit.rb
75
- lib/chingu/game_states/fade_to.rb
76
- lib/chingu/game_states/pause.rb
77
- lib/chingu/gosu_ext/image.rb
78
- lib/chingu/helpers/class_inheritable_accessor.rb
79
- lib/chingu/helpers/game_object.rb
80
- lib/chingu/helpers/game_state.rb
81
- lib/chingu/helpers/gfx.rb
82
- lib/chingu/helpers/input_client.rb
83
- lib/chingu/helpers/input_dispatcher.rb
84
- lib/chingu/helpers/rotation_center.rb
85
- lib/chingu/high_score_list.rb
86
- lib/chingu/inflector.rb
87
- lib/chingu/input.rb
88
- lib/chingu/named_resource.rb
89
- lib/chingu/online_high_score_list.rb
90
- lib/chingu/parallax.rb
91
- lib/chingu/particle.rb
92
- lib/chingu/rect.rb
93
- lib/chingu/require_all.rb
94
- lib/chingu/text.rb
95
- lib/chingu/traits/bounding_box.rb
96
- lib/chingu/traits/bounding_circle.rb
97
- lib/chingu/traits/collision_detection.rb
98
- lib/chingu/traits/effect.rb
99
- lib/chingu/traits/retrofy.rb
100
- lib/chingu/traits/timer.rb
101
- lib/chingu/traits/velocity.rb
102
- lib/chingu/window.rb