ruby-miyako-mswin32 2.1.0 → 2.1.1

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.
Files changed (59) hide show
  1. data/README +275 -20
  2. data/install_miyako.rb +5 -3
  3. data/lib/Miyako/API/audio.rb +11 -6
  4. data/lib/Miyako/API/basic_data.rb +0 -985
  5. data/lib/Miyako/API/bitmap.rb +19 -22
  6. data/lib/Miyako/API/choices.rb +203 -69
  7. data/lib/Miyako/API/collision.rb +451 -9
  8. data/lib/Miyako/API/color.rb +177 -0
  9. data/lib/Miyako/API/diagram.rb +18 -20
  10. data/lib/Miyako/API/fixedmap.rb +207 -73
  11. data/lib/Miyako/API/font.rb +111 -18
  12. data/lib/Miyako/API/i_yuki.rb +1201 -0
  13. data/lib/Miyako/API/input.rb +65 -0
  14. data/lib/Miyako/API/layout.rb +41 -29
  15. data/lib/Miyako/API/map.rb +202 -157
  16. data/lib/Miyako/API/map_event.rb +86 -19
  17. data/lib/Miyako/API/map_struct.rb +268 -0
  18. data/lib/Miyako/API/modules.rb +136 -37
  19. data/lib/Miyako/API/movie.rb +8 -8
  20. data/lib/Miyako/API/parts.rb +63 -20
  21. data/lib/Miyako/API/plane.rb +4 -4
  22. data/lib/Miyako/API/screen.rb +16 -8
  23. data/lib/Miyako/API/sprite.rb +290 -23
  24. data/lib/Miyako/API/sprite_animation.rb +23 -11
  25. data/lib/Miyako/API/sprite_list.rb +406 -183
  26. data/lib/Miyako/API/story.rb +4 -65
  27. data/lib/Miyako/API/struct_point.rb +157 -0
  28. data/lib/Miyako/API/struct_rect.rb +233 -0
  29. data/lib/Miyako/API/struct_segment.rb +641 -0
  30. data/lib/Miyako/API/struct_size.rb +158 -0
  31. data/lib/Miyako/API/struct_square.rb +253 -0
  32. data/lib/Miyako/API/textbox.rb +49 -35
  33. data/lib/Miyako/API/viewport.rb +5 -5
  34. data/lib/Miyako/API/wait_counter.rb +350 -0
  35. data/lib/Miyako/API/yuki.rb +95 -60
  36. data/lib/Miyako/EXT/raster_scroll.rb +30 -8
  37. data/lib/Miyako/EXT/slides.rb +6 -6
  38. data/lib/Miyako/miyako.rb +25 -11
  39. data/lib/Miyako/miyako_no_katana.so +0 -0
  40. data/lib/miyako.rb +28 -0
  41. data/lib/miyako_require_only.rb +35 -0
  42. data/sample/Diagram_sample/diagram_sample_yuki2.rb +30 -30
  43. data/sample/Room3/blue.rb +19 -19
  44. data/sample/Room3/green.rb +9 -9
  45. data/sample/Room3/main.rb +12 -12
  46. data/sample/Room3/red.rb +12 -12
  47. data/sample/Room3/title.rb +15 -10
  48. data/sample/collision_test2.rb +2 -1
  49. data/sample/fixed_map_test/fixed_map_sample.rb +7 -6
  50. data/sample/map_test/main_scene.rb +12 -10
  51. data/sample/map_test/map_manager.rb +14 -13
  52. data/sample/rasterscroll.rb +5 -5
  53. data/sample/takahashi.rb +3 -3
  54. data/sample/textbox_sample.rb +8 -5
  55. data/sample/transform.rb +2 -1
  56. data/uninstall_miyako.rb +4 -1
  57. metadata +13 -4
  58. data/lib/Miyako/EXT/miyako_cairo.rb +0 -62
  59. data/sample/cairo_sample.rb +0 -25
