minigl 2.2.7 → 2.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/minigl/movement.rb +24 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b4770937913304de29f2696a7d7a0e75fc468185579efa3b421a4abe46253e8
|
4
|
+
data.tar.gz: 84c72db0c03039a09767d39138b681201a2d5028e3ef278b1096b1c89b9e472d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36242a7d0fd3c52df939408e744bc01139b2b34b7f9b3f86e6e64989778a0eb51b48fa7eb56ebf74c8a0e59a6781cadf186e4cd0719002afa6abf4c2f14998c3
|
7
|
+
data.tar.gz: b0706f37c19fd9e48bf43fc0921b9c9991e355044c5e99374df4821a5be18b5abda87c73375d1cdc84a3bd964a28fbc7e0c176c2e78167b50ebcd5ae015a2137
|
data/README.md
CHANGED
@@ -29,9 +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.2.
|
32
|
+
## Version 2.2.8
|
33
33
|
|
34
|
-
* Add
|
34
|
+
* Add `stop_time` parameter to the `cycle` method of `Movement` (included in `GameObject`).
|
35
35
|
|
36
36
|
## Contributing
|
37
37
|
|
data/lib/minigl/movement.rb
CHANGED
@@ -504,16 +504,32 @@ module MiniGL
|
|
504
504
|
# of the objects being carried.
|
505
505
|
# [obst_ramps] Ramps to consider when moving objects from the +obstacles+
|
506
506
|
# array, as described for +obst_obstacles+.
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
507
|
+
# [stop_time] Optional stop time (in frames) when the object reaches each of
|
508
|
+
# the points.
|
509
|
+
def cycle(points, speed, obstacles = nil, obst_obstacles = nil, obst_ramps = nil, stop_time = 0)
|
510
|
+
unless @cycle_setup
|
511
|
+
@cur_point = 0 if @cur_point.nil?
|
512
|
+
if obstacles
|
513
|
+
move_carrying points[@cur_point], speed, obstacles, obst_obstacles, obst_ramps
|
514
|
+
else
|
515
|
+
move_free points[@cur_point], speed
|
516
|
+
end
|
513
517
|
end
|
514
518
|
if @speed.x == 0 and @speed.y == 0
|
515
|
-
|
516
|
-
|
519
|
+
unless @cycle_setup
|
520
|
+
@cycle_timer = 0
|
521
|
+
@cycle_setup = true
|
522
|
+
end
|
523
|
+
if @cycle_timer >= stop_time
|
524
|
+
if @cur_point == points.length - 1
|
525
|
+
@cur_point = 0
|
526
|
+
else
|
527
|
+
@cur_point += 1
|
528
|
+
end
|
529
|
+
@cycle_setup = false
|
530
|
+
else
|
531
|
+
@cycle_timer += 1
|
532
|
+
end
|
517
533
|
end
|
518
534
|
end
|
519
535
|
|
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.2.
|
4
|
+
version: 2.2.8
|
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-04-
|
11
|
+
date: 2020-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gosu
|