Implemented engine
This commit is contained in:
@@ -1,18 +1,20 @@
|
||||
Gearbox = class("Gearbox")
|
||||
|
||||
function Gearbox:initialize(options)
|
||||
options = options or {}
|
||||
options = options or {}
|
||||
|
||||
self.ratios = options.ratios
|
||||
self.finalDrive = options.finalDrive
|
||||
self.ratios = options.Ratios
|
||||
self.finalDrive = options.FinalDrive
|
||||
self.reverse = options.Reverse
|
||||
|
||||
self._linkedDiffs = {}
|
||||
self.gear = 0
|
||||
|
||||
self.gear = 0
|
||||
self._linkedDiffs = {}
|
||||
self._clutch = nil
|
||||
end
|
||||
|
||||
function Gearbox:linkDiff(diff)
|
||||
table.insert(self._linkedDiffs, diff)
|
||||
table.insert(self._linkedDiffs, diff)
|
||||
end
|
||||
|
||||
function Gearbox:shift(dir)
|
||||
@@ -20,9 +22,16 @@ function Gearbox:shift(dir)
|
||||
end
|
||||
|
||||
function Gearbox:setGear(gear)
|
||||
self.gear = gear
|
||||
if gear >= -1 and gear <= #self.ratios then
|
||||
self.gear = gear
|
||||
end
|
||||
end
|
||||
|
||||
function Gearbox:linkClutch(clutch)
|
||||
self._clutch = clutch
|
||||
clutch:linkGearbox(self)
|
||||
end
|
||||
|
||||
function Gearbox:update()
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user