data/lib/Miyako/miyako.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  #=コンテンツ作成ライブラリMiyako2.1
4
4
  #
5
5
  #Authors:: サイロス誠
6
- #Version:: 2.1.0
6
+ #Version:: 2.1.1
7
7
  #Copyright:: 2007-2009 Cyross Makoto
8
8
  #License:: LGPL2.1
9
9
  #
@@ -60,7 +60,7 @@ Thread.abort_on_exception = true
60
60
 
61
61
  #==Miyako基幹モジュール
62
62
  module Miyako
63
- VERSION = "2.1.0"
63
+ VERSION = "2.1.1"
64
64
 
65
65
  #===アプリケーション実行中に演奏する音楽のサンプリングレートを指定する
66
66
  #単位はHz(周波数)
@@ -77,7 +77,7 @@ module Miyako
77
77
  def Miyako::version
78
78
  return VERSION
79
79
  end
80
-
80
+
81
81
  osn = Config::CONFIG["target_os"].downcase
82
82
  @@osName = "other"
83
83
  case osn
@@ -88,7 +88,7 @@ module Miyako
88
88
  when /darwin/
89
89
  @@osName = "mac_osx"
90
90
  end
91
-
91
+
92
92
  #===実行しているOSの名前を取得する
93
93
  #(Windows 9x/Me/Xp/Vista, Cygwin/MinGW) : "win"
94
94
  #(Linux) : "linux"
@@ -98,7 +98,7 @@ module Miyako
98
98
  def Miyako::getOSName
99
99
  return @@osName
100
100
  end
101
-
101
+
102
102
  #===ウィンドウのタイトルを設定する
103
103
  #_title_:: 設定する文字列
104
104
  def Miyako::setTitle(title)
@@ -117,18 +117,26 @@ end
117
117
 
118
118
  require 'Miyako/API/exceptions'
119
119
  require 'Miyako/API/utility'
120
+ require 'Miyako/API/struct_point'
121
+ require 'Miyako/API/struct_size'
122
+ require 'Miyako/API/struct_rect'
123
+ require 'Miyako/API/struct_square'
124
+ require 'Miyako/API/struct_segment'
125
+ require 'Miyako/API/color'
126
+ require 'Miyako/API/wait_counter'
120
127
  require 'Miyako/API/basic_data'
121
128
  require 'Miyako/API/modules'
129
+ require 'Miyako/API/layout'
122
130
  require 'Miyako/API/yuki'
131
+ require 'Miyako/API/i_yuki'
123
132
  require 'Miyako/API/font'
124
133
  require 'Miyako/API/viewport'
125
- require 'Miyako/API/layout'
126
134
  require 'Miyako/API/bitmap'
127
135
  require 'Miyako/API/drawing'
128
136
  require 'Miyako/API/spriteunit'
129
137
  require 'Miyako/API/sprite_animation'
130
- require 'Miyako/API/sprite'
131
138
  require 'Miyako/API/sprite_list'
139
+ require 'Miyako/API/sprite'
132
140
  require 'Miyako/API/collision'
133
141
  require 'Miyako/API/screen'
134
142
  require 'Miyako/API/shape'
@@ -139,6 +147,7 @@ require 'Miyako/API/movie'
139
147
  require 'Miyako/API/parts'
140
148
  require 'Miyako/API/choices'
141
149
  require 'Miyako/API/textbox'
150
+ require 'Miyako/API/map_struct'
142
151
  require 'Miyako/API/map'
143
152
  require 'Miyako/API/fixedmap'
144
153
  require 'Miyako/API/map_event'
@@ -150,16 +159,21 @@ module Miyako
150
159
 
151
160
  #===Miyakoのメインループ
152
161
  #ブロックを受け取り、そのブロックを評価する
