bestguigui_lab 0.7.0 → 0.10.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7feac3a249d87251ad58de5f8c57710a2145397f3e89ca1403a01b3d8d60448
4
- data.tar.gz: be7f8c50bd86ba6ec526ff14918ff5e95a496b8abc42c4cdee7b726f2b49e6ad
3
+ metadata.gz: 794326e97286d25be2eee9a66e661f554bba438bca9e595a93b76a74e54031c1
4
+ data.tar.gz: b5544628293217d602f842f3f0151622f7b16ef9a9cfab0b25eed29954d3ca06
5
5
  SHA512:
6
- metadata.gz: a1bf4728a5e383ffb1d042ebfac95e5bc939d1e8b08774cc5179323584b3ff2bd88c3d91dec9c683cd23ab7bd8e441aa809616b7664bc32b2f699496ab4d20a2
7
- data.tar.gz: d833d0f6452eda6520a63be8bf9d9c69bf7b44bdf1e3b13970a400571e52985d5850b6c52760050011d52aba1c914ca4e460cfee365f4302d25ef1a5e61bda68
6
+ metadata.gz: 192b71239f32d5f09ebe0bc993edde160aaeaf18bb0539a25e134bff220f5e2c24f0c165a7de4fb9baf351698e3888aa582ef8cf70a4a6775c7fc43794949615
7
+ data.tar.gz: 3b8a34f3e8a72458d9d705ed4dadac63c779cc3faf5037b12710f3e54705905821275fe5fc0f243959943422a93d59b308a2e6775fa47339fe0dcb8288fbb10a
@@ -4,6 +4,7 @@ module Bestguigui
4
4
  # Charge et met en cache les assets (images, sons, modèles 3D...) pour éviter de les recharger plusieurs fois.
5
5
  class Assets
6
6
  @root = Dir.pwd
7
+ @gem_root = __dir__ # lib/bestguigui_lab, pour les ressources embarquees dans le kit
7
8
 
8
9
  @images = Hash.new { |cache, path| cache[path] = Gosu::Image.new(path, retro: true) }
9
10
  @sounds = Hash.new { |cache, path| cache[path] = Gosu::Sample.new(path) }
@@ -16,6 +17,10 @@ module Bestguigui
16
17
  def self.resolve(name) = File.expand_path(name, @root)
17
18
  def self.image(name) = @images[resolve(name)]
18
19
  def self.sound(name) = @sounds[resolve(name)]
20
+
21
+ # Pour un fichier livre avec le kit (lib/bestguigui_lab/...), pas avec
22
+ # le projet de l'utilisateur : resout par rapport a la gem, pas Dir.pwd.
23
+ def self.gem_sound(*relative_parts) = @sounds[File.join(@gem_root, *relative_parts)]
19
24
  def self.song(name) = @songs[resolve(name)]
20
25
 
21
26
  def self.font(name = Gosu.default_font_name, size: 20)
@@ -134,6 +134,7 @@ module Bestguigui
134
134
  @subtitle_font = Assets.font(size: 24)
135
135
  @gosu_font = Assets.font(size: 36)
136
136
  @elapsed = 0.0
137
+ Assets.gem_sound('assets', 'splash_jingle.wav').play
137
138
  end
138
139
 
139
140
  def update(dt)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bestguigui
4
- VERSION = '0.7.0'
4
+ VERSION = '0.10.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bestguigui_lab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bestguigui
@@ -44,6 +44,7 @@ files:
44
44
  - lib/bestguigui_lab.rb
45
45
  - lib/bestguigui_lab/animation.rb
46
46
  - lib/bestguigui_lab/assets.rb
47
+ - lib/bestguigui_lab/assets/splash_jingle.wav
47
48
  - lib/bestguigui_lab/gl_texture.rb
48
49
  - lib/bestguigui_lab/helpers.rb
49
50
  - lib/bestguigui_lab/image_pixels.rb