Skip to content

Commit

Permalink
computer: rename opposite to lower half
Browse files Browse the repository at this point in the history
  • Loading branch information
dulvui committed Jan 16, 2025
1 parent 0fb99ed commit 6f34a16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions game/src/actors/computer/Computer.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
extends KinematicBody2D
class_name Computer

export var opposite: bool = false
export var lower_half: bool = false

var speed: float = 1.0
var power: int = 1
Expand All @@ -26,7 +26,7 @@ func _ready() -> void:
speed = Global.away_team_speed / 3
if Global.away_team_power:
power = Global.away_team_power
if opposite:
if lower_half:
hit_pos = ball.get_node("ComputerHitPosition2")
else:
hit_pos = ball.get_node("ComputerHitPosition")
Expand All @@ -36,7 +36,7 @@ func _physics_process(delta: float) -> void:
var ballpos: Vector2 = ball.global_position

# set destination
if opposite:
if lower_half:
if ballpos.y > 640 and ballpos.y < global_position.y:
destination = hit_pos.global_position
else:
Expand Down
2 changes: 1 addition & 1 deletion game/src/ui/game/bots/Bots.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ position = Vector2( 358.436, 266.879 )
[node name="Computer2" parent="." instance=ExtResource( 6 )]
position = Vector2( 378, 1022 )
collision_mask = 7
opposite = true
lower_half = true

[node name="Pause" parent="." instance=ExtResource( 7 )]

Expand Down

0 comments on commit 6f34a16

Please sign in to comment.