aboutsummaryrefslogtreecommitdiffstats
path: root/godot/scenes/Die.gd
diff options
context:
space:
mode:
authorLibravatar IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com>2022-07-17 05:18:57 +0200
committerLibravatar IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com>2022-07-17 05:18:57 +0200
commit3aab06c6763fc5ad3396bd5451c100364afeb76b (patch)
tree5e2ad17fa694b6a21876dec7f9afc5a269022f8a /godot/scenes/Die.gd
parent7e66ac4ff518e6aa091c7ccfe567e31fa1f51994 (diff)
download2022-3aab06c6763fc5ad3396bd5451c100364afeb76b.tar.gz
2022-3aab06c6763fc5ad3396bd5451c100364afeb76b.tar.bz2
2022-3aab06c6763fc5ad3396bd5451c100364afeb76b.zip
buff detection
Diffstat (limited to 'godot/scenes/Die.gd')
-rw-r--r--godot/scenes/Die.gd27
1 files changed, 24 insertions, 3 deletions
diff --git a/godot/scenes/Die.gd b/godot/scenes/Die.gd
index 878b7be..aec80a5 100644
--- a/godot/scenes/Die.gd
+++ b/godot/scenes/Die.gd
@@ -23,6 +23,14 @@ var previous_bounciness = 0
var _game: Game = null
+enum buff {
+ none,
+ stroke,
+ bounce,
+ phase,
+ ball
+}
+
# Called when the node enters the scene tree for the first time.
func _ready():
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
@@ -87,7 +95,7 @@ func _physics_process(delta):
dice_is_moving = false
if angular_velocity.length() == 0:
- get_upwards_side()
+ get_buff_from_upwards_side()
last_frame_position = Vector3(translation.x, translation.y, translation.x)
@@ -101,8 +109,21 @@ func _physics_process(delta):
BUFFS
"""
-func get_upwards_side():
- return 0
+func get_buff_from_upwards_side():
+ if $Plus1.get_overlapping_areas().size() > 0 || $Plus2.get_overlapping_areas().size() > 0:
+ print("buff: plus")
+ return buff.stroke
+ if $Ball1.get_overlapping_areas().size() > 0 || $Ball2.get_overlapping_areas().size() > 0:
+ print("buff: ball")
+ return buff.ball
+ if $Bounce1.get_overlapping_areas().size() > 0 || $Bounce2.get_overlapping_areas().size() > 0:
+ print("buff: bounce")
+ return buff.bounce
+ if $Phase1.get_overlapping_areas().size() > 0 || $Phase2.get_overlapping_areas().size() > 0:
+ print("buff: phase")
+ return buff.phase
+
+ return buff.none
func extra_stroke():