Ronela 0.0.3 → 0.0.4

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.
Files changed (4) hide show
  1. data/bin/ronela +1 -0
  2. data/lib/ronela.rb +119 -7
  3. data/lib/ronela_lenguaje.rb +7 -3
  4. metadata +30 -50
data/bin/ronela CHANGED
@@ -3,6 +3,7 @@ require 'rubygems'
3
3
  require 'ronela'
4
4
 
5
5
 
6
+ Ronela::Ronela.iniciar_sdl
6
7
  r = Ronela::Ronela.new
7
8
 
8
9
  guion = ARGV[0]
data/lib/ronela.rb CHANGED
@@ -55,6 +55,7 @@ module Ronela
55
55
  #convierte formato fff a [255,255,255]
56
56
  def Color.html_a_sdl(val)
57
57
  #@todo agregar muchos más
58
+ #Lista de colores tomada de https://es.wikipedia.org/wiki/Anexo:Colores
58
59
  case val.to_s
59
60
  when 'rojo'
60
61
  return [255, 0, 0]
@@ -64,6 +65,110 @@ module Ronela
64
65
  return [0, 0, 255]
65
66
  when 'verde'
66
67
  return [255, 0, 0]
68
+ when 'aguamarina'
69
+ val = "7fffd4"
70
+ when 'ámbar'
71
+ val = "ffbf00"
72
+ when 'amatista'
73
+ val = "9966cc"
74
+ when 'argén'
75
+ val = "c0c0c0"
76
+ when 'arsénico'
77
+ val = "38444b"
78
+ when 'azul_alicia'
79
+ val = "f0f8ff"
80
+ when 'azul_cobalto'
81
+ val = "0047ab"
82
+ when 'azul_marino'
83
+ val = "120a8f"
84
+ when 'azur'
85
+ val = "007fff"
86
+ when 'beis'
87
+ val = "f5f5dc"
88
+ when 'beige'
89
+ val = "f5f5dc"
90
+ when 'bermellón'
91
+ val = "e34234"
92
+ when 'caqui'
93
+ val = "94812b"
94
+ when 'carmesí'
95
+ val = "dc143c"
96
+ when 'carmín'
97
+ val = "969918"
98
+ when 'carnación'
99
+ val = "fec3ac"
100
+ when 'celeste'
101
+ val = "87ceff"
102
+ when 'cerúleo'
103
+ val = "9bc4e2"
104
+ when 'cian'
105
+ val = "00ffff"
106
+ when 'crema'
107
+ val = "fffdd0"
108
+ when 'coral'
109
+ val = "ff7f50"
110
+ when 'escarlata'
111
+ val = "ff2400"
112
+ when 'esmeralda'
113
+ val = "50c878"
114
+ when 'espárrago'
115
+ val = "7ba05b"
116
+ when 'fucsia'
117
+ val = "ff00ff"
118
+ when 'granate'
119
+ val = "800000"
120
+ when 'gris'
121
+ val = "808080"
122
+ when 'lavanda'
123
+ val = "e7e7fa"
124
+ when 'lila'
125
+ val = "c8a2c8"
126
+ when 'limón'
127
+ val = "fde910"
128
+ when 'lima'
129
+ val = "bfff00"
130
+ when 'lino'
131
+ val = "faf0e6"
132
+ when 'magenta'
133
+ val = "ff00ff"
134
+ when 'marrón'
135
+ val = "964b00"
136
+ when 'morado'
137
+ val = "c54b8c"
138
+ when 'naranja'
139
+ val = "ff7028"
140
+ when 'negro'
141
+ val = "000000"
142
+ when 'nieve'
143
+ val = "fffafa"
144
+ when 'ocre'
145
+ val = "cc7722"
146
+ when 'verde_oliva'
147
+ val = "808000"
148
+ when 'oro'
149
+ val = "ffd700"
150
+ when 'pardo'
151
+ val = "964b00"
152
+ when 'plateado'
153
+ val = "c0c0c0"
154
+ when 'púrpura'
155
+ val = "660099"
156
+ when 'rosa'
157
+ val = "ffc0cb"
158
+ when 'rosa_fuerte'
159
+ val = "ff007f"
160
+ when 'salmón'
161
+ val = "ffcc99"
162
+ when 'trigo'
163
+ val = "f5deb3"
164
+ when 'turquesa'
165
+ val = "30d5c8"
166
+ when 'turquí'
167
+ val = "000080"
168
+ when 'violeta'
169
+ val = "8f00ff"
170
+ when 'zafiro'
171
+ val = "0131b4"
67
172
  end
68
173
 
69
174
  if val.size == 6
@@ -314,22 +419,23 @@ module Ronela
314
419
  #Un motor de novelas gráficas simple y en español
315
420
  class Ronela
316
421
 
317
-
422
+ @@audio = false
423
+ def Ronela.audio; @@audio; end
424
+
318
425
  def Ronela.iniciar_sdl