153
- #ブロック評価前に<i>Audio::update</i>と<i>Input::update</i>、<i>Screen::clear</i>、評価後に<i>Screen::render</i>を呼び出す
162
+ #ブロック評価前に<i>Audio::update</i>と<i>Input::update</i>、<i>WaitCounter::update</i>、
163
+ #<i>Screen::clear</i>、評価後に<i>WaitCounter::post_update</i>、<i>Animation::update</i>、
164
+ #<i>Screen::render</i>を呼び出す
154
165
  #
155
166
  #ブロックを渡さないと例外が発生する
156
- def Miyako.main_loop
167
+ def Miyako.main_loop(is_clear = true)
157
168
  raise MiyakoError, "Miyako.main_loop needs brock!" unless block_given?
158
169
  loop do
159
170
  Audio.update
160
171
  Input.update
161
- Screen.clear
172
+ WaitCounter.update
173
+ Screen.clear if is_clear
162
174
  yield
175
+ WaitCounter.post_update
176
+ Animation.update
163
177
  Screen.render
164
178
  end
165
179
  end
@@ -179,7 +193,7 @@ module Miyako
179
193
  def Miyako.initialized?
180
194
  @@initialized
181
195
  end
182
-
196
+
183
197
  #===Miyakoの初期化
184
198
  #画面初期化や音声初期化などのメソッドを呼び出す。
185
199
  #グローバル変数$miyako_auto_openがtrueのときは最初に自動的に呼び出される。
Binary file
data/lib/miyako.rb ADDED
@@ -0,0 +1,28 @@
1
+ # -*- encoding: utf-8 -*-
2
+ #
3
+ #=コンテンツ作成ライブラリMiyako2.1
4
+ #
5
+ #Authors:: サイロス誠
6
+ #Version:: 2.1.0
7
+ #Copyright:: 2007-2009 Cyross Makoto
8
+ #License:: LGPL2.1
9
+ #
10
+ =begin
11
+ Miyako v2.1
12
+ Copyright (C) 2007-2008 Cyross Makoto
13
+
14
+ This library is free software; you can redistribute it and/or
15
+ modify it under the terms of the GNU Lesser General Public
16
+ License as published by the Free Software Foundation; either
17
+ version 2.1 of the License, or (at your option) any later version.
18
+
19
+ This library is distributed in the hope that it will be useful,
20
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22
+ Lesser General Public License for more details.
23
+
24
+ You should have received a copy of the GNU Lesser General Public
25
+ License along with this library; if not, write to the Free Software
26
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27
+ =end
28
+ require 'Miyako/miyako'
@@ -0,0 +1,35 @@
1
+ # -*- encoding: utf-8 -*-
2
+ #
3
+ #=コンテンツ作成ライブラリMiyako2.1
4
+ #
5
+ #Authors:: サイロス誠
6
+ #Version:: 2.1.0
7
+ #Copyright:: 2007-2009 Cyross Makoto
8
+ #License:: LGPL2.1
9
+ #
10
+ =begin
11
+ Miyako v2.1
12
+ Copyright (C) 2007-2008 Cyross Makoto
13
+
14
+ This library is free software; you can redistribute it and/or
15
+ modify it under the terms of the GNU Lesser General Public
16
+ License as published by the Free Software Foundation; either
17
+ version 2.1 of the License, or (at your option) any later version.
18
+
19
+ This library is distributed in the hope that it will be useful,
20
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22
+ Lesser General Public License for more details.
23
+
24
+ You should have received a copy of the GNU Lesser General Public
25
+ License along with this library; if not, write to the Free Software
26
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27
+ =end
28
+
29
+ # 初期化を行わずにrequire 'Miyako/miyako'のみ行う
30
+
31
+ $miyako_auto_open = false
32
+
33
+ require 'Miyako/miyako'
34
+
35
+ $miyako_auto_open = nil
@@ -3,19 +3,19 @@
3
3
  # Diagram sample for Miyako v2.0
