jecs/demo/src/ServerScriptService/main.server.luau

23 lines
768 B
Text
Raw Normal View History

local ReplicatedStorage = game:GetService("ReplicatedStorage")
2025-04-28 21:40:03 +00:00
local ServerScriptService = game:GetService("ServerScriptService")
local jecs = require(ReplicatedStorage.ecs)
local schedule = require(ReplicatedStorage.schedule)
local observers_add = require(ReplicatedStorage.observers_add)
2024-08-29 13:45:49 +00:00
2025-04-28 21:40:03 +00:00
local SYSTEM = schedule.SYSTEM
local RUN = schedule.RUN
require(ReplicatedStorage.components)
local world = observers_add(jecs.world())
local systems = ServerScriptService.systems
SYSTEM(world, systems.replication)
SYSTEM(world, systems.players_added)
SYSTEM(world, systems.poison_hurts)
2025-07-02 16:25:20 +00:00
SYSTEM(world, systems.health_regen)
SYSTEM(world, systems.lifetimes_expire)
2025-04-28 21:40:03 +00:00
SYSTEM(world, systems.life_is_painful)
2025-07-02 16:25:20 +00:00
SYSTEM(world, ReplicatedStorage.systems.entities_delete)
2025-04-28 21:40:03 +00:00
RUN(world, 0)