-- Global state --win = require("window") hc = require("party.hc.init") --ecs = require("ecs") --settings = require("settings") color = require("color") log = require("log") MAX_LAMPS = 8 --Use a collider to decide what to render x = { -- client-side viewport offsets from the world world_x: 0 world_y: 0 -- Have we selected an input type yet? controller: { -- logical input abstraction, not a physical input device controller text_size: 1 } domain: "client" -- "client" or "server" -- (Client) Level information level: { graphics:{} -- Client side graphics entities:{} -- Client side entities graphic_world: hc.new(5) -- Client side graphics world physics_world: hc.new(1) collider: nil -- Collider in the physics world to figure out what we can see } -- (Server Networked) level information level_sync: { name: "" -- The name of the level data: {} -- sequence, holds arguments for level initalization ents: {} -- holds all the entities in the level entid: 0 -- a nonce entid, just keep increasing and allows for holes in "ents" peers: {} -- holds peers in [peerid: string] = Entity phys: hc.new(5) -- The physics world we need to collide with ref: nil -- Holds a ref to the level, has things like name, get_spawn_location(), ect. } sync_time: () -> am.current_time! hub: nil -- server, filled out later network: nil -- client, filled out later -- Stuff that goes to the shader geom_view: nil -- am.vec3_array uv_view: nil -- am.vec4_array check: () => assert(@level_sync.ents, "Ents is nil") assert(type(@level_sync.ents), "ents is not a table") } log.info("At the end of src/world.moon, world_x is" .. tostring(x.world_x)) x