cyross-ruby-miyako 2.0.0
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/README +977 -0
- data/Rakefile +7 -0
- data/img/cursor.png +0 -0
- data/img/cursors.png +0 -0
- data/img/dice.png +0 -0
- data/img/wait_cursor.png +0 -0
- data/img/win_base.png +0 -0
- data/img/window.png +0 -0
- data/install_miyako.rb +75 -0
- data/lib/Miyako/API/audio.rb +198 -0
- data/lib/Miyako/API/basic_data.rb +431 -0
- data/lib/Miyako/API/bitmap.rb +35 -0
- data/lib/Miyako/API/choices.rb +308 -0
- data/lib/Miyako/API/collision.rb +444 -0
- data/lib/Miyako/API/diagram.rb +573 -0
- data/lib/Miyako/API/drawing.rb +110 -0
- data/lib/Miyako/API/fixedmap.rb +315 -0
- data/lib/Miyako/API/font.rb +384 -0
- data/lib/Miyako/API/input.rb +440 -0
- data/lib/Miyako/API/layout.rb +451 -0
- data/lib/Miyako/API/map.rb +403 -0
- data/lib/Miyako/API/map_event.rb +198 -0
- data/lib/Miyako/API/modules.rb +109 -0
- data/lib/Miyako/API/movie.rb +151 -0
- data/lib/Miyako/API/parts.rb +154 -0
- data/lib/Miyako/API/plane.rb +131 -0
- data/lib/Miyako/API/screen.rb +257 -0
- data/lib/Miyako/API/shape.rb +362 -0
- data/lib/Miyako/API/sprite.rb +338 -0
- data/lib/Miyako/API/sprite_animation.rb +461 -0
- data/lib/Miyako/API/spriteunit.rb +113 -0
- data/lib/Miyako/API/story.rb +224 -0
- data/lib/Miyako/API/textbox.rb +496 -0
- data/lib/Miyako/API/viewport.rb +435 -0
- data/lib/Miyako/API/yuki.rb +779 -0
- data/lib/Miyako/EXT/miyako_cairo.rb +60 -0
- data/lib/Miyako/EXT/raster_scroll.rb +138 -0
- data/lib/Miyako/EXT/slides.rb +136 -0
- data/lib/Miyako/miyako.rb +172 -0
- data/miyako.png +0 -0
- data/miyako_banner.png +0 -0
- data/miyako_no_katana/extconf.rb +34 -0
- data/miyako_no_katana/miyako_no_katana.c +3301 -0
- data/sample/Animation1/m1ku.rb +89 -0
- data/sample/Animation1/m1ku_arm_0.png +0 -0
- data/sample/Animation1/m1ku_arm_1.png +0 -0
- data/sample/Animation1/m1ku_arm_2.png +0 -0
- data/sample/Animation1/m1ku_arm_3.png +0 -0
- data/sample/Animation1/m1ku_back.jpg +0 -0
- data/sample/Animation1/m1ku_body.png +0 -0
- data/sample/Animation1/m1ku_eye_0.png +0 -0
- data/sample/Animation1/m1ku_eye_1.png +0 -0
- data/sample/Animation1/m1ku_eye_2.png +0 -0
- data/sample/Animation1/m1ku_eye_3.png +0 -0
- data/sample/Animation1/m1ku_hair_front.png +0 -0
- data/sample/Animation1/m1ku_hair_rear.png +0 -0
- data/sample/Animation1/readme.txt +72 -0
- data/sample/Animation2/lex.rb +95 -0
- data/sample/Animation2/lex_back.png +0 -0
- data/sample/Animation2/lex_body.png +0 -0
- data/sample/Animation2/lex_roadroller.png +0 -0
- data/sample/Animation2/lex_wheel_0.png +0 -0
- data/sample/Animation2/lex_wheel_1.png +0 -0
- data/sample/Animation2/lex_wheel_2.png +0 -0
- data/sample/Animation2/readme.txt +72 -0
- data/sample/Animation2/song_title.png +0 -0
- data/sample/Diagram_sample/back.png +0 -0
- data/sample/Diagram_sample/chr01.png +0 -0
- data/sample/Diagram_sample/chr02.png +0 -0
- data/sample/Diagram_sample/cursor.png +0 -0
- data/sample/Diagram_sample/diagram_sample_yuki2.rb +283 -0
- data/sample/Diagram_sample/readme.txt +87 -0
- data/sample/Diagram_sample/wait_cursor.png +0 -0
- data/sample/Room3/blue.rb +250 -0
- data/sample/Room3/ending.rb +175 -0
- data/sample/Room3/green.rb +185 -0
- data/sample/Room3/image/akamatsu.png +0 -0
- data/sample/Room3/image/aoyama.png +0 -0
- data/sample/Room3/image/congra.png +0 -0
- data/sample/Room3/image/congratulation.png +0 -0
- data/sample/Room3/image/congratulation_bg.png +0 -0
- data/sample/Room3/image/cursor.png +0 -0
- data/sample/Room3/image/midori.png +0 -0
- data/sample/Room3/image/mittsu_no_oheya.png +0 -0
- data/sample/Room3/image/mittsu_no_oheya_logo.png +0 -0
- data/sample/Room3/image/room_blue.png +0 -0
- data/sample/Room3/image/room_green.png +0 -0
- data/sample/Room3/image/room_red.png +0 -0
- data/sample/Room3/image/start.png +0 -0
- data/sample/Room3/image/three_doors.png +0 -0
- data/sample/Room3/image/wait_cursor.png +0 -0
- data/sample/Room3/main.rb +102 -0
- data/sample/Room3/main_component.rb +58 -0
- data/sample/Room3/readme.txt +76 -0
- data/sample/Room3/red.rb +200 -0
- data/sample/Room3/room3.rb +26 -0
- data/sample/Room3/title.rb +171 -0
- data/sample/fixed_map_test/cursor.png +0 -0
- data/sample/fixed_map_test/fixed_map_sample.rb +149 -0
- data/sample/fixed_map_test/map.csv +19 -0
- data/sample/fixed_map_test/map_01.png +0 -0
- data/sample/fixed_map_test/map_sample.rb +121 -0
- data/sample/fixed_map_test/mapchip.csv +23 -0
- data/sample/fixed_map_test/monster.png +0 -0
- data/sample/fixed_map_test/readme.txt +72 -0
- data/sample/map_test/chara.rb +50 -0
- data/sample/map_test/chr1.png +0 -0
- data/sample/map_test/cursor.png +0 -0
- data/sample/map_test/main_parts.rb +48 -0
- data/sample/map_test/main_scene.rb +137 -0
- data/sample/map_test/map.png +0 -0
- data/sample/map_test/map2.png +0 -0
- data/sample/map_test/map_layer.csv +127 -0
- data/sample/map_test/map_manager.rb +92 -0
- data/sample/map_test/map_test.rb +23 -0
- data/sample/map_test/mapchip.csv +21 -0
- data/sample/map_test/oasis.rb +65 -0
- data/sample/map_test/readme.txt +87 -0
- data/sample/map_test/route.rb +144 -0
- data/sample/map_test/sea.png +0 -0
- data/sample/map_test/town.rb +68 -0
- data/sample/map_test/wait_cursor.png +0 -0
- data/sample/map_test/window.png +0 -0
- data/win/miyako_no_katana.so +0 -0
- metadata +194 -0
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,102 @@
|
|
1
|
+
class MainScene
|
2
|
+
include Story::Scene
|
3
|
+
include MainComponent
|
4
|
+
|
5
|
+
def init
|
6
|
+
@yuki = Yuki.new
|
7
|
+
@yuki.select_textbox(message_box[:box])
|
8
|
+
@yuki.select_commandbox(command_box[:box])
|
9
|
+
@doors = Sprite.new(:file=>"image/three_doors.png", :type=>:as)
|
10
|
+
@doors.center.bottom
|
11
|
+
|
12
|
+
var[:sekkaku] = true if var[:sekkaku] == nil
|
13
|
+
var[:aikotoba] = false if var[:aikotoba] == nil
|
14
|
+
end
|
15
|
+
|
16
|
+
def setup
|
17
|
+
@yuki.setup
|
18
|
+
message_box.start
|
19
|
+
command_box.start
|
20
|
+
@yuki.exec_plot(self.method(:plot))
|
21
|
+
end
|
22
|
+
|
23
|
+
def update
|
24
|
+
return nil if Input.quit_or_escape?
|
25
|
+
message_box.update_animation
|
26
|
+
command_box.update_animation
|
27
|
+
@yuki.update
|
28
|
+
r = @yuki.executing? ? @now : @yuki.result
|
29
|
+
@yuki.exec_plot(self.method(:plot)) if (@yuki.executing? == false && r == @now)
|
30
|
+
return r
|
31
|
+
end
|
32
|
+
|
33
|
+
def get_command
|
34
|
+
return [Yuki::Command.new("緑の扉から入る", nil, nil, Green),
|
35
|
+
Yuki::Command.new("赤の扉から入る", nil, lambda{var[:sekkaku] == true }, self.method(:red_sekkaku)),
|
36
|
+
Yuki::Command.new("赤の扉から入る", nil, lambda{var[:sekkaku] == false}, Red),
|
37
|
+
Yuki::Command.new("青の扉から入る", nil, nil, Blue),
|
38
|
+
Yuki::Command.new("合い言葉を言う", nil, lambda{var[:aikotoba] == true}, self.method(:tell_aikotoba))]
|
39
|
+
end
|
40
|
+
|
41
|
+
def plot(yuki)
|
42
|
+
ret = @now
|
43
|
+
yuki.text "目の前には緑、赤、青の3つの扉がある。"
|
44
|
+
yuki.cr
|
45
|
+
yuki.text "どうする?"
|
46
|
+
yuki.cr
|
47
|
+
yuki.command get_command
|
48
|
+
ret = yuki.select_result if yuki.is_scene?(yuki.select_result)
|
49
|
+
ret = yuki.select_result.call(yuki) if yuki.is_scenario?(yuki.select_result)
|
50
|
+
yuki.clear
|
51
|
+
var[:sekkaku] = false
|
52
|
+
return ret
|
53
|
+
end
|
54
|
+
|
55
|
+
def main_command
|
56
|
+
end
|
57
|
+
|
58
|
+
def red_sekkaku(yuki)
|
59
|
+
yuki.text "せっかくだから、赤の扉に入ってみよう"
|
60
|
+
yuki.pause.clear
|
61
|
+
return Red
|
62
|
+
end
|
63
|
+
|
64
|
+
def tell_aikotoba(yuki)
|
65
|
+
yuki.text "「こんなゲーム、"
|
66
|
+
yuki.wait 0.5
|
67
|
+
yuki.text "まじになっちゃって "
|
68
|
+
yuki.wait 0.5
|
69
|
+
yuki.text "どうするの!」"
|
70
|
+
yuki.pause.clear
|
71
|
+
return Ending
|
72
|
+
end
|
73
|
+
|
74
|
+
def render
|
75
|
+
@doors.render
|
76
|
+
message_box.render
|
77
|
+
command_box.render if @yuki.selecting?
|
78
|
+
end
|
79
|
+
|
80
|
+
def final
|
81
|
+
message_box.stop
|
82
|
+
command_box.stop
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
class Blue
|
87
|
+
include Story::Scene
|
88
|
+
|
89
|
+
def update
|
90
|
+
return nil if Input.quit_or_escape?
|
91
|
+
return @now
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
class Green
|
96
|
+
include Story::Scene
|
97
|
+
|
98
|
+
def update
|
99
|
+
return nil if Input.quit_or_escape?
|
100
|
+
return @now
|
101
|
+
end
|
102
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# 共通部品クラス
|
2
|
+
# メッセージテキストボックス、コマンドボックスを定義
|
3
|
+
module MainComponent
|
4
|
+
def self.create_textbox(size, font, color)
|
5
|
+
# ポーズカーソル作成
|
6
|
+
wc = Sprite.new(:file=>"image/wait_cursor.png", :type=>:ac)
|
7
|
+
wc.oh = wc.w
|
8
|
+
wc = SpriteAnimation.new(:sprite => wc, :wait => 0.2, :pattern_list => [0, 1, 2, 3, 2, 1])
|
9
|
+
|
10
|
+
# 選択カーソル作成
|
11
|
+
sc = Sprite.new(:file=>"image/cursor.png", :type=>:ac)
|
12
|
+
sc.oh = sc.w
|
13
|
+
sc = SpriteAnimation.new(:sprite => sc, :wait => 0.2, :pattern_list => [0, 1, 2, 3, 2, 1])
|
14
|
+
|
15
|
+
tb = TextBox.new(:size=>size, :font=>font, :wait_cursor=>wc, :select_cursor=>sc)
|
16
|
+
tb.pause_type = :out # ウェイトカーソルとボックスの真下に
|
17
|
+
|
18
|
+
bg = Sprite.new(:size=>tb.size, :type=>:ac)
|
19
|
+
bg.fill(color)
|
20
|
+
|
21
|
+
box = Parts.new(bg.size)
|
22
|
+
box[:bg] = bg
|
23
|
+
box[:bg].centering
|
24
|
+
box[:box] = tb
|
25
|
+
box[:box].centering
|
26
|
+
|
27
|
+
return box
|
28
|
+
end
|
29
|
+
|
30
|
+
# 共通変数
|
31
|
+
@@vars = { }
|
32
|
+
|
33
|
+
def var
|
34
|
+
return @@vars
|
35
|
+
end
|
36
|
+
|
37
|
+
# フォント作成
|
38
|
+
font = Font.sans_serif
|
39
|
+
font.size = 24
|
40
|
+
font.use_shadow = true
|
41
|
+
|
42
|
+
# メッセージボックス作成
|
43
|
+
@@message_box = self.create_textbox(Size.new(24, 4), font, [0, 0, 255, 128])
|
44
|
+
@@message_box.center.bottom{|body| (0.1).ratio(body) }
|
45
|
+
|
46
|
+
@@command_box = self.create_textbox(Size.new( 8, 4), font, [0, 255, 0, 128])
|
47
|
+
@@command_box.right{|body| (0.05).ratio(body) }.top{|body| (0.05).ratio(body) }
|
48
|
+
|
49
|
+
# メッセージボックスを動かさないこと前提
|
50
|
+
def message_box
|
51
|
+
return @@message_box
|
52
|
+
end
|
53
|
+
|
54
|
+
# メッセージボックスを動かさないこと前提
|
55
|
+
def command_box
|
56
|
+
return @@command_box
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
*******************************************************************************
|
2
|
+
�y ��Җ� �z�@�T�C���X��
|
3
|
+
�y �\�t�g�� �z�@Miyako v1.5�T���v��(�A�h�x���`���[�Q�[���u�݂��̕����v)
|
4
|
+
�y �o�[�W���� �z�@1.0
|
5
|
+
�y �쐬�� �z�@2008/03/22
|
6
|
+
�y ��� �z�@�t���[�E�F�A
|
7
|
+
�y �J������ �z�@Ruby 1.8.6-p111
|
8
|
+
�y �����^�C�� �z�@Miyako v1.5(pre4-)
|
9
|
+
�y �Ή��@�� �z�@Windows 2000/XP/Vista�ALinux
|
10
|
+
�y �Ĕz�z �z�@�C��BSD���C�Z���X�ɂ��
|
11
|
+
�y �]�� �z�@�C��BSD���C�Z���X�ɂ��
|
12
|
+
�y�z�[���y�[�W�z�@http://www.twin.ne.jp/~cyross/Miyako/
|
13
|
+
�y �A���� �z�@cyross@po.twin.ne.jp
|
14
|
+
*******************************************************************************
|
15
|
+
|
16
|
+
�E�T�v
|
17
|
+
|
18
|
+
�@���̃v���O�����́AMiyako v1.5(pre4)�ȍ~�ɑΉ�����AMiyako�T���v���v���O�����ł��B
|
19
|
+
�@�A�h�x���`���[�Q�[����V�Ԃ��Ƃ��ł��܂��B
|
20
|
+
�@�Ƃ���e���r�ԑg�̃Q�[���R�[�i�[�A�R�̕����̌������ɂ���A��ؓ�ł͂����Ȃ��ʁX���ǂ��ɂ����āA�N���A�ɕK�v�ȁu�������t�v�������o���Ă��������B
|
21
|
+
|
22
|
+
�EMiyako�ɂ���
|
23
|
+
|
24
|
+
�@Miyako�Ɋւ��ẮA�ȉ���URL���Q�l�ɂ��Ă��������B
|
25
|
+
(���C���T�C�g)
|
26
|
+
http://www.twin.ne.jp/~cyross/Miyako/
|
27
|
+
(Wiki)
|
28
|
+
http://wiki.fdiary.net/MiyakoDevSrc/
|
29
|
+
|
30
|
+
�@Miyako(Ruby�ARuby/SDL�܂�)�̃C���X�g�[���Ɋւ��܂��ẮA
|
31
|
+
��LURL��H���ē�����A�[�J�C�u���ꂽMiyako���C�u������
|
32
|
+
�W�J����ƁAreadme.txt�������܂��̂ŁA����������Q�Ɖ������B
|
33
|
+
|
34
|
+
�@�{�T���v���ł́AMiyako��Windows��œ��삷�邱�Ƃ�O��ɂ��Ă��܂��B
|
35
|
+
�i�C���X�g�[������Ruby���s����ActiveRuby�ł��邱�Ƃ��O���
|
36
|
+
�@���Ă��܂��j
|
37
|
+
|
38
|
+
�E�N�����@
|
39
|
+
|
40
|
+
�@�G�N�X�v���[���[���J���A�{�T���v���̃t�H���_���ŁA�uroom3.rb�v��
|
41
|
+
�_�u���N���b�N���܂��B
|
42
|
+
�@�������́A�R�}���h���C����œ������ꍇ�́A�{�T���v���̃f�B���N�g����
|
43
|
+
�ړ����āA�ȉ��̃R�}���h����͂��܂��B
|
44
|
+
|
45
|
+
�@ruby room3.rb
|
46
|
+
|
47
|
+
�E�Ɛӎ���
|
48
|
+
|
49
|
+
�@�{�T���v���͖��ۏł��B�����{�T���v�����g�p���邱�Ƃɂ��s��E�g���u��
|
50
|
+
���N�������Ƃ��Ă��A�����Ȃ�g���u���ɑ���ӔC��Ȃ����Ƃ��������������B
|
51
|
+
|
52
|
+
�@�{�T���v���́A�C��BSD���C�Z���X�Ɋ�Â����]�ځE�Ĕz�z�������܂��B
|
53
|
+
|
54
|
+
�EBSD���C�Z���X��
|
55
|
+
|
56
|
+
Copyright (c) 2008, Cyross Makoto
|
57
|
+
|
58
|
+
All rights reserved.
|
59
|
+
|
60
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
61
|
+
|
62
|
+
�ERedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
63
|
+
�ERedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
64
|
+
�ENeither the name of the Cyross Makoto nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
65
|
+
|
66
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
67
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
68
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
69
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
70
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
71
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
72
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
73
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
74
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
75
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
76
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/sample/Room3/red.rb
ADDED
@@ -0,0 +1,200 @@
|
|
1
|
+
class Red
|
2
|
+
include Story::Scene
|
3
|
+
include MainComponent
|
4
|
+
|
5
|
+
def init
|
6
|
+
@yuki = Yuki.new
|
7
|
+
@yuki.select_textbox(message_box[:box])
|
8
|
+
@yuki.select_commandbox(command_box[:box])
|
9
|
+
@akamatsu = Sprite.new(:file => "image/akamatsu.png", :type => :ck)
|
10
|
+
@akamatsu.center.bottom
|
11
|
+
@yuki.regist_parts(:akamatsu, @akamatsu)
|
12
|
+
|
13
|
+
@room = Sprite.new(:file=>"image/room_red.png", :type=>:as)
|
14
|
+
@room.center.bottom
|
15
|
+
|
16
|
+
var[:akamatsu_aisatsu] = false if var[:akamatsu_aisatsu] == nil
|
17
|
+
var[:release_akamatsu_book] = false if var[:release_akamatsu_book] == nil
|
18
|
+
var[:search_bookmark] = false if var[:search_bookmark] == nil
|
19
|
+
var[:get_bookmark] = false if var[:get_bookmark] == nil
|
20
|
+
end
|
21
|
+
|
22
|
+
def setup
|
23
|
+
@yuki.setup
|
24
|
+
@yuki.exec_plot(self.method(:plot))
|
25
|
+
end
|
26
|
+
|
27
|
+
def get_command
|
28
|
+
return [Yuki::Command.new("挨拶する", nil, lambda{var[:akamatsu_aisatsu] == false}, self.method(:red2)),
|
29
|
+
Yuki::Command.new("辺りを見る", nil, lambda{var[:akamatsu_aisatsu]==true }, self.method(:look)),
|
30
|
+
Yuki::Command.new("話す", nil, lambda{var[:akamatsu_aisatsu]==true }, self.method(:talk)),
|
31
|
+
Yuki::Command.new("渡す", nil, lambda{var[:akamatsu_aisatsu] && var[:release_akamatsu_book] && var[:search_bookmark]==false}, self.method(:send1)),
|
32
|
+
Yuki::Command.new("渡す", nil, lambda{var[:search_bookmark] && var[:get_bookmark] && var[:aikotoba]==false}, self.method(:send2)),
|
33
|
+
Yuki::Command.new("戻る", nil, lambda{var[:akamatsu_aisatsu]==true}, MainScene)]
|
34
|
+
end
|
35
|
+
|
36
|
+
def update
|
37
|
+
return nil if Input.quit_or_escape?
|
38
|
+
message_box.update_animation
|
39
|
+
command_box.update_animation
|
40
|
+
@yuki.update
|
41
|
+
r = @yuki.executing? ? @now : @yuki.result
|
42
|
+
if @yuki.is_scenario?(r)
|
43
|
+
@yuki.exec_plot(r)
|
44
|
+
r = @now
|
45
|
+
end
|
46
|
+
return r
|
47
|
+
end
|
48
|
+
|
49
|
+
def render
|
50
|
+
@room.render
|
51
|
+
@yuki.render
|
52
|
+
message_box.render
|
53
|
+
command_box.render if @yuki.selecting?
|
54
|
+
end
|
55
|
+
|
56
|
+
def plot(yuki)
|
57
|
+
yuki.text "赤の扉から中に入った。"
|
58
|
+
yuki.pause.clear
|
59
|
+
yuki.show :akamatsu
|
60
|
+
yuki.text "目の前には"
|
61
|
+
yuki.color(:red){var[:akamatsu_aisatsu] ? "赤松さん" : "男の人"}
|
62
|
+
yuki.text "が居る。"
|
63
|
+
yuki.cr
|
64
|
+
return self.method(:main_loop)
|
65
|
+
end
|
66
|
+
|
67
|
+
def main_loop(yuki)
|
68
|
+
loop do
|
69
|
+
yuki.text "どうする?"
|
70
|
+
yuki.command get_command
|
71
|
+
return yuki.select_result if yuki.is_scene?(yuki.select_result)
|
72
|
+
yuki.select_result.call(@yuki) if yuki.is_scenario?(yuki.select_result)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def red2(yuki)
|
77
|
+
yuki.clear
|
78
|
+
text_wait "「はっ、"
|
79
|
+
text_wait "私の、"
|
80
|
+
text_wait "名前は、"
|
81
|
+
text_wait "赤松と、"
|
82
|
+
text_wait "申します!"
|
83
|
+
yuki.cr
|
84
|
+
text_wait " よろしく、"
|
85
|
+
yuki.text "お願いします!」"
|
86
|
+
yuki.pause.clear
|
87
|
+
var[:akamatsu_aisatsu] = true
|
88
|
+
end
|
89
|
+
|
90
|
+
def look(yuki)
|
91
|
+
yuki.clear
|
92
|
+
yuki.text "部屋を見回すと、勉強家らしく、"
|
93
|
+
yuki.cr
|
94
|
+
yuki.text "机と数々の本が本棚にしまってある。"
|
95
|
+
yuki.pause.clear
|
96
|
+
end
|
97
|
+
|
98
|
+
def talk(yuki)
|
99
|
+
yuki.clear
|
100
|
+
text_wait "「はっ、"
|
101
|
+
text_wait "私は、"
|
102
|
+
text_wait "某大学の、"
|
103
|
+
text_wait "はっ、"
|
104
|
+
yuki.text "8年生です!"
|
105
|
+
yuki.pause.cr
|
106
|
+
text_wait " 今年こそ、"
|
107
|
+
text_wait "無事、"
|
108
|
+
text_wait "卒業、"
|
109
|
+
text_wait "できるよう!"
|
110
|
+
yuki.cr
|
111
|
+
text_wait " 精進する、"
|
112
|
+
text_wait "所存で、"
|
113
|
+
text_wait "ございます!」"
|
114
|
+
yuki.pause.clear
|
115
|
+
end
|
116
|
+
|
117
|
+
def send1(yuki)
|
118
|
+
yuki.clear
|
119
|
+
yuki.text "あなたは、青山君から受け取っていた本を返した。"
|
120
|
+
yuki.pause.clear
|
121
|
+
text_wait "「あっ、"
|
122
|
+
text_wait "青山くんから、"
|
123
|
+
yuki.text "本を受け取って頂いたのですね!"
|
124
|
+
yuki.pause.cr
|
125
|
+
text_wait " あ、"
|
126
|
+
text_wait "ありがとうございます!"
|
127
|
+
yuki.pause.clear
|
128
|
+
text_wait " あ、"
|
129
|
+
text_wait "あのひと、"
|
130
|
+
yuki.text "ちょっとビビるでしょ?"
|
131
|
+
yuki.pause.cr
|
132
|
+
text_wait " ・・・おっとと、"
|
133
|
+
text_wait "聞こえてちゃ、"
|
134
|
+
yuki.text "困るな。」"
|
135
|
+
yuki.pause.clear
|
136
|
+
yuki.text " それでは・・・・・。"
|
137
|
+
yuki.pause.clear
|
138
|
+
yuki.text " ・・・・・。"
|
139
|
+
yuki.pause.clear
|
140
|
+
text_wait " おや、"
|
141
|
+
text_wait "栞が、"
|
142
|
+
text_wait "入って、"
|
143
|
+
yuki.text "ないですね。"
|
144
|
+
yuki.pause.cr
|
145
|
+
text_wait " あれは、"
|
146
|
+
text_wait "僕の、"
|
147
|
+
text_wait "大事な、"
|
148
|
+
yuki.text "宝物なんです!"
|
149
|
+
yuki.pause.cr
|
150
|
+
text_wait " 青山君の、"
|
151
|
+
text_wait "部屋に、"
|
152
|
+
text_wait "戻って、"
|
153
|
+
yuki.cr
|
154
|
+
text_wait " 栞を、"
|
155
|
+
text_wait "探して、"
|
156
|
+
text_wait "きてください!」"
|
157
|
+
yuki.pause.clear
|
158
|
+
var[:search_bookmark]=true
|
159
|
+
end
|
160
|
+
|
161
|
+
def send2(yuki)
|
162
|
+
yuki.clear
|
163
|
+
text_wait "「あっ、"
|
164
|
+
text_wait "これは、"
|
165
|
+
yuki.text "無くなっていた栞!"
|
166
|
+
yuki.pause.cr
|
167
|
+
text_wait " ありがとうございます!"
|
168
|
+
yuki.cr
|
169
|
+
text_wait " あの、"
|
170
|
+
text_wait "お礼といっては、"
|
171
|
+
yuki.text "何ですが、"
|
172
|
+
yuki.pause.cr
|
173
|
+
text_wait " 合言葉を、"
|
174
|
+
text_wait "教えて、"
|
175
|
+
yuki.text "差し上げます!」"
|
176
|
+
yuki.pause.clear
|
177
|
+
text_wait "「『こんなゲーム", 0.5
|
178
|
+
text_wait " まじになっちゃって", 0.5
|
179
|
+
yuki.cr
|
180
|
+
text_wait " どうするの』", 0.5
|
181
|
+
yuki.cr
|
182
|
+
text_wait " これが、"
|
183
|
+
text_wait "合い言葉です!"
|
184
|
+
yuki.cr
|
185
|
+
text_wait " それでは、"
|
186
|
+
yuki.text "お元気で!」"
|
187
|
+
yuki.pause.clear
|
188
|
+
var[:aikotoba]=true
|
189
|
+
end
|
190
|
+
|
191
|
+
def text_wait(txt, w = 0.3)
|
192
|
+
@yuki.text txt
|
193
|
+
@yuki.wait w
|
194
|
+
end
|
195
|
+
|
196
|
+
def dispose
|
197
|
+
@akamatsu.dispose
|
198
|
+
@room.dispose
|
199
|
+
end
|
200
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#! /usr/bin/ruby
|
2
|
+
# Sample Adventure "Room 3"
|
3
|
+
|
4
|
+
$miyako_debug_mode = true
|
5
|
+
|
6
|
+
require 'Miyako/miyako'
|
7
|
+
#require 'Miyako/idaten_miyako'
|
8
|
+
|
9
|
+
include Miyako
|
10
|
+
|
11
|
+
Miyako.setTitle("Room 3")
|
12
|
+
Screen.set_size(640, 480)
|
13
|
+
|
14
|
+
#Screen.fps = 40
|
15
|
+
#Screen.fpsView = true
|
16
|
+
|
17
|
+
require 'main_component'
|
18
|
+
require 'title'
|
19
|
+
require 'main'
|
20
|
+
require 'red'
|
21
|
+
require 'green'
|
22
|
+
require 'blue'
|
23
|
+
require 'ending'
|
24
|
+
|
25
|
+
r3 = Story.new
|
26
|
+
r3.run(Title)
|
@@ -0,0 +1,171 @@
|
|
1
|
+
class Title
|
2
|
+
include Story::Scene
|
3
|
+
|
4
|
+
def self.scene_type
|
5
|
+
return :scene
|
6
|
+
end
|
7
|
+
|
8
|
+
def init
|
9
|
+
font = Font.sans_serif
|
10
|
+
font.size = 24
|
11
|
+
font.color = Color[:white]
|
12
|
+
@push_key = Shape.text(:text=>"Push Any Key", :font=>font)
|
13
|
+
@push_key.center.bottom{|body| (0.1).ratio(body) }
|
14
|
+
|
15
|
+
@copy_right = Shape.text(:text=>"2006-2008 Cyross Makoto", :font=>font)
|
16
|
+
@copy_right.center.bottom{|body| (0.05).ratio(body) }
|
17
|
+
|
18
|
+
@visible = false
|
19
|
+
|
20
|
+
@title = Sprite.new(:file=>"image/mittsu_no_oheya.png", :type=>:ck)
|
21
|
+
|
22
|
+
@exec = self.method(:view_in)
|
23
|
+
end
|
24
|
+
|
25
|
+
def setup
|
26
|
+
@title.move_to(Screen.w, 0)
|
27
|
+
end
|
28
|
+
|
29
|
+
def view_in
|
30
|
+
if @title.x > 0
|
31
|
+
@title.move(-8, 0)
|
32
|
+
return @now
|
33
|
+
end
|
34
|
+
@visible = true
|
35
|
+
@exec = self.method(:waiting)
|
36
|
+
return @now
|
37
|
+
end
|
38
|
+
|
39
|
+
def waiting
|
40
|
+
if Input.pushed_any?
|
41
|
+
@exec = self.method(:view_out)
|
42
|
+
@visible = false
|
43
|
+
end
|
44
|
+
return @now
|
45
|
+
end
|
46
|
+
|
47
|
+
def view_out
|
48
|
+
if @title.x > -Screen.w
|
49
|
+
@title.move(-8, 0)
|
50
|
+
return @now
|
51
|
+
end
|
52
|
+
return TitleCall
|
53
|
+
end
|
54
|
+
|
55
|
+
def update
|
56
|
+
return nil if (Input.pushed_any?(:esc) || Input.quit?)
|
57
|
+
return @exec.call
|
58
|
+
end
|
59
|
+
|
60
|
+
def render
|
61
|
+
@title.render
|
62
|
+
if @visible
|
63
|
+
@push_key.render
|
64
|
+
@copy_right.render
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
class TitleCall
|
70
|
+
include Story::Scene
|
71
|
+
include MainComponent
|
72
|
+
|
73
|
+
def init
|
74
|
+
@yuki = Yuki.new
|
75
|
+
@yuki.select_textbox(message_box[:box])
|
76
|
+
@man = Sprite.new(:file=>"image/start.png", :type=>:ck)
|
77
|
+
@man.center.bottom
|
78
|
+
@wait = WaitCounter.new(0.2)
|
79
|
+
@exec = self.method(:view_in)
|
80
|
+
end
|
81
|
+
|
82
|
+
def setup
|
83
|
+
@yuki.setup
|
84
|
+
@man.alpha = 0
|
85
|
+
@wait.start
|
86
|
+
end
|
87
|
+
|
88
|
+
def update
|
89
|
+
return nil if (Input.pushed_any?(:esc) || Input.quit?)
|
90
|
+
return @exec.call
|
91
|
+
end
|
92
|
+
|
93
|
+
def view_in
|
94
|
+
if @wait.finish?
|
95
|
+
if @man.alpha == 255
|
96
|
+
@yuki.start_plot(self.method(:plot))
|
97
|
+
@exec = self.method(:exec_yuki)
|
98
|
+
return @now
|
99
|
+
end
|
100
|
+
@man.alpha += 15
|
101
|
+
@wait.start
|
102
|
+
end
|
103
|
+
return @now
|
104
|
+
end
|
105
|
+
|
106
|
+
def exec_yuki
|
107
|
+
message_box.update_animation
|
108
|
+
@yuki.update
|
109
|
+
return @yuki.result ? @yuki.result : @now
|
110
|
+
end
|
111
|
+
|
112
|
+
def plot(yuki)
|
113
|
+
yuki.text("「レディ〜ス エ〜ン ジェントルメ〜ン!」").pause.cr
|
114
|
+
yuki.text("「本日も、視聴者参加バラエティー").cr
|
115
|
+
yuki.text(" 『ルーム3』の時間がは〜じまりま〜した〜!」").pause.clear
|
116
|
+
yuki.text("「司会はわたくし、").cr
|
117
|
+
yuki.wait 0.3
|
118
|
+
yuki.text(" サミュエル・ボチボチデンナーが").cr
|
119
|
+
yuki.text(" お送りしま〜す!」").pause.clear
|
120
|
+
yuki.text("「本日も、難関を乗り越え、").cr
|
121
|
+
yuki.text(" 豪華賞品をゲットするだけ!").cr
|
122
|
+
yuki.wait 0.5
|
123
|
+
yuki.text(" カンタン!」").pause.clear
|
124
|
+
yuki.text("「ルールもカンタン!").cr
|
125
|
+
yuki.text(" 3つの部屋にいる住人からヒントを得て、").pause.cr
|
126
|
+
yuki.text(" 合言葉を見つけるだけ!").cr
|
127
|
+
yuki.wait 0.5
|
128
|
+
yuki.text(" ほら、カンタンでしょ?」").pause.clear
|
129
|
+
yuki.text("「でも、これらの部屋にいる住人、").cr
|
130
|
+
yuki.text(" 一筋縄じゃ合い言葉を教えてくれない。").cr
|
131
|
+
yuki.wait 0.5
|
132
|
+
yuki.text(" いろいろ話して、").cr
|
133
|
+
yuki.text(" 合い言葉をゲットしてくれ!」").pause.clear
|
134
|
+
yuki.text "「さぁ、最初の挑戦者だ。"
|
135
|
+
yuki.wait 0.5
|
136
|
+
yuki.text "お名前は?"
|
137
|
+
yuki.wait 1.5
|
138
|
+
yuki.cr
|
139
|
+
yuki.text " ・・・おおー、元気いいねー!"
|
140
|
+
yuki.wait 0.5
|
141
|
+
yuki.cr
|
142
|
+
yuki.text " じゃあ、どっから来たの?"
|
143
|
+
yuki.wait 1.0
|
144
|
+
yuki.cr
|
145
|
+
yuki.text(" ・・・オーケイ、よくできました!」").pause.clear
|
146
|
+
yuki.text "「じゃ、ルールは分かるよね?"
|
147
|
+
yuki.wait 0.5
|
148
|
+
yuki.cr
|
149
|
+
yuki.text " ・・・よし」"
|
150
|
+
yuki.pause.clear
|
151
|
+
yuki.text "「ドキドキするねぇ、"
|
152
|
+
yuki.wait 0.5
|
153
|
+
yuki.cr
|
154
|
+
yuki.text " ワクワクするねぇ"
|
155
|
+
yuki.pause.cr
|
156
|
+
yuki.text " それじゃ、元気よく、"
|
157
|
+
yuki.cr
|
158
|
+
yuki.text " 目の前のドアから入ってみよう。」"
|
159
|
+
yuki.pause.clear
|
160
|
+
yuki.text "「よーい、"
|
161
|
+
yuki.wait 0.5
|
162
|
+
yuki.text "スタート!」"
|
163
|
+
yuki.pause.clear
|
164
|
+
return MainScene
|
165
|
+
end
|
166
|
+
|
167
|
+
def render
|
168
|
+
@man.render
|
169
|
+
message_box.render if @exec == self.method(:exec_yuki)
|
170
|
+
end
|
171
|
+
end
|
Binary file
|