init.lua 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  2. local lib = ReplicatedStorage:WaitForChild("lib")
  3. local stageObjectSystem = script:WaitForChild("stageObjectSystem")
  4. local gameControlSystem = script:WaitForChild("gameControlSystem")
  5. local characterComponentSystem = script:WaitForChild("characterComponentSystem")
  6. local RECS = require(lib:WaitForChild("RECS"))
  7. -- services will be registered in the order given
  8. local serviceDeffinitions = {
  9. ObbySystem = require(gameControlSystem:WaitForChild("ObbySystem")),
  10. StageSystem = require(gameControlSystem:WaitForChild("StageSystem")),
  11. PlayerHitboxSystem = require(characterComponentSystem:WaitForChild("PlayerHitboxSystem")),
  12. CastShadowSystem = require(characterComponentSystem:WaitForChild("CastShadowSystem")),
  13. DamageTriggerSystem = require(stageObjectSystem:WaitForChild("DamageTriggerSystem")),
  14. CoinTriggerSystem = require(stageObjectSystem:WaitForChild("CoinTriggerSystem")),
  15. ForceSystem = require(stageObjectSystem:WaitForChild("ForceSystem")),
  16. FanSystem = require(stageObjectSystem:WaitForChild("FanSystem")),
  17. ConveyorSystem = require(stageObjectSystem:WaitForChild("ConveyorSystem")),
  18. TrampolineSystem = require(stageObjectSystem:WaitForChild("TrampolineSystem")),
  19. CompositePositionSystem = require(stageObjectSystem:WaitForChild("CompositePositionSystem")),
  20. MovingPlatformSystem = require(stageObjectSystem:WaitForChild("MovingPlatformSystem")),
  21. SpinnerSystem = require(stageObjectSystem:WaitForChild("SpinnerSystem")),
  22. PlayerStatsSystem = require(gameControlSystem:WaitForChild("PlayerStatsSystem")),
  23. }
  24. -- registration
  25. return {
  26. RECS.event(game:GetService("RunService").RenderStepped, {
  27. serviceDeffinitions.SpinnerSystem,
  28. serviceDeffinitions.CompositePositionSystem,
  29. serviceDeffinitions.CastShadowSystem,
  30. serviceDeffinitions.PlayerHitboxSystem,
  31. }),
  32. RECS.interval(1, {
  33. serviceDeffinitions.PlayerStatsSystem,
  34. serviceDeffinitions.CoinTriggerSystem,
  35. serviceDeffinitions.DamageTriggerSystem,
  36. serviceDeffinitions.TrampolineSystem,
  37. serviceDeffinitions.StageSystem,
  38. serviceDeffinitions.ObbySystem,
  39. })
  40. }