4
4
  # 2009.1.16 Cyross Makoto
5
5
 
6
- require 'Miyako/miyako'
6
+ require 'miyako'
7
7
 
8
8
  include Miyako
9
9
 
10
10
  # 移動が遅いスクロール
11
11
  class MoveSlower
12
12
  include Diagram::NodeBase
13
-
13
+
14
14
  def initialize(spr)
15
15
  @spr = spr
16
16
  @finish = false # 終了フラグ
17
17
  end
18
-
18
+
19
19
  def start
20
20
  @spr.move_to!(640, @spr.y) # 画面を出たところまで移動
21
21
  end
@@ -29,7 +29,7 @@ class MoveSlower
29
29
  def render
30
30
  @spr.render
31
31
  end
32
-
32
+
33
33
  def finish?
34
34
  return @finish
35
35
  end
@@ -38,12 +38,12 @@ end
38
38
  # 移動が速いスクロール
39
39
  class MoveFaster
40
40
  include Diagram::NodeBase
41
-
41
+
42
42
  def initialize(spr)
43
43
  @spr = spr
44
44
  @finish = false # 終了フラグ
45
45
  end
46
-
46
+
47
47
  def start
48
48
  @spr.move_to!(640, @spr.y) # 画面を出たところまで移動
49
49
  end
@@ -57,7 +57,7 @@ class MoveFaster
57
57
  def render
58
58
  @spr.render
59
59
  end
60
-
60
+
61
61
  def finish?
62
62
  return @finish
63
63
  end
@@ -69,19 +69,19 @@ class WaitTrigger
69
69
  def initialize(wait=0.1)
70
70
  @timer = WaitCounter.new(wait)
71
71
  end
72
-
72
+
73
73
  def pre_process
74
74
  @timer.start
75
75
  end
76
-
76
+
77
77
  def update?
78
78
  @timer.finish?
79
79
  end
80
-
80
+
81
81
  def post_update
82
82
  @timer.start
83
83
  end
84
-
84
+
85
85
  def post_process
86
86
  @timer.stop
87
87
  end
@@ -90,7 +90,7 @@ end
90
90
  # 移動アニメーションノード
91
91
  class Moving
92
92
  include Diagram::NodeBase
93
-
93
+
94
94
  def initialize(parts, wait)
95
95
  @parts = parts
96
96
  @pr = {}
@@ -98,7 +98,7 @@ class Moving
98
98
  dia.add :scroll, MoveFaster.new(@parts[:c1]), WaitTrigger.new(wait)
99
99
  dia.add_arrow(:scroll, nil)
100
100
  }
101
-
101
+
102
102
  @pr[:slow] = Diagram::Processor.new{|dia|
103
103
  dia.add :scroll, MoveSlower.new(@parts[:c2]), WaitTrigger.new(wait)
104
104
  dia.add_arrow(:scroll, nil)
@@ -115,13 +115,13 @@ class Moving
115
115
  @finished = @pr.keys.inject(true){|r, k|
116
116
  @pr[k].update
117
117
  r &= @pr[k].finish?
118
- } # アニメーション処理が終了するまで繰り返し
118
+ } # アニメーション処理が終了するまで繰り返し
119
119
  end
120
120
 
121
121
  def stop
122
122
  @pr.keys.each{|k| @pr[k].stop }
123
123
  end
124
-
124
+
125
125
  def render
126
126
  @parts[:bk].render
127
127
  # 通常なら。@pr[:fast].render,@pr[:slow].renderが筋だが、
@@ -129,7 +129,7 @@ class Moving
129
129
  @parts[:c1].render
130
130
  @parts[:c2].render
131
131
  end
132
-
132
+
133
133
  def finish?
134
134
  return @finished
135
135
  end
@@ -138,7 +138,7 @@ end
138
138
  # Yukiプロット開始
139
139
  class StartPlot
140
140
  include Diagram::NodeBase
