mirror of
https://github.com/PfandBoss/SemesterGameJam2022.git
synced 2025-11-12 04:16:12 +01:00
Bub
This commit is contained in:
@@ -32,8 +32,7 @@ func _ready():
|
|||||||
initial_camera_pos = $Camera3D.position
|
initial_camera_pos = $Camera3D.position
|
||||||
initial_pos_p1 = p1_train.position
|
initial_pos_p1 = p1_train.position
|
||||||
initial_pos_p2 = p2_train.position
|
initial_pos_p2 = p2_train.position
|
||||||
p1_node = StartNode
|
_set_starting_Positions()
|
||||||
p2_node = StartNode
|
|
||||||
p2_train.get_node("CharacterBody3D").is_player1 = false
|
p2_train.get_node("CharacterBody3D").is_player1 = false
|
||||||
p2_train.is_P1 = false
|
p2_train.is_P1 = false
|
||||||
p1_train.hit.connect(_on_hit_player)
|
p1_train.hit.connect(_on_hit_player)
|
||||||
@@ -58,6 +57,14 @@ func _on_turn_event():
|
|||||||
#
|
#
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
func _set_starting_Positions():
|
||||||
|
p1_node = StartNode
|
||||||
|
|
||||||
|
p2_node = StartNode.next
|
||||||
|
for n in 8:
|
||||||
|
p2_node = p2_node.next
|
||||||
|
p2_train.distance_from_start = 10 * 8
|
||||||
|
|
||||||
|
|
||||||
func _on_hit_player(player1,dmg):
|
func _on_hit_player(player1,dmg):
|
||||||
if not player1:
|
if not player1:
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class_name TrainEngine
|
|||||||
|
|
||||||
enum STATE {RUNNING, DEAD}
|
enum STATE {RUNNING, DEAD}
|
||||||
const maxSpeed = 10
|
const maxSpeed = 10
|
||||||
const refuelRate = 0.5
|
const refuelRate = 1.0
|
||||||
|
|
||||||
@onready var train = get_parent() as Train
|
@onready var train = get_parent() as Train
|
||||||
|
|
||||||
@@ -32,8 +32,8 @@ func interact(player):
|
|||||||
|
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
if not train.is_dead():
|
if not train.is_dead():
|
||||||
train.current_speed -= 0.1 * delta * 0.25
|
train.current_speed -= 0.1 * delta * 0.08 * train.current_speed
|
||||||
print("Player ",train.is_P1,train.current_speed)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user