33 lines
1022 B
GDScript
33 lines
1022 B
GDScript
extends Node
|
|
|
|
class_name TracksFactory
|
|
|
|
const START = "Start"
|
|
const STRAIGHT = "StraightLong"
|
|
const STRAIGHT_SMALL = "Straight"
|
|
const CURVE_RIGHT = "CornerLarge"
|
|
const CURVE_LEFT = "CornerLargeFlipped"
|
|
const CURVE_LARGE_RIGHT = "CornerLarger"
|
|
const CURVE_LARGE_LEFT = "CornerLargerFlipped"
|
|
const CURVE_SMALL_RIGHT = "CornerSmall"
|
|
const CURVE_SMALL_LEFT = "CornerSmallFlipped"
|
|
const BUMP = "StraightLongBump"
|
|
const BUMP_SMALL = "Bump"
|
|
const SKEW_RIGHT = "StraightSkew"
|
|
const SKEW_LEFT = "StraightSkewFlipped"
|
|
const RAMP_UP = "RampLong"
|
|
const RAMP_DOWN = "RampLongFlipped"
|
|
const RAMP_CURVED_UP = "RampLongCurved"
|
|
const RAMP_CURVED_DOWN = "RampLongCurvedFlipped"
|
|
const RAMP_SMALL_UP = "Ramp"
|
|
const RAMP_SMALL_DOWN = "RampFlipped"
|
|
const CURVED_RIGHT = "CurvedFlipped"
|
|
const CURVED_LEFT = "Curved"
|
|
const LOOP = "Loop"
|
|
|
|
|
|
func get_road_instance(road):
|
|
var instance = load("res://scenes/road/road" + road + ".tscn").instance()
|
|
if !instance.get_script():
|
|
instance.set_script(load("res://scripts/road/road.gd"))
|
|
return instance |