141
-
141
+
142
142
  def initialize(manager, parts, imgs)
143
143
  @manager = manager
144
144
  @parts = parts
@@ -157,13 +157,13 @@ class StartPlot
157
157
 
158
158
  def stop
159
159
  end
160
-
160
+
161
161
  def render
162
162
  @imgs[:bk].render
163
163
  @imgs[:c1].render
164
164
  @imgs[:c2].render
165
165
  end
166
-
166
+
167
167
  def finish?
168
168
  return @finished
169
169
  end
@@ -172,7 +172,7 @@ end
172
172
  # Yukiプロット実行
173
173
  class Plotting
174
174
  include Diagram::NodeBase
175
-
175
+
176
176
  def initialize(manager, parts, imgs, set_wait)
177
177
  @manager = manager
178
178
  @parts = parts
@@ -202,10 +202,10 @@ class Plotting
202
202
  @manager.render
203
203
  @parts.render
204
204
  end
205
-
205
+
206
206
  def stop
207
207
  end
208
-
208
+
209
209
  def finish?
210
210
  return @finished
211
211
  end
@@ -240,13 +240,13 @@ class MainScene
240
240
 
241
241
  @yuki = Yuki.new
242
242
  @yuki.update_text = self.method(:update_text)
243
-
243
+
244
244
  @imgs = {}
245
245
  @imgs[:c1] = Sprite.new(:file=>"chr01.png", :type=>:ac).bottom!
246
246
  @imgs[:c2] = Sprite.new(:file=>"chr02.png", :type=>:ac).bottom!
247
247
  @imgs[:bk] = Sprite.new(:file=>"back.png", :type=>:as).centering!
248
248
 
249
-
249
+
250
250
  @pr = Diagram::Processor.new{|dia|
251
251
  dia.add :move, Moving.new(@imgs, 0.01)
252
252
  dia.add :start, StartPlot.new(@yuki, @parts, @imgs)
@@ -268,7 +268,7 @@ class MainScene
268
268
  select_first_page nil # nil, :page1, :page2が選択可能
269
269
  }
270
270
  end
271
-
271
+
272
272
  def update
273
273
  return nil if Input.quit_or_escape?
274
274
  @pr.update_input
@@ -276,11 +276,11 @@ class MainScene
276
276
  return nil if @pr.finish?
277
277
  return @now
278
278
  end
279
-
279
+
280
280
  def render
281
281
  @pr.render
282
282
  end
283
-
283
+
284
284
  def plot
285
285
  yuki_plot{
286
286
  text_method :string do
@@ -307,7 +307,7 @@ class MainScene
307
307
  end
308
308
  }
309
309
  end
310
-
310
+
311
311
  def update_text(yuki, ch)
312
312
  yuki.wait @wait # 1文字ずつ表示させる
313
313
  end
@@ -319,11 +319,11 @@ class MainScene
319
319
  def reset_wait
320
320
  @wait = @base_wait
321
321
  end
322
-
322
+
323
323
  def final
324
324
  @pr.stop
325
325
  end
326
326
  end
327
327
 
328
328
  ds = Story.new
329
- ds.run(MainScene)
329
+ ds.run(MainScene)
data/sample/Room3/blue.rb CHANGED
@@ -48,34 +48,34 @@ class Blue
48
48
  end
49
49
  return r
50
50
  end
51
-
51
+
52
52
  def render
53
53
  @room.render
54
54
  @yuki.render
55
55
  message_box.render
56
56
  command_box.render if @yuki.selecting?
57
57
  end
58
-
58
+
59
59
  def get_command
