ruby-miyako 2.1.4 → 2.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,22 +2,20 @@
2
2
  #! /usr/bin/ruby
3
3
  # Sample Adventure "Room 3"
4
4
 
5
- $miyako_debug_mode = true
6
-
7
- require 'Miyako/miyako'
5
+ require 'miyako'
8
6
 
9
7
  include Miyako
10
8
 
11
9
  Miyako.setTitle("Room 3")
12
10
  Screen.set_size(640, 480)
13
11
 
14
- require 'main_component'
15
- require 'title'
16
- require 'main'
17
- require 'red'
18
- require 'green'
19
- require 'blue'
20
- require 'ending'
12
+ require './main_component'
13
+ require './title'
14
+ require './main'
15
+ require './red'
16
+ require './green'
17
+ require './blue'
18
+ require './ending'
21
19
 
22
20
  r3 = Story.new
23
21
  r3.run(Title)
@@ -15,13 +15,13 @@ class Obj
15
15
  def initialize(size)
16
16
  init_layout
17
17
  set_layout_size(*size.to_a)
18
-
18
+
19
19
  # スプライトの生成
20
- @sprite = Sprite.new(size: size, type: :ac)
21
-
20
+ @sprite = Sprite.new(:size => size, :type => :ac)
21
+
22
22
  # コリジョンの生成
23
23
  @collision = Collision.new(Rect.new(0, 0, *size.to_a))
24
-
24
+
25
25
  # 位置情報の生成
26
26
  @position = Point.new(0, 0)
27
27
  end
@@ -33,7 +33,7 @@ class Obj
33
33
  @sprite.move!(*pos)
34
34
  @position.move_to!(*@layout.pos)
35
35
  end
36
-
36
+
37
37
  # スプライトとコリジョン間でマージンを設定
38
38
  def margin(dx, dy)
39
39
  @sprite.move!(dx, dy)
@@ -59,7 +59,7 @@ class Ball < Obj
59
59
 
60
60
  # 初速度の取得
61
61
  attr_reader :v0
62
-
62
+
63
63
  def initialize
64
64
  size = Size.new(32, 32)
65
65
  super(size)
@@ -181,8 +181,8 @@ end
181
181
  @font.size = 16
182
182
 
183
183
  # 情報表示用スプライトの用意
184
- @speed = Sprite.new(size: Size.new(640, 16), type: :ac)
185
- @info = Shape.text(font: @font, text: "1ボタンを押せばボールが跳ね上がります")
184
+ @speed = Sprite.new(:size => Size.new(640, 16), :type => :ac)
185
+ @info = Shape.text(:font => @font, :text => "1ボタンを押せばボールが跳ね上がります")
186
186
  @info.snap(@speed).left!.outside_bottom!
187
187
 
188
188
  Miyako.main_loop do
@@ -57,7 +57,7 @@ class MainScene
57
57
  if Input.pushed_any?(:btn1) || Input.click?(:left)
58
58
  #1ボタンを押したとき、キャラの立ち位置が、イベントの位置にに重なっていればマップイベントを実行、
59
59
  #外れていれば、コマンドウィンドウを開く
60
- event_flags = @map.events[0].map{|e| e.met?(collision: @chr.collision, pos: @chr.position)}
60
+ event_flags = @map.events[0].map{|e| e.met?(:collision => @chr.collision, :pos => @chr.position)}
61
61
  if event_flags.none?
62
62
  #標準のコマンドを表示
63
63
  @yuki.vars[:now] = @now
@@ -4,20 +4,20 @@
4
4
 
5
5
  require 'singleton'
6
6
 
7
- require 'Miyako/miyako'
7
+ require 'miyako'
8
8
 
9
9
  include Miyako
10
10
 
11
11
  Screen.fps = 60
12
12
  #Screen.fps_view = true
13
13
 
14
- require 'main_parts'
15
- require 'chara'
16
- require 'map_manager'
17
- require 'route'
18
- require 'oasis'
19
- require 'town'
20
- require 'main_scene'
14
+ require './main_parts'
15
+ require './chara'
16
+ require './map_manager'
17
+ require './route'
18
+ require './oasis'
19
+ require './town'
20
+ require './main_scene'
21
21
 
22
22
  mt = Story.new
23
23
  mt.run(MainScene)
data/sample/takahashi.rb CHANGED
@@ -2,19 +2,19 @@
2
2
  # テキスト表示・高橋メソッド形式サンプル
3
3
  # 2009.4.12 Cyross Makoto
4
4
 
5
- require 'Miyako/miyako'
5
+ require 'miyako'
6
6
 
7
7
  include Miyako
8
8
 
9
9
  # 高橋メソッド形式文字列の表示
10
10
  shape1 = Shape.takahashi(:font=>Font.serif, :align=>:center, :valign=>:bottom, :size=>Screen.size){|v|
11
11
  size(20){ text "えーびーしー" }
12
- cr
13
- text "ABC"
14
- cr
15
- under_line{"でー"} . text("えーえふじー")
16
- cr
17
- text("DEFG")
12
+ cr
13
+ text "ABC"
14
+ cr
15
+ under_line{"でー"} . text("えーえふじー")
16
+ cr
17
+ text("DEFG")
18
18
  }
19
19
 
20
20
  # 通常形式で表示
@@ -24,12 +24,12 @@ shape2 = Shape.text(:font=>Font.serif, :align=>:right){|v|
24
24
  color(:yellow){ "びー" }
25
25
  text "しー"
26
26
  }
27
- cr
28
- text "ABC"
29
- cr
30
- under_line{"でー"} . text("えーえふじー")
31
- cr
32
- text("DEFG")
27
+ cr
28
+ text "ABC"
29
+ cr
30
+ under_line{"でー"} . text("えーえふじー")
31
+ cr
32
+ text("DEFG")
33
33
  }
34
34
 
35
35
  # オートレンダー(SpriteList)にshape1、shape2を組み込み
@@ -37,6 +37,6 @@ Screen.auto_render_array << [:shape1, shape1]
37
37
  Screen.auto_render_array << [:shape2, shape2]
38
38
 
39
39
  Miyako.main_loop do
40
- break if Input.quit_or_escape?
40
+ break if Input.quit_or_escape?
41
41
  Drawing.fill(Screen, [100,100,100])
42
42
  end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-miyako
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.4
4
+ version: 2.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyross Makoto
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-10 00:00:00 +09:00
12
+ date: 2010-01-01 00:00:00 +09:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -198,6 +198,8 @@ files:
198
198
  - ./win/miyako_no_katana.so
199
199
  has_rdoc: true
200
200
  homepage: http://www.twin.ne.jp/~cyross/Miyako/
201
+ licenses: []
202
+
201
203
  post_install_message:
202
204
  rdoc_options:
203
205
  - -c utf-8
@@ -219,9 +221,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
221
  requirements: []
220
222
 
221
223
  rubyforge_project:
222
- rubygems_version: 1.3.1
224
+ rubygems_version: 1.3.5
223
225
  signing_key:
224
- specification_version: 2
226
+ specification_version: 3
225
227
  summary: Game programming library for Ruby
226
228
  test_files: []
227
229