From c7e8f17ba13d4c9e54764286367a26f25b049dc4 Mon Sep 17 00:00:00 2001 From: realtradam Date: Thu, 19 Mar 2020 03:32:54 -0400 Subject: fixed up file structure --- Racing-Game/4WheelCar/Weight/WeightCreation.gd | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Racing-Game/4WheelCar/Weight/WeightCreation.gd (limited to 'Racing-Game/4WheelCar/Weight/WeightCreation.gd') diff --git a/Racing-Game/4WheelCar/Weight/WeightCreation.gd b/Racing-Game/4WheelCar/Weight/WeightCreation.gd new file mode 100644 index 0000000..290325c --- /dev/null +++ b/Racing-Game/4WheelCar/Weight/WeightCreation.gd @@ -0,0 +1,23 @@ +extends Node + + +# This script creates and attaches all "masses". This makes it possible +# to simulate unbalanced weight distribution in a vehicle + + +# Called when the node enters the scene tree for the first time. +func _ready(): + createWeight([0,30,30]) + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +#func _process(delta): +# pass + +func createWeight(dataArray): + var weighttemp_resource = load("res://4WheelCar/Weight/Weight.tscn") + var weighttemp = weighttemp_resource.instance() + weighttemp.set_position(Vector2(dataArray[0],dataArray[1])) + add_child(weighttemp) + weighttemp.initVars(dataArray) -- cgit v1.2.3