minigl 2.3.1 → 2.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -4
  3. data/lib/minigl/movement.rb +7 -4
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 01f5acaeb5e8ec1f22e2ffcd206b34a65bdd10215bbf11905d81d669c016c966
4
- data.tar.gz: 27e794b64224d12c5e9d839f811b98832a3f033d15dd8589b202d9813d1155fb
3
+ metadata.gz: 6ac508ba7f8437fc38fe8fbb4f0bd9b82e95fcaecb629cd5fa9ed5e38f34058e
4
+ data.tar.gz: c6feadf293623b39817281093e9cb0f92fe72935d698ff7b0bc24b8a8e3881e0
5
5
  SHA512:
6
- metadata.gz: 2b3fc964c0a8fd8cebbbbef53b8e04724ff598a1dcc3239ee80c3416e1280653e1a8afa78f0d733809376d057ec918c62dc6973ed7f9b91395dd237b96607e55
7
- data.tar.gz: dd1bd674701076bc3fb1c9e1c4ea935cd5aa40288bfd440712bf08fd2d3156c5b3bd1c580a565dc8a842af1c9238bc34158c0d04ee9067b114c27c1568318d40
6
+ metadata.gz: 1f54a8f402998aae0f9db1cb40266d8a165a69b2d637ddd36b2190e66319a73fe49dcc20b88757abcfb68fd9c86a3f91889020634c71cd998836013bcb842ee9
7
+ data.tar.gz: bdc777463aa6681d0cbd1e18dd2e02af34d84e4d59daf0ce51f71d9b7fe6cd97b671c1db7420274c436ff74a83fc3244c650ed984947ff0a4925842e6ad62211
data/README.md CHANGED
@@ -29,11 +29,9 @@ After installing the Gosu dependencies, you can just `gem install minigl`.
29
29
  * The [wiki](https://github.com/victords/minigl/wiki) is a work in progress with tutorials and examples.
30
30
  * Test package and examples aren't complete!
31
31
 
32
- ## Version 2.3.1
32
+ ## Version 2.3.2
33
33
 
34
- * Fix bug in `Movement#move_carrying`.
35
- * Fix `ImageFont#draw_markup_rel` for different values of `rel_x` and `rel_y`.
36
- * Add missing documentation in `TextHelper` methods.
34
+ * Added the `ignore_collision` option to `Movement#move_carrying`.
37
35
 
38
36
  ## Contributing
39
37
 
@@ -365,11 +365,14 @@ module MiniGL
365
365
  # +x+, +y+, +w+ and +h+.
366
366
  # [obstacles] Obstacles that should be considered for collision checking
367
367
  # with the carried objects, if they include the +Movement+
368
- # module, and with this object too, if moving with forces.
368
+ # module, and with this object too, if moving with forces and
369
+ # the +ignore_collision+ flag is false.
369
370
  # [ramps] Ramps that should be considered for the carried objects, if they
370
371
  # include the +Movement+ module, and for this object too, if moving
371
- # with forces.
372
- def move_carrying(arg, speed, carried_objs, obstacles, ramps)
372
+ # with forces and +ignore_collision+ is false.
373
+ # [ignore_collision] Set to true to make this object ignore collision even
374
+ # when moving with forces.
375
+ def move_carrying(arg, speed, carried_objs, obstacles, ramps, ignore_collision = false)
373
376
  if speed
374
377
  x_d = arg.x - @x; y_d = arg.y - @y
375
378
  distance = Math.sqrt(x_d**2 + y_d**2)
@@ -410,7 +413,7 @@ module MiniGL
410
413
  @y = y_aim
411
414
  end
412
415
  else
413
- move(arg, obstacles, ramps)
416
+ move(arg, ignore_collision ? [] : obstacles, ignore_collision ? [] : ramps)
414
417
  end
415
418
 
416
419
  forces = Vector.new @x - prev_x, @y - prev_y
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minigl
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor David Santos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-22 00:00:00.000000000 Z
11
+ date: 2020-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gosu