chingu 0.7.6.9 → 0.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/chingu.gemspec +2 -2
- data/lib/chingu.rb +1 -1
- data/lib/chingu/basic_game_object.rb +2 -0
- data/lib/chingu/game_object.rb +2 -0
- data/lib/chingu/game_object_list.rb +5 -0
- data/lib/chingu/game_state.rb +3 -3
- data/lib/chingu/window.rb +3 -3
- metadata +5 -6
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.7.
|
8
|
+
s.version = "0.7.7"
|
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{2010-08-
|
12
|
+
s.date = %q{2010-08-19}
|
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 = [
|
data/lib/chingu.rb
CHANGED
@@ -125,6 +125,7 @@ module Chingu
|
|
125
125
|
def pause!
|
126
126
|
@paused = true
|
127
127
|
end
|
128
|
+
alias :pause :pause!
|
128
129
|
|
129
130
|
#
|
130
131
|
# Enable automatic calling of update() and update_trait() each game loop
|
@@ -132,6 +133,7 @@ module Chingu
|
|
132
133
|
def unpause!
|
133
134
|
@paused = false
|
134
135
|
end
|
136
|
+
alias :unpause :unpause!
|
135
137
|
|
136
138
|
#
|
137
139
|
# Returns true if paused
|
data/lib/chingu/game_object.rb
CHANGED
@@ -195,6 +195,7 @@ module Chingu
|
|
195
195
|
def hide!
|
196
196
|
@visible = false
|
197
197
|
end
|
198
|
+
alias :hide :hide!
|
198
199
|
|
199
200
|
#
|
200
201
|
# Enable automatic calling of draw and draw_trait each game loop
|
@@ -202,6 +203,7 @@ module Chingu
|
|
202
203
|
def show!
|
203
204
|
@visible = true
|
204
205
|
end
|
206
|
+
alias :show :show!
|
205
207
|
|
206
208
|
#
|
207
209
|
# Returns true if visible (not hidden)
|
@@ -112,6 +112,7 @@ module Chingu
|
|
112
112
|
def pause!
|
113
113
|
@game_objects.each { |object| object.pause! }
|
114
114
|
end
|
115
|
+
alias :pause :pause!
|
115
116
|
|
116
117
|
#
|
117
118
|
# Enable automatic calling of update() and update_trait() each game loop for all game objects
|
@@ -119,6 +120,7 @@ module Chingu
|
|
119
120
|
def unpause!
|
120
121
|
@game_objects.each { |object| object.unpause! }
|
121
122
|
end
|
123
|
+
alias :unpause :unpause!
|
122
124
|
|
123
125
|
#
|
124
126
|
# Disable automatic calling of draw and draw_trait each game loop for all game objects
|
@@ -126,6 +128,7 @@ module Chingu
|
|
126
128
|
def hide!
|
127
129
|
@game_objects.each { |object| object.hide! }
|
128
130
|
end
|
131
|
+
alias :hide :hide!
|
129
132
|
|
130
133
|
#
|
131
134
|
# Enable automatic calling of draw and draw_trait each game loop for all game objects
|
@@ -133,5 +136,7 @@ module Chingu
|
|
133
136
|
def show!
|
134
137
|
@game_objects.each { |object| object.show! }
|
135
138
|
end
|
139
|
+
alias :show :show!
|
140
|
+
|
136
141
|
end
|
137
142
|
end
|
data/lib/chingu/game_state.rb
CHANGED
@@ -153,7 +153,7 @@ module Chingu
|
|
153
153
|
#
|
154
154
|
def button_down(id)
|
155
155
|
dispatch_button_down(id, self)
|
156
|
-
@input_clients.each { |object| dispatch_button_down(id, object) } if @input_clients
|
156
|
+
@input_clients.each { |object| dispatch_button_down(id, object) unless object.paused? } if @input_clients
|
157
157
|
end
|
158
158
|
|
159
159
|
#
|
@@ -161,7 +161,7 @@ module Chingu
|
|
161
161
|
#
|
162
162
|
def button_up(id)
|
163
163
|
dispatch_button_up(id, self)
|
164
|
-
@input_clients.each { |object| dispatch_button_up(id, object) } if @input_clients
|
164
|
+
@input_clients.each { |object| dispatch_button_up(id, object) unless object.paused? } if @input_clients
|
165
165
|
end
|
166
166
|
|
167
167
|
#
|
@@ -170,7 +170,7 @@ module Chingu
|
|
170
170
|
def update
|
171
171
|
dispatch_input_for(self)
|
172
172
|
|
173
|
-
@input_clients.each { |game_object| dispatch_input_for(game_object) }
|
173
|
+
@input_clients.each { |game_object| dispatch_input_for(game_object) unless game_object.paused? }
|
174
174
|
|
175
175
|
@game_objects.update
|
176
176
|
end
|
data/lib/chingu/window.rb
CHANGED
@@ -133,7 +133,7 @@ module Chingu
|
|
133
133
|
#
|
134
134
|
# Dispatch input for all input-clients handled by to main window (game objects with input created in main win)
|
135
135
|
#
|
136
|
-
@input_clients.each { |game_object| dispatch_input_for(game_object) }
|
136
|
+
@input_clients.each { |game_object| dispatch_input_for(game_object) unless game_object.paused? }
|
137
137
|
|
138
138
|
|
139
139
|
#
|
@@ -176,7 +176,7 @@ module Chingu
|
|
176
176
|
#
|
177
177
|
def button_up(id)
|
178
178
|
dispatch_button_up(id, self)
|
179
|
-
@input_clients.each { |object| dispatch_button_up(id, object) }
|
179
|
+
@input_clients.each { |object| dispatch_button_up(id, object) unless object.paused? }
|
180
180
|
@game_state_manager.button_up(id)
|
181
181
|
end
|
182
182
|
|
@@ -186,7 +186,7 @@ module Chingu
|
|
186
186
|
#
|
187
187
|
def button_down(id)
|
188
188
|
dispatch_button_down(id, self)
|
189
|
-
@input_clients.each { |object| dispatch_button_down(id, object) }
|
189
|
+
@input_clients.each { |object| dispatch_button_down(id, object) unless object.paused? }
|
190
190
|
@game_state_manager.button_down(id)
|
191
191
|
end
|
192
192
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chingu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
|
11
|
-
version: 0.7.6.9
|
9
|
+
- 7
|
10
|
+
version: 0.7.7
|
12
11
|
platform: ruby
|
13
12
|
authors:
|
14
13
|
- ippa
|
@@ -16,7 +15,7 @@ autorequire:
|
|
16
15
|
bindir: bin
|
17
16
|
cert_chain: []
|
18
17
|
|
19
|
-
date: 2010-08-
|
18
|
+
date: 2010-08-19 00:00:00 +02:00
|
20
19
|
default_executable:
|
21
20
|
dependencies:
|
22
21
|
- !ruby/object:Gem::Dependency
|
@@ -43,7 +42,7 @@ dependencies:
|
|
43
42
|
requirements:
|
44
43
|
- - ">="
|
45
44
|
- !ruby/object:Gem::Version
|
46
|
-
hash: -
|
45
|
+
hash: -255155621
|
47
46
|
segments:
|
48
47
|
- 2
|
49
48
|
- 0
|