smalruby 0.0.20-x86-mingw32 → 0.0.21-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of smalruby might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bdaab45a6bf04fcef77d956c2c8ea1bb2f4530e5
4
- data.tar.gz: 7e1ed4f7d250b1b18db3039835124a1a74e10397
3
+ metadata.gz: 011780bbacc86925ec636a2f6457cfce411df6c9
4
+ data.tar.gz: 836f8929844613b04593a2ead72db15b22295b97
5
5
  SHA512:
6
- metadata.gz: 679da4edf328f3d3e6be94875115a0fcdf2aa526b70defd382679095837188af3dd87f55657aa92991b1cff218c8c5d7c0c25565b1313f2fb8e285a372a155ec
7
- data.tar.gz: bcd71651d5e2e8a32dc0a1a9ca2b4fde4ef20009d857607c84fa7a95a738ed5c2423755bfe2c0b3705bc8412207bf6b81cbcbae3d77fb84781c9a17d23399caa
6
+ metadata.gz: 92587434753211c565f1ea77fe98defb12fbf54d88d1a29bd4e9754f9408752340de58219b61363a42cfe5e11bd6cb7ada13248aac0b981981d762bf622658bb
7
+ data.tar.gz: 26c79258c0d5757e0666e51b339cf9646d56333ce2f3d3b23cca2f9c6060a03a768ec2e7c71323e74b391c925b99a070b7c55129e9d8a5c161ae02dc796fc587
data/assets/ryu1.png ADDED
Binary file
data/assets/ryu2.png ADDED
Binary file
Binary file
Binary file
@@ -22,7 +22,8 @@ module Smalruby
22
22
  attr_accessor :event_handlers
23
23
  attr_accessor :threads
24
24
  attr_accessor :checking_hit_targets
25
- attr_accessor :angle unless Util.windows?
25
+ attr_accessor :costumes
26
+ attr_accessor :costume_index
26
27
  attr_reader :rotation_style
27
28
 
28
29
  def initialize(option = {})
@@ -36,11 +37,11 @@ module Smalruby
36
37
  }
37
38
  opt = process_optional_arguments(option, defaults)
38
39
 
39
- # TODO: コスチュームの配列に対応する
40
- if opt[:costume].is_a?(String)
41
- opt[:costume] = Image.load(asset_path(opt[:costume]))
42
- end
43
- super(opt[:x], opt[:y], opt[:costume])
40
+ @costumes = [opt[:costume]].flatten.compact.map { |costume|
41
+ costume.is_a?(String) ? Image.load(asset_path(costume)) : costume
42
+ }
43
+ @costume_index = 0
44
+ super(opt[:x], opt[:y], @costumes[@costume_index])
44
45
 
45
46
  @event_handlers = {}
46
47
  @threads = []
@@ -57,10 +58,10 @@ module Smalruby
57
58
  end
58
59
  end
59
60
 
60
- self.angle = opt[:angle] if opt[:angle] != 0
61
-
62
61
  self.rotation_style = opt[:rotation_style]
63
62
 
63
+ self.angle = opt[:angle] if opt[:angle] != 0
64
+
64
65
  # HACK: Windows XP SP3の環境でワーカースレッドで音声を読み込めな
65
66
  # い不具合が発生した。このためメインスレッドでプリロードしておく。
66
67
  %w(do re mi fa so ra si do_2).each do |n|
@@ -147,6 +148,10 @@ module Smalruby
147
148
  else
148
149
  self.scale_x = -1
149
150
  end
151
+ super(0)
152
+ else
153
+ self.scale_x = 1
154
+ super(0)
150
155
  end
151
156
  end
152
157
 
@@ -209,6 +214,13 @@ module Smalruby
209
214
  @balloon = Sprite.new(self.x, self.y, image)
210
215
  end
211
216
 
217
+ # 次のコスチュームにする
218
+ def next_costume
219
+ @costume_index += 1
220
+ @costume_index = @costume_index % @costumes.length
221
+ self.image = @costumes[@costume_index]
222
+ end
223
+
212
224
  # @!endgroup
213
225
 
214
226
  # @!group 調べる
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  module Smalruby
4
- VERSION = '0.0.20'
4
+ VERSION = '0.0.21'
5
5
  end
data/samples/car.rb CHANGED
@@ -1,8 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require 'smalruby'
3
3
 
4
- car1 = Character.new(x: 0, y: 0, costume: 'car1.png')
5
- car1.rotation_style = :free
4
+ car1 = Character.new(x: 0, y: 0, costume: 'car1.png', rotation_style: :left_right)
6
5
 
7
6
  car1.on(:start) do
8
7
  loop do
data/smalruby.gemspec CHANGED
@@ -40,7 +40,7 @@ Gem::Specification.new do |spec|
40
40
  if is_windows
41
41
  spec.add_runtime_dependency 'dxruby', '1.4.0'
42
42
  else
43
- spec.add_runtime_dependency 'dxruby_sdl', '~> 0.0.7'
43
+ spec.add_runtime_dependency 'dxruby_sdl', '~> 0.0.8'
44
44
  end
45
45
  spec.add_runtime_dependency 'dino', '~> 0.11.2'
46
46
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smalruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.21
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Kouji Takao
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-10 00:00:00.000000000 Z
11
+ date: 2014-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -245,6 +245,10 @@ files:
245
245
  - assets/piano_re.wav
246
246
  - assets/piano_si.wav
247
247
  - assets/piano_so.wav
248
+ - assets/ryu1.png
249
+ - assets/ryu2.png
250
+ - assets/taichi1.png
251
+ - assets/taichi2.png
248
252
  - lib/smalruby.rb
249
253
  - lib/smalruby/canvas.rb
250
254
  - lib/smalruby/character.rb