mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 06:41:55 +00:00
rename everything to .luau extension
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -271,8 +271,6 @@ function Elevator.constructor(TagsConstructor, ButtonsTags, LanternsTags, Landin
|
||||
return ClassConstructor
|
||||
end
|
||||
|
||||
local CurrentFloor = Attributes.CurrentFloor.Value
|
||||
|
||||
local function CheckFloorQueue(self: ClassConstructor)
|
||||
if self.RelayAlgorithmConstructor.__FloorQueue[1] ~= Attributes.CurrentFloor.Value then
|
||||
elevatorwarn("The floor queue first index did not match the elevator's current floor, CurrentFloor=", Attributes.CurrentFloor.Value, "FloorQueue[1]=", self.RelayAlgorithmConstructor.__FloorQueue[1])
|
||||
@@ -290,16 +288,15 @@ end
|
||||
|
||||
local function CabTraveling(self: ClassConstructor, deltaTime: number, LevelVec3: number, ElevatorGoingUp: boolean)
|
||||
local Elevator_Position = self.ElevatorBox_1960.Position
|
||||
local Between_Levels = LevelingModule.LevelingBetween[CurrentFloor]
|
||||
local Between_Levels = LevelingModule.LevelingBetween[Attributes.CurrentFloor.Value]
|
||||
|
||||
if ElevatorGoingUp then
|
||||
--Detecting between the floors
|
||||
if Elevator_Position.Y>=Between_Levels then
|
||||
local PreviousFloor = CurrentFloor
|
||||
CurrentFloor+=1
|
||||
Attributes.CurrentFloor.Value = CurrentFloor
|
||||
local PreviousFloor = Attributes.CurrentFloor.Value
|
||||
Attributes.CurrentFloor.Value+=1
|
||||
|
||||
Events.CabProgression:Fire(PreviousFloor, CurrentFloor)
|
||||
Events.CabProgression:Fire(PreviousFloor, Attributes.CurrentFloor.Value)
|
||||
end
|
||||
|
||||
--Elevator is riding upwards towards the destination
|
||||
@@ -323,11 +320,10 @@ local function CabTraveling(self: ClassConstructor, deltaTime: number, LevelVec3
|
||||
--Detecting between the floors
|
||||
--leaving floor ElevatorPosition Y=62, Between_levels=75
|
||||
if Elevator_Position.Y<=Between_Levels then
|
||||
local PreviousFloor = CurrentFloor
|
||||
CurrentFloor-=1
|
||||
Attributes.CurrentFloor.Value = CurrentFloor
|
||||
local PreviousFloor = Attributes.CurrentFloor.Value
|
||||
Attributes.CurrentFloor.Value-=1
|
||||
|
||||
Events.CabProgression:Fire(PreviousFloor, CurrentFloor)
|
||||
Events.CabProgression:Fire(PreviousFloor, Attributes.CurrentFloor.Value)
|
||||
end
|
||||
|
||||
--Elevator is riding upwards towards the destination
|
||||
@@ -349,7 +345,7 @@ local function CabTraveling(self: ClassConstructor, deltaTime: number, LevelVec3
|
||||
end
|
||||
end
|
||||
|
||||
Events.CabTraveling:Fire(Elevator_Position)
|
||||
Events.CabTraveling:Fire(Elevator_Position, Attributes.CurrentFloor.Value)
|
||||
end
|
||||
|
||||
function Elevator:__TravelToFloor(LevelInt, LevelVec3, ElevatorGoingUp)
|
||||
@@ -50,7 +50,7 @@ print("[DEBUG] Lanterns=", Lanterns)
|
||||
local LandingDoors = TagsConstructor:__ElevatorDoors()
|
||||
print("[DEBUG] Elevator Landing Doors=", LandingDoors)
|
||||
|
||||
local Otis1960Lanterns = Lanterns[Enums.Elevator.Otis1960]
|
||||
local Otis1960Lanterns= Lanterns[Enums.Elevator.Otis1960]
|
||||
local Otis1960Buttons = Buttons[Enums.Elevator.Otis1960]
|
||||
local Otis1960LandingDoors = LandingDoors[Enums.Elevator.Otis1960]
|
||||
local Otis1960 = Otis1960_Module.constructor(TagsConstructor, Otis1960Buttons, Otis1960Lanterns, Otis1960LandingDoors)
|
||||
@@ -65,5 +65,9 @@ Otis1960_Module.Events.Parked.Event:Connect(function()
|
||||
end)
|
||||
|
||||
Otis1960_Module.Events.CabProgression.Event:Connect(function(previousFloor: number?, nextFloor: number)
|
||||
print("previousFloor=",previousFloor, "nextFloor=",nextFloor)
|
||||
--print("previousFloor=",previousFloor, "nextFloor=",nextFloor)
|
||||
end)
|
||||
|
||||
Otis1960_Module.Events.CabTraveling.Event:Connect(function(Elevator_Position: Vector3, CurrentFloor: number)
|
||||
print("CurrentFloor=",CurrentFloor)
|
||||
end)
|
||||
Reference in New Issue
Block a user