This repository has been archived on 2023-12-19. You can view files and clone it, but cannot push or open issues or pull requests.
MUR/scripts/road/roads_factory.gd

33 lines
1022 B
GDScript3
Raw Normal View History

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