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
@@ -0,0 +1,89 @@
|
|
1
|
+
#! /usr/bin/ruby
|
2
|
+
# M1ku sample for Miyako v2.0
|
3
|
+
# 2008.11.30 Cyross Makoto
|
4
|
+
|
5
|
+
require 'Miyako/miyako'
|
6
|
+
include Miyako
|
7
|
+
|
8
|
+
#Screen.fps_view = true
|
9
|
+
|
10
|
+
def create_arm(num)
|
11
|
+
spr = Sprite.new({:file=>sprintf("m1ku_arm_#{num}.png"), :type=>:ck})
|
12
|
+
spr.move_to(30, 70)
|
13
|
+
return spr
|
14
|
+
end
|
15
|
+
|
16
|
+
def create_eye(num)
|
17
|
+
spr = Sprite.new({:file=>sprintf("m1ku_eye_#{num}.png"), :type=>:ck})
|
18
|
+
spr.move_to(356, 114)
|
19
|
+
return spr
|
20
|
+
end
|
21
|
+
|
22
|
+
bk = Sprite.new({:file=>"m1ku_back.jpg", :type=>:as})
|
23
|
+
back = bk.to_sprite
|
24
|
+
back.fill([0,0,0])
|
25
|
+
|
26
|
+
body = Sprite.new({:file=>"m1ku_body.png", :type=>:ck})
|
27
|
+
body.move_to(200, 64)
|
28
|
+
|
29
|
+
hair_f = Sprite.new({:file=>"m1ku_hair_front.png", :type=>:ck})
|
30
|
+
hair_f.move_to(200, 24)
|
31
|
+
|
32
|
+
hair_r = Sprite.new({:file=>"m1ku_hair_rear.png", :type=>:ck})
|
33
|
+
hair_r.move_to(200, 24)
|
34
|
+
|
35
|
+
arms = Array.new
|
36
|
+
(0..3).each{|n| arms.push(create_arm(n)) }
|
37
|
+
arm_anim_param = {
|
38
|
+
:sprite=> arms,
|
39
|
+
:wait => 0.1,
|
40
|
+
:pattern_list => [0, 1, 2, 3, 2, 1]
|
41
|
+
}
|
42
|
+
arm_anim = SpriteAnimation.new(arm_anim_param)
|
43
|
+
arm_anim.start
|
44
|
+
|
45
|
+
eyes = Array.new
|
46
|
+
(0..3).each{|n| eyes.push(create_eye(n)) }
|
47
|
+
eye_anim_param = {
|
48
|
+
:sprite => eyes,
|
49
|
+
:wait => [4.5, 0.1, 0.1, 0.1, 0.1, 0.1],
|
50
|
+
:pattern_list => [0, 1, 2, 3, 2, 1]
|
51
|
+
}
|
52
|
+
eye_anim = SpriteAnimation.new(eye_anim_param)
|
53
|
+
eye_anim.start
|
54
|
+
|
55
|
+
rate = 1.0
|
56
|
+
amt = -0.1
|
57
|
+
degree = 0
|
58
|
+
damt = 10
|
59
|
+
pos = 0
|
60
|
+
rate = 10
|
61
|
+
|
62
|
+
|
63
|
+
# Main Routine
|
64
|
+
Miyako.main_loop do
|
65
|
+
break if Input.quit_or_escape?
|
66
|
+
back.render
|
67
|
+
# back.render{|src|
|
68
|
+
# src.x = pos
|
69
|
+
# pos += rate
|
70
|
+
# rate = -10 if pos == 50
|
71
|
+
# rate = 10 if pos == 0
|
72
|
+
# }
|
73
|
+
hair_r.render
|
74
|
+
arm_anim.update_animation
|
75
|
+
arm_anim.render
|
76
|
+
body.render
|
77
|
+
eye_anim.update_animation
|
78
|
+
eye_anim.render
|
79
|
+
hair_f.render
|
80
|
+
back.fill([0,0,0])
|
81
|
+
Bitmap.hue!(bk.to_unit, back.to_unit, degree)
|
82
|
+
degree = (degree + damt) % 360
|
83
|
+
# Bitmap.dec_alpha!(bk.to_unit, back.to_unit, rate, 0, 0)
|
84
|
+
# rate += amt
|
85
|
+
# rate = 0.0 if rate < 0.01
|
86
|
+
# amt = 0.1 if rate == 0.0
|
87
|
+
# rate = 1.0 if rate > 0.99
|
88
|
+
# amt = -0.1 if rate == 1.0
|
89
|
+
end
|
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,72 @@
|
|
1
|
+
*******************************************************************************
|
2
|
+
�y ��Җ� �z�@�T�C���X��
|
3
|
+
�y �\�t�g�� �z�@Miyako v1.4.4�T���v��(�A�j���[�V�����P)
|
4
|
+
�y �o�[�W���� �z�@1.0
|
5
|
+
�y �쐬�� �z�@2008/01/14
|
6
|
+
�y ��� �z�@�t���[�E�F�A
|
7
|
+
�y �J������ �z�@Ruby 1.8.6-p111
|
8
|
+
�y �����^�C�� �z�@Miyako v1.4.4
|
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.4.4�ȍ~�ɑΉ�����AMiyako�T���v���v���O�����ł��B
|
19
|
+
�@�ǂ����Ō������Ƃ���悤�Ȗ����悤�ȃL�����N�^�[���A����l�M��U���Ă��܂��B
|
20
|
+
|
21
|
+
�EMiyako�ɂ���
|
22
|
+
|
23
|
+
�@Miyako�Ɋւ��ẮA�ȉ���URL���Q�l�ɂ��Ă��������B
|
24
|
+
http://www.twin.ne.jp/~cyross/Miyako/
|
25
|
+
|
26
|
+
�@Miyako(Ruby�ARuby/SDL�܂�)�̃C���X�g�[���Ɋւ��܂��ẮA
|
27
|
+
��LURL��H���ē�����A�[�J�C�u���ꂽMiyako���C�u������
|
28
|
+
�W�J����ƁAreadme.txt�������܂��̂ŁA����������Q�Ɖ������B
|
29
|
+
|
30
|
+
�@�{�T���v���ł́AMiyako��Windows��œ��삷�邱�Ƃ�O��ɂ��Ă��܂��B
|
31
|
+
�i�C���X�g�[������Ruby���s����ActiveRuby�ł��邱�Ƃ��O���
|
32
|
+
�@���Ă��܂��j
|
33
|
+
|
34
|
+
�E�N�����@
|
35
|
+
|
36
|
+
�@�G�N�X�v���[���[���J���A�{�T���v���̃t�H���_���ŁA�um1ku.rb�v��
|
37
|
+
�_�u���N���b�N���܂��B
|
38
|
+
�@�������́A�R�}���h���C����œ������ꍇ�́A�{�T���v���̃f�B���N�g����
|
39
|
+
�ړ����āA�ȉ��̃R�}���h����͂��܂��B
|
40
|
+
|
41
|
+
�@ruby m1ku.rb
|
42
|
+
|
43
|
+
�E�Ɛӎ���
|
44
|
+
|
45
|
+
�@�{�T���v���͖��ۏł��B�����{�T���v�����g�p���邱�Ƃɂ��s��E�g���u��
|
46
|
+
���N�������Ƃ��Ă��A�����Ȃ�g���u���ɑ���ӔC��Ȃ����Ƃ��������������B
|
47
|
+
|
48
|
+
�@�{�T���v���́A�C��BSD���C�Z���X�Ɋ�Â����]�ځE�Ĕz�z�������܂��B
|
49
|
+
|
50
|
+
�EBSD���C�Z���X��
|
51
|
+
|
52
|
+
Copyright (c) 2008, Cyross Makoto
|
53
|
+
|
54
|
+
All rights reserved.
|
55
|
+
|
56
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
57
|
+
|
58
|
+
�ERedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
59
|
+
�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.
|
60
|
+
�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.
|
61
|
+
|
62
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
63
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
64
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
65
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
66
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
67
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
68
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
69
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
70
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
71
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
72
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
@@ -0,0 +1,95 @@
|
|
1
|
+
#! /usr/bin/ruby
|
2
|
+
# Lex sample for Miyako v2.0
|
3
|
+
# 2008.11.24 Cyross Makoto
|
4
|
+
|
5
|
+
require 'Miyako/miyako'
|
6
|
+
|
7
|
+
include Miyako
|
8
|
+
|
9
|
+
def create_wheel(num)
|
10
|
+
spr = Sprite.new({:file=>sprintf("lex_wheel_#{num}.png"), :type=>:ck})
|
11
|
+
spr.move_to(317, 331)
|
12
|
+
return spr
|
13
|
+
end
|
14
|
+
|
15
|
+
|
16
|
+
back = Plane.new({:file=>sprintf("lex_back.png"), :type=>:as})
|
17
|
+
back_timer = WaitCounter.new(0.1)
|
18
|
+
|
19
|
+
title = Sprite.new({:file=>sprintf("song_title.png"), :type=>:ck})
|
20
|
+
pos = Screen.h
|
21
|
+
upper = 24
|
22
|
+
x = 24
|
23
|
+
title.move_to(x, pos)
|
24
|
+
title_timer = WaitCounter.new(2)
|
25
|
+
interval = 8
|
26
|
+
mode = 0
|
27
|
+
|
28
|
+
len_body = Sprite.new({:file=>sprintf("lex_body.png"), :type=>:ck})
|
29
|
+
len_body.move_to(425, 219)
|
30
|
+
|
31
|
+
len_anim_param = {
|
32
|
+
:sprite => len_body,
|
33
|
+
:wait => 0.1,
|
34
|
+
:move_offset => [[0,0], [0,-1], [0,0], [0,1]]
|
35
|
+
}
|
36
|
+
len_anim = SpriteAnimation.new(len_anim_param)
|
37
|
+
len_anim.start
|
38
|
+
|
39
|
+
road_roller = Sprite.new({:file=>sprintf("lex_roadroller.png"), :type=>:ck})
|
40
|
+
road_roller.move_to(310, 180)
|
41
|
+
|
42
|
+
rr_anim_param = {
|
43
|
+
:sprite => road_roller,
|
44
|
+
:wait => 0.1,
|
45
|
+
:move_offset => [[0,0], [0,1], [0,0], [0,-1]]
|
46
|
+
}
|
47
|
+
rr_anim = SpriteAnimation.new(rr_anim_param)
|
48
|
+
rr_anim.start
|
49
|
+
|
50
|
+
wheels = Array.new
|
51
|
+
(0..2).each{|n| wheels.push(create_wheel(n)) }
|
52
|
+
wheel_anim_param = {
|
53
|
+
:sprite => wheels,
|
54
|
+
:wait => 0.1,
|
55
|
+
:pattern_list => [0, 1, 2, 1]
|
56
|
+
}
|
57
|
+
wheel_anim = SpriteAnimation.new(wheel_anim_param)
|
58
|
+
wheel_anim.start
|
59
|
+
|
60
|
+
back_timer.start
|
61
|
+
title_timer.start
|
62
|
+
Miyako.main_loop do
|
63
|
+
break if Input.quit_or_escape?
|
64
|
+
len_anim.update_animation
|
65
|
+
rr_anim.update_animation
|
66
|
+
wheel_anim.update_animation
|
67
|
+
if back_timer.finish?
|
68
|
+
back.move(-2, 0)
|
69
|
+
back_timer.start
|
70
|
+
end
|
71
|
+
if title_timer.finish?
|
72
|
+
case mode
|
73
|
+
when 0
|
74
|
+
mode = 1
|
75
|
+
title_timer = WaitCounter.new(0.1)
|
76
|
+
title_timer.start
|
77
|
+
when 1
|
78
|
+
pos -= interval
|
79
|
+
if pos <= upper
|
80
|
+
pos = upper
|
81
|
+
mode = 2
|
82
|
+
else
|
83
|
+
title_timer.start
|
84
|
+
end
|
85
|
+
title.move_to(x, pos)
|
86
|
+
when 2
|
87
|
+
# no operation
|
88
|
+
end
|
89
|
+
end
|
90
|
+
back.render
|
91
|
+
wheel_anim.render
|
92
|
+
len_anim.render
|
93
|
+
rr_anim.render
|
94
|
+
title.render if mode > 0
|
95
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,72 @@
|
|
1
|
+
*******************************************************************************
|
2
|
+
�y ��Җ� �z�@�T�C���X��
|
3
|
+
�y �\�t�g�� �z�@Miyako v1.4.4�T���v��(�A�j���[�V�����Q)
|
4
|
+
�y �o�[�W���� �z�@1.0
|
5
|
+
�y �쐬�� �z�@2008/01/14
|
6
|
+
�y ��� �z�@�t���[�E�F�A
|
7
|
+
�y �J������ �z�@Ruby 1.8.6-p111
|
8
|
+
�y �����^�C�� �z�@Miyako v1.4.4
|
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.4.4�ȍ~�ɑΉ�����AMiyako�T���v���v���O�����ł��B
|
19
|
+
�@�ǂ����Ō������Ƃ���悤�Ȗ����悤�ȃL�����N�^�[���A���[�h���[���[���^�]���Ă��܂��B
|
20
|
+
|
21
|
+
�EMiyako�ɂ���
|
22
|
+
|
23
|
+
�@Miyako�Ɋւ��ẮA�ȉ���URL���Q�l�ɂ��Ă��������B
|
24
|
+
http://www.twin.ne.jp/~cyross/Miyako/
|
25
|
+
|
26
|
+
�@Miyako(Ruby�ARuby/SDL�܂�)�̃C���X�g�[���Ɋւ��܂��ẮA
|
27
|
+
��LURL��H���ē�����A�[�J�C�u���ꂽMiyako���C�u������
|
28
|
+
�W�J����ƁAreadme.txt�������܂��̂ŁA����������Q�Ɖ������B
|
29
|
+
|
30
|
+
�@�{�T���v���ł́AMiyako��Windows��œ��삷�邱�Ƃ�O��ɂ��Ă��܂��B
|
31
|
+
�i�C���X�g�[������Ruby���s����ActiveRuby�ł��邱�Ƃ��O���
|
32
|
+
�@���Ă��܂��j
|
33
|
+
|
34
|
+
�E�N�����@
|
35
|
+
|
36
|
+
�@�G�N�X�v���[���[���J���A�{�T���v���̃t�H���_���ŁA�um1ku.rb�v��
|
37
|
+
�_�u���N���b�N���܂��B
|
38
|
+
�@�������́A�R�}���h���C����œ������ꍇ�́A�{�T���v���̃f�B���N�g����
|
39
|
+
�ړ����āA�ȉ��̃R�}���h����͂��܂��B
|
40
|
+
|
41
|
+
�@ruby lex.rb
|
42
|
+
|
43
|
+
�E�Ɛӎ���
|
44
|
+
|
45
|
+
�@�{�T���v���͖��ۏł��B�����{�T���v�����g�p���邱�Ƃɂ��s��E�g���u��
|
46
|
+
���N�������Ƃ��Ă��A�����Ȃ�g���u���ɑ���ӔC��Ȃ����Ƃ��������������B
|
47
|
+
|
48
|
+
�@�{�T���v���́A�C��BSD���C�Z���X�Ɋ�Â����]�ځE�Ĕz�z�������܂��B
|
49
|
+
|
50
|
+
�EBSD���C�Z���X��
|
51
|
+
|
52
|
+
Copyright (c) 2008, Cyross Makoto
|
53
|
+
|
54
|
+
All rights reserved.
|
55
|
+
|
56
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
57
|
+
|
58
|
+
�ERedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
59
|
+
�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.
|
60
|
+
�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.
|
61
|
+
|
62
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
63
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
64
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
65
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
66
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
67
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
68
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
69
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
70
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
71
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
72
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,283 @@
|
|
1
|
+
#! /usr/bin/ruby
|
2
|
+
# Diagram sample for Miyako v2.0
|
3
|
+
# 2008.11.23 Cyross Makoto
|
4
|
+
|
5
|
+
require 'Miyako/miyako'
|
6
|
+
|
7
|
+
include Miyako
|
8
|
+
|
9
|
+
# 移動が遅いスクロール
|
10
|
+
class MoveSlower
|
11
|
+
include Diagram::NodeBase
|
12
|
+
|
13
|
+
def initialize(spr)
|
14
|
+
@spr = spr
|
15
|
+
@finish = false # 終了フラグ
|
16
|
+
end
|
17
|
+
|
18
|
+
def start
|
19
|
+
@spr.move_to(640, @spr.y) # 画面を出たところまで移動
|
20
|
+
end
|
21
|
+
|
22
|
+
def update
|
23
|
+
@finish = (@spr.x <= 320) # 所定の位置までスクロールさせたら終了
|
24
|
+
return if @finish
|
25
|
+
@spr.move(-2,0)
|
26
|
+
end
|
27
|
+
|
28
|
+
def finish?
|
29
|
+
return @finish
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# 移動が速いスクロール
|
34
|
+
class MoveFaster
|
35
|
+
include Diagram::NodeBase
|
36
|
+
|
37
|
+
def initialize(spr)
|
38
|
+
@spr = spr
|
39
|
+
@finish = false # 終了フラグ
|
40
|
+
end
|
41
|
+
|
42
|
+
def start
|
43
|
+
@spr.move_to(640, @spr.y) # 画面を出たところまで移動
|
44
|
+
end
|
45
|
+
|
46
|
+
def update
|
47
|
+
@finish = (@spr.x <= 40) # 所定の位置までスクロールさせたら終了
|
48
|
+
return if @finish
|
49
|
+
@spr.move(-4,0)
|
50
|
+
end
|
51
|
+
|
52
|
+
def finish?
|
53
|
+
return @finish
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
class WaitTrigger
|
58
|
+
include Diagram::TriggerBase
|
59
|
+
|
60
|
+
def initialize(wait=0.1)
|
61
|
+
@timer = WaitCounter.new(wait)
|
62
|
+
end
|
63
|
+
|
64
|
+
def pre_process
|
65
|
+
@timer.start
|
66
|
+
end
|
67
|
+
|
68
|
+
def update?
|
69
|
+
@timer.finish?
|
70
|
+
end
|
71
|
+
|
72
|
+
def post_update
|
73
|
+
@timer.start
|
74
|
+
end
|
75
|
+
|
76
|
+
def post_process
|
77
|
+
@timer.stop
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# 移動アニメーションノード
|
82
|
+
class Moving
|
83
|
+
include Diagram::NodeBase
|
84
|
+
|
85
|
+
def initialize(chr1, chr2, wait)
|
86
|
+
@pr = {}
|
87
|
+
@pr[:fast] = Diagram::Processor.new{|dia|
|
88
|
+
dia.add :scroll, MoveFaster.new(chr1), WaitTrigger.new(wait)
|
89
|
+
dia.add_arrow(:scroll, nil)
|
90
|
+
}
|
91
|
+
|
92
|
+
@pr[:slow] = Diagram::Processor.new{|dia|
|
93
|
+
dia.add :scroll, MoveSlower.new(chr2), WaitTrigger.new(wait)
|
94
|
+
dia.add_arrow(:scroll, nil)
|
95
|
+
}
|
96
|
+
|
97
|
+
@finished = false
|
98
|
+
end
|
99
|
+
|
100
|
+
def start
|
101
|
+
@pr.keys.each{|k| @pr[k].start }
|
102
|
+
end
|
103
|
+
|
104
|
+
def update
|
105
|
+
@finished = @pr.keys.inject(true){|r, k| r &= @pr[k].finish? } # アニメーション処理が終了するまで繰り返し
|
106
|
+
end
|
107
|
+
|
108
|
+
def stop
|
109
|
+
@pr.keys.each{|k| @pr[k].stop }
|
110
|
+
end
|
111
|
+
|
112
|
+
def finish?
|
113
|
+
return @finished
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
# Yukiプロット実行
|
118
|
+
class StartPlot
|
119
|
+
include Diagram::NodeBase
|
120
|
+
|
121
|
+
def initialize(manager)
|
122
|
+
@manager = manager
|
123
|
+
@finished = false
|
124
|
+
end
|
125
|
+
|
126
|
+
def start
|
127
|
+
end
|
128
|
+
|
129
|
+
def update
|
130
|
+
@manager.start
|
131
|
+
@finished = true
|
132
|
+
end
|
133
|
+
|
134
|
+
def stop
|
135
|
+
end
|
136
|
+
|
137
|
+
def finish?
|
138
|
+
return @finished
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
# Yukiプロット実行
|
143
|
+
class Plotting
|
144
|
+
include Diagram::NodeBase
|
145
|
+
|
146
|
+
def initialize(manager, set_wait)
|
147
|
+
@manager = manager
|
148
|
+
@set = set_wait
|
149
|
+
@finished = false
|
150
|
+
end
|
151
|
+
|
152
|
+
def start
|
153
|
+
end
|
154
|
+
|
155
|
+
def update
|
156
|
+
@finished = !(@manager.executing?)
|
157
|
+
end
|
158
|
+
|
159
|
+
def update_input
|
160
|
+
@set.call(0.0) if Input.pushed_any?(:btn1) # 1ボタンを押したら、表示途中のメッセージをすべて表示
|
161
|
+
@manager.update_input
|
162
|
+
end
|
163
|
+
|
164
|
+
def stop
|
165
|
+
end
|
166
|
+
|
167
|
+
def finish?
|
168
|
+
return @finished
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
class MainScene
|
173
|
+
include Story::Scene
|
174
|
+
|
175
|
+
TEXTBOX_MARGIN = 16
|
176
|
+
TEXTBOX_BOTTOM = 24
|
177
|
+
|
178
|
+
def init
|
179
|
+
ws = Sprite.new(:file=>"wait_cursor.png", :type=>:ac)
|
180
|
+
ws.oh = ws.ow
|
181
|
+
ws = SpriteAnimation.new(:sprite=>ws, :wait=>0.2, :pattern_list=>[0,1,2,3,2,1])
|
182
|
+
cs = Sprite.new(:file=>"cursor.png", :type=>:ac)
|
183
|
+
cs.oh = cs.ow
|
184
|
+
cs = SpriteAnimation.new(:sprite=>cs, :wait=>0.2, :pattern_list=>[0,1,2,3,2,1])
|
185
|
+
font = Font.sans_serif
|
186
|
+
font.color = Color[:white]
|
187
|
+
font.size = 24
|
188
|
+
@box = TextBox.new(:size=>[20,5], :wait_cursor => ws, :select_cursor => cs, :font => font)
|
189
|
+
@box_bg = Sprite.new(:size => @box.size.to_a.map{|v| v + TEXTBOX_MARGIN}, :type => :ac)
|
190
|
+
@box_bg.fill([0,0,255,128])
|
191
|
+
@parts = Parts.new(@box.size)
|
192
|
+
@parts[:box_bg] = @box_bg
|
193
|
+
@parts[:box] = @box
|
194
|
+
@parts[:box_bg].centering
|
195
|
+
@parts[:box].centering
|
196
|
+
@parts.center.bottom{ TEXTBOX_BOTTOM }
|
197
|
+
|
198
|
+
@yuki = Yuki.new
|
199
|
+
@yuki.update_text = self.method(:update_text)
|
200
|
+
@y_manager = @yuki.manager(@yuki.to_plot(self, :plot), false, true)
|
201
|
+
|
202
|
+
@c1 = Sprite.new(:file=>"chr01.png", :type=>:ac).bottom
|
203
|
+
@c2 = Sprite.new(:file=>"chr02.png", :type=>:ac).bottom
|
204
|
+
@bk = Sprite.new(:file=>"back.png", :type=>:as).centering
|
205
|
+
|
206
|
+
|
207
|
+
@pr = Diagram::Processor.new{|dia|
|
208
|
+
dia.add :move, Moving.new(@c1, @c2, 0.01)
|
209
|
+
dia.add :start, StartPlot.new(@y_manager)
|
210
|
+
dia.add :plot, Plotting.new(@y_manager, lambda{|w| set_wait(w) })
|
211
|
+
dia.add_arrow(:move, :start){|from| from.finish? }
|
212
|
+
dia.add_arrow(:start, :plot){|from| from.finish? }
|
213
|
+
dia.add_arrow(:plot, nil){|from| from.finish? }
|
214
|
+
}
|
215
|
+
|
216
|
+
@base_wait = 0.1 # ウェイト基本値
|
217
|
+
@wait = @base_wait # ウェイト
|
218
|
+
end
|
219
|
+
|
220
|
+
def setup
|
221
|
+
@pr.start
|
222
|
+
@yuki.setup
|
223
|
+
@yuki.select_textbox(@box)
|
224
|
+
end
|
225
|
+
|
226
|
+
def update
|
227
|
+
return nil if Input.quit_or_escape?
|
228
|
+
@pr.update_input
|
229
|
+
@parts.update_animation
|
230
|
+
return nil if @pr.finish?
|
231
|
+
return @now
|
232
|
+
end
|
233
|
+
|
234
|
+
def render
|
235
|
+
@bk.render
|
236
|
+
@c1.render
|
237
|
+
@c2.render
|
238
|
+
@parts.render if @y_manager.executing?
|
239
|
+
end
|
240
|
+
|
241
|
+
def plot(yuki)
|
242
|
+
yuki.text "「ねえ、あんたの担当のセリフ、ちゃんと覚えてるわよねぇ?"
|
243
|
+
yuki.cr
|
244
|
+
unless @wait == 0
|
245
|
+
yuki.pause
|
246
|
+
reset_wait
|
247
|
+
end
|
248
|
+
yuki.text " まさか、忘れてたなんて言わないわよねぇ?」"
|
249
|
+
yuki.cr
|
250
|
+
yuki.pause
|
251
|
+
reset_wait
|
252
|
+
yuki.clear
|
253
|
+
yuki.color(:red){
|
254
|
+
yuki.text "「そんなことないよぉ~"
|
255
|
+
yuki.cr
|
256
|
+
yuki.pause
|
257
|
+
reset_wait
|
258
|
+
yuki.text " ちゃんと覚えてるよぉ~」"
|
259
|
+
yuki.cr
|
260
|
+
}
|
261
|
+
yuki.pause
|
262
|
+
reset_wait
|
263
|
+
end
|
264
|
+
|
265
|
+
def update_text(yuki)
|
266
|
+
yuki.wait @wait # 1文字ずつ表示させる
|
267
|
+
end
|
268
|
+
|
269
|
+
def set_wait(wait)
|
270
|
+
@wait = wait
|
271
|
+
end
|
272
|
+
|
273
|
+
def reset_wait
|
274
|
+
@wait = @base_wait
|
275
|
+
end
|
276
|
+
|
277
|
+
def final
|
278
|
+
@pr.stop
|
279
|
+
end
|
280
|
+
end
|
281
|
+
|
282
|
+
ds = Story.new
|
283
|
+
ds.run(MainScene)
|