ruby-miyako-mswin32 2.1.21 → 2.1.22

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.
@@ -1741,3 +1741,51 @@ v2.1.20(2010.12.20)
1741
1741
  <インスタンスメソッド廃止>
1742
1742
  <ドキュメント>
1743
1743
  <その他>
1744
+
1745
+ v2.1.21(2011.05.08)
1746
+ <バグ修正>
1747
+ ・Story/SimpleStory実行中、サブシーンが使えないバグを修正
1748
+ <機能改善>
1749
+ <仕様変更>
1750
+ <ファイル追加>
1751
+ <ファイル削除>
1752
+ <グローバル変数追加>
1753
+ <定数追加>
1754
+ <定数削除>
1755
+ <構造体追加>
1756
+ <クラス追加>
1757
+ <モジュール追加>
1758
+ <mixin>
1759
+ <クラス・モジュールメソッド追加>
1760
+ <クラス・モジュールメソッド廃止>
1761
+ <モジュール関数追加>
1762
+ <モジュール関数廃止>
1763
+ <インスタンスメソッド追加>
1764
+ <インスタンスメソッド廃止>
1765
+ <ドキュメント>
1766
+ <その他>
1767
+
1768
+ v2.1.22(2011.05.15)
1769
+ <バグ修正>
1770
+ ・Shape.boxメソッドでエラーが出るバグを修正
1771
+ ・Shape.roundboxメソッドでエラーが出るバグを修正
1772
+ ・Shape.circleメソッドでエラーが出るバグを修正
1773
+ <機能改善>
1774
+ <仕様変更>
1775
+ <ファイル追加>
1776
+ <ファイル削除>
1777
+ <グローバル変数追加>
1778
+ <定数追加>
1779
+ <定数削除>
1780
+ <構造体追加>
1781
+ <クラス追加>
1782
+ <モジュール追加>
1783
+ <mixin>
1784
+ <クラス・モジュールメソッド追加>
1785
+ <クラス・モジュールメソッド廃止>
1786
+ <モジュール関数追加>
1787
+ <モジュール関数廃止>
1788
+ <インスタンスメソッド追加>
1789
+ <インスタンスメソッド廃止>
1790
+ <ドキュメント>
1791
+ <その他>
data/README CHANGED
@@ -1,8 +1,8 @@
1
1
  *******************************************************************************
2
2
  【 作者名 】 サイロス誠
3
3
  【 ソフト名 】 Interactive Media Authoring System "Miyako"
4
- 【 バージョン 】 2.1.20
5
- 【 作成日 】 2010/12/20
4
+ 【 バージョン 】 2.1.22
5
+ 【 作成日 】 2011/05/15
6
6
  【 種別 】 フリーウェア
7
7
  【 開発言語 】 Ruby 1.9.1
8
8
  【 ランタイム 】 Ruby 1.9.1~,Ruby/SDL 2.1~,SDL
@@ -15,7 +15,7 @@
15
15
 
16
16
  【 注意事項 】
17
17
 
18
- 本バージョンは、2.1.20公式リリース版です。
18
+ 本バージョンは、2.1.22公式リリース版です。
19
19
  本バージョンでは、ドキュメント・リファレンスは不十分ですが、「サイログ。」内や、サンプルプログラムの紹介等で随時ドキュメントを公開して行きます。
20
20
  (RDOC化を進めていますので、我こそはと思う方は是非・・・)
21
21
 
@@ -88,8 +88,7 @@ VID : GeForce 8800GT
88
88
  S/B : Creative SoundBlaster X-Fi
89
89
  PAD : BUFFALO BGC-FC802
90
90
  Logicool G-UF13
91
- OS : Microsoft WindowsXp SP3
92
- Microsoft WindowsVista Ultimate(x64) SP1
91
+ OS : Microsoft Windows7 Ultimate(x64) SP1 + VMWarePlayer(Microsoft WindowsXp SP3)
93
92
  DEV : xyzzy
94
93
  mingw32版Ruby 1.9.2-p0 + Ruby/SDL 2.1.1
95
94
  MinGW+MSYS(miyako_no_katanaビルド)
@@ -334,9 +334,9 @@ module Miyako
334
334
 
335
335
  def box(param) #:nodoc:
336
336
  init_parameter(param)
337
- s = Sprite.new(:size => [w, h], :type => :alpha_channel)
338
337
  w = @size[0]
339
338
  h = @size[1]
339
+ s = Sprite.new(:size => [w, h], :type => :alpha_channel)
340
340
  Drawing.fill(s, [0, 0, 0])
341
341
  Bitmap.ck_to_ac!(s, [0, 0, 0])
