keep_calm_and_balance 0.4 → 0.5
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 +4 -4
- data/lib/CHANGELOG.md +9 -0
- data/lib/keep_calm_and_balance.gemspec +2 -2
- data/lib/keep_calm_and_balance.rb +1 -1
- data/lib/lib/effects/effect_dealer.rb +7 -1
- data/lib/lib/effects/paddle_effect.rb +47 -0
- data/lib/lib/items/seesaw.rb +2 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79aefc453af779f6913fc634fb8add221b7f8e6916ffff25e046f2a261e8adb6
|
4
|
+
data.tar.gz: bd89774663d3904121c659105c9fc1f1d69cc5d5106e88c5bf6d2d1b7345c347
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1266025fa7fa0062e03d7d924f3886b1e6284793c423c57225c386a36ce69e431b6022c0353fe438b1543b3e9afbc2a24335b04c6469966e53db12e059c6f46a
|
7
|
+
data.tar.gz: 1588ced9a4984d74182d2cd8143a6522007c8d76df59e2815595e49c048a26e069451f685df65a48c623d4053b210fada5a33212f248f9efb20c92b4c44fa334
|
data/lib/CHANGELOG.md
CHANGED
@@ -9,6 +9,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
9
9
|
### Removed
|
10
10
|
|
11
11
|
|
12
|
+
## [v5](../../tags/v5) – 2021-10-25
|
13
|
+
### Added
|
14
|
+
- paddle effect
|
15
|
+
|
16
|
+
### Changed
|
17
|
+
- first effect is wind one
|
18
|
+
- paddle effect both for length and thickness
|
19
|
+
|
20
|
+
|
12
21
|
## [v4](../../tags/v4) – 2021-10-24
|
13
22
|
### Added
|
14
23
|
- effect dealer
|
@@ -2,8 +2,8 @@ require 'rake'
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'keep_calm_and_balance'
|
5
|
-
spec.version = '0.
|
6
|
-
spec.date = '2021-10-
|
5
|
+
spec.version = '0.5'
|
6
|
+
spec.date = '2021-10-25'
|
7
7
|
spec.license = 'CC-BY-SA-3.0'
|
8
8
|
|
9
9
|
spec.summary = "An action balancing game"
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require_relative './paddle_effect'
|
1
2
|
require_relative './wind_effect'
|
2
3
|
|
3
4
|
FIRST_EFFECT_TIME = 2 # seconds til the first effect
|
@@ -12,7 +13,7 @@ class EffectDealer
|
|
12
13
|
@seasaw = seasaw
|
13
14
|
@barrel = barrel
|
14
15
|
|
15
|
-
@
|
16
|
+
@other_known = [PaddleEffect] # added to available later
|
16
17
|
reset!
|
17
18
|
end
|
18
19
|
|
@@ -31,6 +32,11 @@ class EffectDealer
|
|
31
32
|
if time_for_next?
|
32
33
|
@latest = @available.sample.new(@infopane, @seasaw, @barrel) # pick random one
|
33
34
|
@active.push(@latest)
|
35
|
+
|
36
|
+
if !@latest_at # the first effect just got picked
|
37
|
+
@available += @other_known
|
38
|
+
end
|
39
|
+
|
34
40
|
@latest_at = @infopane.time
|
35
41
|
end
|
36
42
|
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
PADDLE_LIMITED = 60
|
2
|
+
PADDLE_CHANGE = 0.003 # percentage
|
3
|
+
|
4
|
+
LONG = 'long' # longer seasaw
|
5
|
+
SHORT = 'short' # longer seasaw
|
6
|
+
THICK = 'thick' # thicker seasaw
|
7
|
+
THIN = 'small' # thiner seasaw
|
8
|
+
|
9
|
+
class PaddleEffect
|
10
|
+
attr_reader :name
|
11
|
+
|
12
|
+
def initialize(infopane, seasaw, barrel)
|
13
|
+
@infopane = infopane
|
14
|
+
@seasaw = seasaw # not utilized
|
15
|
+
@barrel = barrel
|
16
|
+
|
17
|
+
@type = [LONG, SHORT, THICK, THIN].sample
|
18
|
+
@name = "#{@type} paddle"
|
19
|
+
|
20
|
+
@times_applied = 0
|
21
|
+
end
|
22
|
+
|
23
|
+
def update
|
24
|
+
if @times_applied < PADDLE_LIMITED
|
25
|
+
@direction = {
|
26
|
+
LONG => 1,
|
27
|
+
SHORT => -1,
|
28
|
+
THICK => 1,
|
29
|
+
THIN => -1
|
30
|
+
}[@type]
|
31
|
+
coeficient = 1 + @direction * PADDLE_CHANGE # add or sub the change
|
32
|
+
|
33
|
+
case @type
|
34
|
+
when LONG, SHORT then
|
35
|
+
@seasaw.scale_x *= coeficient
|
36
|
+
when THICK, THIN then
|
37
|
+
@seasaw.scale_y *= coeficient
|
38
|
+
end
|
39
|
+
|
40
|
+
@times_applied += 1
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def draw
|
45
|
+
# TODO nothing?
|
46
|
+
end
|
47
|
+
end
|
data/lib/lib/items/seesaw.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keep_calm_and_balance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.5'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Detros
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gosu
|
@@ -51,6 +51,7 @@ files:
|
|
51
51
|
- lib/keep_calm_and_balance.gemspec
|
52
52
|
- lib/keep_calm_and_balance.rb
|
53
53
|
- lib/lib/effects/effect_dealer.rb
|
54
|
+
- lib/lib/effects/paddle_effect.rb
|
54
55
|
- lib/lib/effects/wind_effect.rb
|
55
56
|
- lib/lib/items/barrel.rb
|
56
57
|
- lib/lib/items/seesaw.rb
|