60
- return [Yuki::Command.new("挨拶する", nil, lambda{var[:aoyama_aisatsu]==false}, blue2),
61
- Yuki::Command.new("辺りを見る", nil, lambda{var[:aoyama_aisatsu]==true}, look_blue),
62
- Yuki::Command.new("話す", nil, lambda{var[:aoyama_aisatsu]==true}, talk),
63
- Yuki::Command.new("渡す", nil, lambda{var[:aoyama_aisatsu]==true && var[:release_aoyama_book]==true && var[:release_akamatsu_book]==false}, send1),
64
- Yuki::Command.new("探す", nil, lambda{var[:search_bookmark]==true && var[:get_bookmark]==false}, search),
65
- Yuki::Command.new("戻る", nil, lambda{var[:aoyama_aisatsu]==true}, MainScene)]
60
+ return [Yuki::Command.new("挨拶する", nil, nil, true, lambda{var[:aoyama_aisatsu]==false}, blue2),
61
+ Yuki::Command.new("辺りを見る", nil, nil, true, lambda{var[:aoyama_aisatsu]==true}, look_blue),
62
+ Yuki::Command.new("話す", nil, nil, true, lambda{var[:aoyama_aisatsu]==true}, talk),
63
+ Yuki::Command.new("渡す", nil, nil, true, lambda{var[:aoyama_aisatsu]==true && var[:release_aoyama_book]==true && var[:release_akamatsu_book]==false}, send1),
64
+ Yuki::Command.new("探す", nil, nil, true, lambda{var[:search_bookmark]==true && var[:get_bookmark]==false}, search),
65
+ Yuki::Command.new("戻る", nil, nil, true, lambda{var[:aoyama_aisatsu]==true}, MainScene)]
66
66
  end
67
-
67
+
68
68
  def get_search
69
- return [Yuki::Command.new("壁", nil, nil, wall),
70
- Yuki::Command.new("テレビ", nil, nil, tv),
71
- Yuki::Command.new("テレビ台", nil, nil, tv_base),
72
- Yuki::Command.new("ビデオデッキ", nil, lambda{var[:look_video_base] == true}, video),
73
- Yuki::Command.new("テレビゲーム機", nil, lambda{var[:look_video_base] == true}, tv_game),
74
- Yuki::Command.new("ソファー", nil, nil, sofar),
75
- Yuki::Command.new("ベッド", nil, nil, bed),
76
- Yuki::Command.new("戻る", nil, nil, "ret")]
69
+ return [Yuki::Command.new("壁", nil, nil, true, nil, wall),
70
+ Yuki::Command.new("テレビ", nil, nil, true, nil, tv),
71
+ Yuki::Command.new("テレビ台", nil, nil, true, nil, tv_base),
72
+ Yuki::Command.new("ビデオデッキ", nil, nil, true, lambda{var[:look_video_base] == true}, video),
73
+ Yuki::Command.new("テレビゲーム機", nil, nil, true, lambda{var[:look_video_base] == true}, tv_game),
74
+ Yuki::Command.new("ソファー", nil, nil, true, nil, sofar),
75
+ Yuki::Command.new("ベッド", nil, nil, true, nil, bed),
76
+ Yuki::Command.new("戻る", nil, nil, true, nil, "ret")]
77
77
  end
78
-
78
+
79
79
  def plot
80
80
  yuki_plot do
81
81
  text "青の扉から中に入った。"
@@ -88,7 +88,7 @@ class Blue
88
88
  vars[:main_command]
89
89
  end
90
90
  end
91
-
91
+
92
92
  def main_command
93
93
  yuki_plot do
94
94
  loop do
@@ -19,7 +19,7 @@ class Green
19
19
  var[:midori_talk] = 0 if var[:midori_talk] == nil
20
20
 
21
21
  @talks = Array.new(6){|i| self.method("talk#{i}".to_sym).call}
22
-
22
+
23
23
  @yuki.vars[:var] = var
24
24
  @yuki.vars[:main_command] = main_command
25
25
  @yuki.vars[:command] = get_command
@@ -45,21 +45,21 @@ class Green
45
45
  end
46
46
  return r
47
47
  end
48
-
48
+
49
49
  def render
50
50
  @room.render