342
342
  if @edge
@@ -367,10 +367,10 @@ module Miyako
367
367
  Drawing.fill(s, [0, 0, 0])
368
368
  Bitmap.ck_to_ac!(s, [0, 0, 0])
369
369
  if @edge
370
- roundbox_basic(s, [0, 0, w, h], @ray, Color.to_rgb(@edge[:color]))
371
- roundbox_basic(s, [@edge[:width], @edge[:width], w, h], @ray, Color.to_rgb(@color))
370
+ roundbox_basic(s, 0, 0, w, h, @ray, Color.to_rgb(@edge[:color]))
371
+ roundbox_basic(s, @edge[:width], @edge[:width], w, h, @ray, Color.to_rgb(@color))
372
372
  else
373
- roundbox_basic(s, [0, 0, w, h], @ray, Color.to_rgb(@color))
373
+ roundbox_basic(s, 0, 0, w, h, @ray, Color.to_rgb(@color))
374
374
  end
375
375
  return s
376
376
  end
@@ -381,7 +381,6 @@ module Miyako
381
381
  Drawing.fill(s, [0, 0, 0])
382
382
  Bitmap.ck_to_ac!(s, [0, 0, 0])
383
383
  if @edge
384
- et, ec = sp.get_param(:edge)[0..1]
385
384
  Drawing.circle(s, [@ray, @ray], @ray, Color.to_rgb(@edge[:color]), true)
386
385
  Drawing.circle(s, [@ray, @ray], @ray-@edge[:width], Color.to_rgb(@color), true)
387
386
  else
@@ -414,6 +413,8 @@ module Miyako
414
413
  min_x, max_x = @vertexes.map{|v| v[0]}.minmax
415
414
  min_y, max_y = @vertexes.map{|v| v[1]}.minmax
416
415
 
416
+ raise MiyakoError, "cannot find vertexes!" if min_x.nil? or min_y.nil?
417
+
417
418
  w = max_x - min_x
418
419
  h = max_y - min_y
419
420
 
@@ -3,8 +3,8 @@
3
3
  #=コンテンツ作成ライブラリMiyako2.1
4
4
  #
5
5
  #Authors:: サイロス誠
6
- #Version:: 2.1.20
7
- #Copyright:: 2007-2010 Cyross Makoto
6
+ #Version:: 2.1.22
7
+ #Copyright:: 2007-2011 Cyross Makoto
8
8
  #License:: LGPL2.1
9
9
  #
10
10
  =begin
@@ -63,7 +63,7 @@ Thread.abort_on_exception = true
63
63
 
64
64
  #==Miyako基幹モジュール
65
65
  module Miyako
66
- VERSION = "2.1.21"
66
+ VERSION = "2.1.22"
67
67
 
68
68
  #===アプリケーション実行中に演奏する音楽のサンプリングレートを指定する
69
69
  #単位はHz(周波数)
