summaryrefslogtreecommitdiff
path: root/scripts/basketball.gd
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/basketball.gd')
-rw-r--r--scripts/basketball.gd19
1 files changed, 10 insertions, 9 deletions
diff --git a/scripts/basketball.gd b/scripts/basketball.gd
index 9001e68..7a50f69 100644
--- a/scripts/basketball.gd
+++ b/scripts/basketball.gd
@@ -13,7 +13,8 @@ onready var start_maximum = $"../Hoop".position.x - 40
var is_dragging = false
var waiting_for_shoot = true
var mouse_over_ball = false
-var difficulty_phase = 1
+var phase = 1
+var phase_increment = [5, 15, 25, 35, 45, 55]
func _ready():
start_position = global_position
@@ -86,19 +87,19 @@ func _on_InnerShape_mouse_exited():
func position_changer():
# Progressive
- if difficulty_phase == 1:
+ if phase == 1:
start_position.x -= 20
start_position.x = clamp(start_position.x, start_minimum, start_maximum)
# Random
- if difficulty_phase == 2:
+ if phase == 2:
start_position.x = rand_range(start_minimum, start_maximum)
func _on_Hoop_score():
- if global_variables.score >= 5 and global_variables.score < 15:
- difficulty_phase = 2
- if global_variables.score >= 15 and global_variables.score < 25:
+ if global_variables.score >= phase_increment[0] and global_variables.score < phase_increment[1]:
+ phase = 2
+ if global_variables.score >= phase_increment[1] and global_variables.score < phase_increment[2]:
start_minimum = (drag_radius * 2) + $"../Camera2D".limit_left
- difficulty_phase = 1
- if global_variables.score >= 25 and global_variables.score < 35:
- difficulty_phase = 2
+ phase = 1
+ if global_variables.score >= phase_increment[2] and global_variables.score < phase_increment[3]:
+ phase = 2
position_changer()