51
51
  @yuki.render
52
52
  message_box.render
53
53
  command_box.render if @yuki.selecting?
54
54
  end
55
-
55
+
56
56
  def get_command
57
- return [Yuki::Command.new("挨拶する", nil, lambda{var[:midori_aisatsu]==false}, green2),
58
- Yuki::Command.new("辺りを見る", nil, lambda{var[:midori_aisatsu]==true}, look_green),
59
- Yuki::Command.new("話す", nil, lambda{var[:midori_aisatsu]==true}, talk),
60
- Yuki::Command.new("戻る", nil, lambda{var[:midori_aisatsu]==true}, MainScene)]
57
+ return [Yuki::Command.new("挨拶する", nil, nil, true, lambda{var[:midori_aisatsu]==false}, green2),
58
+ Yuki::Command.new("辺りを見る", nil, nil, true, lambda{var[:midori_aisatsu]==true}, look_green),
59
+ Yuki::Command.new("話す", nil, nil, true, lambda{var[:midori_aisatsu]==true}, talk),
60
+ Yuki::Command.new("戻る", nil, nil, true, lambda{var[:midori_aisatsu]==true}, MainScene)]
61
61
  end
62
-
62
+
63
63
  def plot
64
64
  yuki_plot do
65
65
  text "緑の扉から中に入った。"
@@ -72,7 +72,7 @@ class Green
72
72
  vars[:main_command]
73
73
  end
74
74
  end
75
-
75
+
76
76
  def main_command
77
77
  yuki_plot do
78
78
  loop do
data/sample/Room3/main.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  class MainScene
3
3
  include Story::Scene
4
4
  include MainComponent
5
-
5
+
6
6
  def init