@@ -0,0 +1,69 @@
1
+ # encoding: utf-8
2
+ # 弾幕サンプル
3
+ # 2011.05.28 Cyross Makoto
4
+
5
+ require 'miyako'
6
+
7
+ include Miyako
8
+
9
+ class Shot
10
+ DoublePiR = 2.0*Math::PI
11
+
12
+ def initialize(n)
13
+ @number = n # とりあえず入れている
14
+ @alive = true # 生死判定フラグ
15
+ @sprite = Shape.box(:size=>[16,16],:color=>[rand(255),rand(255),rand(255)],:fill=>true)
16
+ @sprite.show
17
+ @algorithm = Fiber.new{|n|
18
+ cnt = 0
19
+ deg = 0.0
20
+ amt = 15.0
21
+ x, y = pos
22
+ rx = rand(n)*16
23
+ ry = rand(n)*16
24
+ dice = 1000 # 1000分の1の確率で死亡
25
+ while(@alive) do
26
+ rad = DoublePiR*deg/360.0
27
+ Fiber.yield [x+(rx*Math.sin(rad)).to_i,y+(ry*Math.cos(rad)).to_i] # 位置を決定→反映のためにFiber離脱
28
+ deg = (deg + amt) % 360.0
29
+ cnt += 1
30
+ if cnt == 1000 # 1000回カウントしたら初期位置を更新
31
+ x, y = pos
32
+ cnt = 0
33
+ end
34
+ @alive = false if rand(dice) == 0 # 生死判定
35
+ end
36
+ @sprite.hide # 弾を隠す
37
+ Fiber.yield [0,0] # 表示しないので、値は適当
38
+ }
39
+ end
40
+
41
+ def alive?
42
+ @alive
43
+ end
44
+
45
+ def update
46
+ return unless @alive
47
+ @sprite.move_to!(*@algorithm.resume)
48
+ end
49
+
50
+ def render
51
+ @sprite.render
52
+ end
53
+
54
+ def pos
55
+ [rand(Screen.w-@sprite.w), rand(Screen.h-@sprite.h)]
56
+ end
57
+
58
+ private :pos
59
+ end
60
+
61
+ arr = Array.new(1000){|n| Shot.new(n) }
62
+
63
+ Miyako.main_loop do
64
+ break if Input.quit_or_escape?
65
+ arr.each{|shot|
66
+ shot.update
67
+ shot.render
68
+ }
69
+ end
@@ -0,0 +1,62 @@
1
+ # encoding: utf-8
2
+ # 弾幕サンプル(その2)
3
+ # 2011.05.28 Cyross Makoto
4
+
5
+ require 'miyako'
6
+
7
+ include Miyako
8
+
9
+ class Shot
10
+ DoublePiR = 2.0*Math::PI
11
+
12
+ def initialize(n)
13
+ @number = n # とりあえず入れている
14
+ @alive = true # 生死判定フラグ
15
+ @sprite = Shape.box(:size=>[16,16],:color=>[rand(255),rand(255),rand(255)],:fill=>true) # 弾はShape
16
+ @sprite.show
17
+ @algorithm = Fiber.new{|n|
18
+ deg = 0.0
19
+ x, y = [(Screen.w-@sprite.w)/2, (Screen.h-@sprite.h)/2] # 画面の中心を初期位置に
20
+ rx, ry = [[160,160], [256,120], [64,200]].sample # 回転半径:3つのうちのどれか
21
+ amt = rand(59)+1 # 回転角:1~60度
22
+ dice = 1000 # 1000分の1の確率で死亡
23
+ while(@alive) do
24
+ rad = DoublePiR*deg/360.0 # 回転角度測定
25
+ Fiber.yield [x+(rx*Math.sin(rad)).to_i,y+(ry*Math.cos(rad)).to_i] # 位置を決定→反映のためにFiber離脱
26
+ deg = (deg + amt) % 360.0 # 回転角の更新
27
+ @alive = false if rand(dice) == 0 # 生死判定
28
+ end
29
+ @sprite.hide # 弾を隠す
30
+ Fiber.yield [0,0] # 表示しないので、値は適当
31
+ }
32
+ end
33
+
34
+ def alive?
35
+ @alive
36
+ end
37
+
38
+ def update
39
+ return unless @alive
40
+ @sprite.move_to!(*@algorithm.resume)
41
+ end
42
+
43
+ def render
44
+ @sprite.render
45
+ end
46
+
47
+ def pos
48
+ [rand(Screen.w-@sprite.w), rand(Screen.h-@sprite.h)]
49
+ end
50
+
51
+ private :pos
52
+ end
53
+
54
+ arr = Array.new(1000){|n| Shot.new(n) }
55
+
56
+ Miyako.main_loop do
57
+ break if Input.quit_or_escape?
58
+ arr.each{|shot|
59
+ shot.update
60
+ shot.render
61
+ }
62
+ end
@@ -0,0 +1,12 @@
1
+ require 'Miyako/miyako'
2
+
3
+ sprite = Miyako::Shape.circle(ray: 100)
4
+ sprite2 = Miyako::Shape.polygon(vertexes: [[100,100],[150,100],[200,200]], color: [255,0,0])
5
+
6
+ loop do
7
+ Miyako::Input.update
8
+ break if Miyako::Input.quit_or_escape?
9
+ sprite.render
10
+ sprite2.render
11
+ Miyako::Screen.render
12
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 1
8
- - 21
9
- version: 2.1.21
8
+ - 22
9
+ version: 2.1.22
10
10
  platform: ruby
11
11
  authors:
12
12
  - Cyross Makoto
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-04-14 00:00:00 +09:00
17
+ date: 2011-05-28 00:00:00 +09:00
18
18
  default_executable:
19
19
  dependencies: []
20
20
 
@@ -187,6 +187,9 @@ files:
187
187
  - ./sample/Room3/red.rb
188
188
  - ./sample/Room3/room3.rb
189
189
  - ./sample/Room3/title.rb
190
+ - ./sample/shape_danmaku.rb
191
+ - ./sample/shape_danmaku2.rb
192
+ - ./sample/shape_sample.rb
190
193
  - ./sample/takahashi.rb
191
194
  - ./sample/text.png
192
195
  - ./sample/textbox_sample.rb