mirror of
https://github.com/PfandBoss/SemesterGameJam2022.git
synced 2025-11-12 04:16:12 +01:00
Leo - bug fixes
This commit is contained in:
@@ -7,20 +7,25 @@ var minSpeed = 0.0
|
||||
var deg
|
||||
var rad
|
||||
|
||||
var player
|
||||
|
||||
@onready var root = self.get_parent()
|
||||
#acceptable rotations range from -35 to +35 degrees
|
||||
func _ready():
|
||||
|
||||
player = root.player_id
|
||||
|
||||
#get Game Node reference
|
||||
while not root is Game:
|
||||
root = root.get_parent()
|
||||
|
||||
func _process(_delta):
|
||||
|
||||
if player == 1:
|
||||
currentSpeed = root.p1_train.current_speed
|
||||
else:
|
||||
currentSpeed = root.p2_train.current_speed
|
||||
|
||||
deg = currentSpeed * (70.0/maxSpeed) - 35.0
|
||||
rad = (deg * 3.14) / 180
|
||||
self.get_node("Pfeil").rotation = rad
|
||||
|
||||
func _on_stats_player_1_resized():
|
||||
print("resized")
|
||||
pass # Replace with function body.
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
extends Control
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
|
||||
|
||||
func _process(delta):
|
||||
var player_id = 1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
extends Control
|
||||
|
||||
var player_id = 2
|
||||
|
||||
func _ready():
|
||||
var gui = self.get_node("Speedometer_player1")
|
||||
for body in gui.get_children():
|
||||
|
||||
@@ -37,7 +37,7 @@ func _ready():
|
||||
p2_train.is_P1 = false
|
||||
p1_train.hit.connect(_on_hit_player)
|
||||
p2_train.hit.connect(_on_hit_player)
|
||||
p1_train.current_speed = 20
|
||||
p1_train.current_speed = 9
|
||||
p2_train.current_speed = 6
|
||||
|
||||
func getMapSize(node, is_start):
|
||||
|
||||
Reference in New Issue
Block a user