7
7
  @yuki = Yuki.new(message_box[:box], command_box[:box]){|box, cbox|
8
8
  select_textbox(box)
@@ -31,7 +31,7 @@ class MainScene
31
31
  command_box.start
32
32
  @yuki.start_plot(plot)
33
33
  end
34
-
34
+
35
35
  def update
36
36
  return nil if Input.quit_or_escape?
37
37
  message_box.update_animation
@@ -41,15 +41,15 @@ class MainScene
41
41
  @yuki.start_plot(plot) if (@yuki.executing? == false && r == @now)
42
42
  return r
43
43
  end
44
-
44
+
45
45
  def get_command
46
- return [Yuki::Command.new("緑の扉から入る", nil, nil, Green),
47
- Yuki::Command.new("赤の扉から入る", nil, lambda{var[:sekkaku] == true }, red_sekkaku),
48
- Yuki::Command.new("赤の扉から入る", nil, lambda{var[:sekkaku] == false}, Red),
49
- Yuki::Command.new("青の扉から入る", nil, nil, Blue),
50
- Yuki::Command.new("合い言葉を言う", nil, lambda{var[:aikotoba] == true}, tell_aikotoba)]
46
+ return [Yuki::Command.new("緑の扉から入る", nil, nil, true, nil, Green),
47
+ Yuki::Command.new("赤の扉から入る", nil, nil, true, lambda{var[:sekkaku] == true }, red_sekkaku),
48
+ Yuki::Command.new("赤の扉から入る", nil, nil, true, lambda{var[:sekkaku] == false}, Red),
49
+ Yuki::Command.new("青の扉から入る", nil, nil, true, nil, Blue),
50
+ Yuki::Command.new("合い言葉を言う", nil, nil, true, lambda{var[:aikotoba] == true}, tell_aikotoba)]
51
51
  end
52
-
52
+
53
53
  def plot
54
54
  yuki_plot{
55
55
  ret = vars[:now]
@@ -68,7 +68,7 @@ class MainScene
68
68
 
69
69
  def main_command
70
70
  end
71
-
71
+
72
72
  def red_sekkaku
73
73
  yuki_plot{
74
74
  text "せっかくだから、赤の扉に入ってみよう"
@@ -76,7 +76,7 @@ class MainScene
76
76
  vars[:red]
77
77
  }
78
78
  end
79
-
79
+
80
80
  def tell_aikotoba
81
81
  yuki_plot{
82
82
  text "「こんなゲーム、"
@@ -88,7 +88,7 @@ class MainScene
88
88
  vars[:ending]
89
89
  }
90
90
  end
91
-
91
+
92
92
  def render
93
93
  @doors.render
94
94
  message_box.render
data/sample/Room3/red.rb CHANGED
@@ -24,7 +24,7 @@ class Red
24
24
  var[:release_akamatsu_book] = false if var[:release_akamatsu_book] == nil
25
25
  var[:search_bookmark] = false if var[:search_bookmark] == nil
26
26
  var[:get_bookmark] = false if var[:get_bookmark] == nil
27
-
27
+
28
28
  @yuki.vars[:var] = var
29
29
  @yuki.vars[:command] = get_command
30
30
  @yuki.vars[:main_loop] = main_loop
@@ -36,16 +36,16 @@ class Red
36
36
  command_box.start
37
37
  @yuki.start_plot(plot)
38
38
  end
39
-
39
+
40
40
  def get_command
41
- return [Yuki::Command.new("挨拶する", nil, lambda{var[:akamatsu_aisatsu] == false}, red2),
42
- Yuki::Command.new("辺りを見る", nil, lambda{var[:akamatsu_aisatsu]==true }, look),
43
- Yuki::Command.new("話す", nil, lambda{var[:akamatsu_aisatsu]==true }, talk),
44
- Yuki::Command.new("渡す", nil, lambda{var[:akamatsu_aisatsu] && var[:release_akamatsu_book] && var[:search_bookmark]==false}, send1),
45
- Yuki::Command.new("渡す", nil, lambda{var[:search_bookmark] && var[:get_bookmark] && var[:aikotoba]==false}, send2),
46
- Yuki::Command.new("戻る", nil, lambda{var[:akamatsu_aisatsu]==true}, MainScene)]
41
+ return [Yuki::Command.new("挨拶する", nil, nil, true, lambda{var[:akamatsu_aisatsu] == false}, red2),
42
+ Yuki::Command.new("辺りを見る", nil, nil, true, lambda{var[:akamatsu_aisatsu]==true }, look),
43
+ Yuki::Command.new("話す", nil, nil, true, lambda{var[:akamatsu_aisatsu]==true }, talk),
44
+ Yuki::Command.new("渡す", nil, nil, true, lambda{var[:akamatsu_aisatsu] && var[:release_akamatsu_book] && var[:search_bookmark]==false}, send1),
45
+ Yuki::Command.new("渡す", nil, nil, true, lambda{var[:search_bookmark] && var[:get_bookmark] && var[:aikotoba]==false}, send2),
46
+ Yuki::Command.new("戻る", nil, nil, true, lambda{var[:akamatsu_aisatsu]==true}, MainScene)]
47
47
  end
48
-
48
+
49
49
  def update
50
50
  return nil if Input.quit_or_escape?
51
51
  message_box.update_animation
@@ -65,7 +65,7 @@ class Red
65
65
  message_box.render
66
66
  command_box.render if @yuki.selecting?
67
67
  end
68
-
68
+
69
69
  def plot
70
70
  yuki_plot do
71
71
  text "赤の扉から中に入った。"
@@ -78,7 +78,7 @@ class Red
78
78
  vars[:main_loop]
79
79
  end
80
80
  end
81
-
81
+
82
82
  def main_loop
83
83
  yuki_plot do
84
84
  loop do
@@ -219,7 +219,7 @@ class Red
219
219
  message_box.stop
220
220
  command_box.stop
221
221
  end
222
-
222
+
223
223
  def dispose
224
224
  @akamatsu.dispose
225
225
  @room.dispose