319
- SDL.init(SDL::INIT_VIDEO|SDL::INIT_AUDIO)
426
+ SDL.init(SDL::INIT_VIDEO|SDL::INIT_AUDIO|SDL::INIT_VIDEO)
320
427
  SDL::TTF.init unless SDL::TTF.init?
321
428
  begin
322
429
  SDL::Mixer.open
323
- @audio = true
430
+ @@audio = true
324
431
  rescue
325
- @audio = false
432
+ @@audio = false
326
433
  end
327
434
 
328
435
  $pantalla = SDL.setVideoMode($config[:PANTALLA_ANCHO], $config[:PANTALLA_ALTO], $config[:PANTALLA_BPP], $config[:PANTALLA_FLAGS])
329
436
  end
330
437
 
331
438
  def initialize
332
- Ronela.iniciar_sdl
333
439
 
334
440
  @salir = false
335
441
 
@@ -378,13 +484,19 @@ module Ronela
378
484
  end
379
485
  }
380
486
 
487
+ #Espera accion del usuarix
488
+ #Esperar
489
+ @lenguaje.Esperar { |variables, resto|
490
+ @parar = true
491
+ }
492
+
381
493
  #Registra Musica
382
494
  #Música <nombre música> <archivo=ruta..>
383
495
  @lenguaje.Música { |variables, resto|
384
496
  nombre = resto.join(" ")
385
497
  archivo = variables["archivo"]
386
498
 
387
- if @audio and !archivo.nil? and File.exists? archivo
499
+ if @@audio and !archivo.nil? and File.exists? archivo
388
500
  @musicas[nombre].destroy if @musicas.has_key? nombre
389
501
  @musicas[nombre] = SDL::Mixer::Music.load(archivo)
390
502
  end
@@ -396,7 +508,7 @@ module Ronela
396
508
  nombre = resto.join(" ")
397
509
  archivo = variables["archivo"]
398
510
 
399
- if @audio and !archivo.nil? and File.exists? archivo
511
+ if @@audio and !archivo.nil? and File.exists? archivo
400
512
  @sonidos[nombre].destroy if @sonidos.has_key? nombre
401
513
  @sonidos[nombre] = SDL::Mixer::Wave.load(archivo)
402
514
  end
@@ -81,14 +81,18 @@ class RonelaLenguaje
81
81
  end
82
82
  end
83
83
 
84
- @acciones[accion].call(variables, resto)
84
+ @acciones[accion].each {|f| f.call(variables, resto)}
85
85
  end
86
86
 
87
87
  #@method indica la accion y se espera una funcion
88
- #que será llamada cuando se encuentre la accion
88
+ #que será llamada cuando se encuentre la accion, se pueden registrar varias funcionse para una misma accion
89
89
  #con los argumentos @variables, @resto
90
90
  def method_missing(method, *args, &func)
91
- @acciones[method.to_s] = func
91
+ unless @acciones[method.to_s].kind_of? Array
92
+ @acciones[method.to_s] = []
93
+ end
94
+
95
+ @acciones[method.to_s] << func
92
96
  end
93
97
  end
94
98
 
metadata CHANGED
@@ -1,81 +1,61 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: Ronela
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 0
8
- - 3
9
- version: 0.0.3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.4
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Jovany Leandro G.C
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-10-28 00:00:00 -05:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2011-10-28 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: rubysdl
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &81259190 !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- segments:
29
- - 0
30
- - 0
31
- - 0
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
32
21
  version: 0.0.0
33
22
  type: :runtime
34
- version_requirements: *id001
23
+ prerelease: false
24
+ version_requirements: *81259190
35
25
  description:
36
26
  email: info@manadalibre.org
37
- executables:
27
+ executables:
38
28
  - ronela
39
29
  extensions: []
40
-
41
- extra_rdoc_files:
30
+ extra_rdoc_files:
42
31
  - LEAME
43
- files:
32
+ files:
44
33
  - lib/ronela.rb
45
34
  - lib/ronela_lenguaje.rb
46
35
  - LEAME
47
36
  - bin/ronela
48
- has_rdoc: true
49
37
  homepage: http://www.manadalibre.org/desarrollos/doku.php?id=videojuegos:ronela
50
38
  licenses: []
51
-
52
39
  post_install_message:
53
40
  rdoc_options: []
54
-
55
- require_paths:
41
+ require_paths:
56
42
  - lib
57
- required_ruby_version: !ruby/object:Gem::Requirement
43
+ required_ruby_version: !ruby/object:Gem::Requirement
58
44
  none: false
59
- requirements:
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- segments:
63
- - 0
64
- version: "0"
65
- required_rubygems_version: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
50
  none: false
67
- requirements:
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- segments:
71
- - 0
72
- version: "0"
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
73
55
  requirements: []
74
-
75
56
  rubyforge_project:
76
- rubygems_version: 1.3.7
57
+ rubygems_version: 1.8.11
77
58
  signing_key:
78
59
  specification_version: 3
79
- summary: "Ronela un motor de novelas gr\xC3\xA1ficas en espa\xC3\xB1ol"
60
+ summary: Ronela un motor de novelas gráficas en español
80
61
  test_files: []
81
-