-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query budgets (debugger) #107
Conversation
Can I get a few screenshots of this in action on a system, and the code that's in the system? |
https://i.gyazo.com/d82555ce5afdb2dbcdd500e0d9f998d1.gif
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Components = require(ReplicatedStorage.Shared.components)
local Matter = require(ReplicatedStorage.Lib.Matter)
local function mothershipsSpawnRoombas(world)
for id, model, lasering, transform in
world:query(Components.Model, Components.Lasering, Components.Transform, Components.Mothership)
do
model.model.Beam.Transparency = 1 - lasering.remainingTime
lasering = lasering:patch({
remainingTime = lasering.remainingTime - Matter.useDeltaTime(),
})
if not lasering.spawned then
local spawnPosition = Vector3.new(transform.cframe.p.X, 11, transform.cframe.p.Z)
world:spawn(
Components.Roomba(),
Components.Charge({
charge = 100,
}),
Components.Transform({
cframe = CFrame.new(spawnPosition),
})
)
lasering = lasering:patch({ spawned = true })
end
if lasering.remainingTime <= 0 then
world:remove(id, Components.Lasering)
else
world:insert(id, lasering)
end
end
end
return mothershipsSpawnRoombas
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Components = require(ReplicatedStorage.Shared.components)
local Matter = require(ReplicatedStorage.Lib.Matter)
local function playersAreTargets(world)
for _, player in ipairs(Players:GetPlayers()) do
for _, character in Matter.useEvent(player, "CharacterAdded") do
world:spawn(
Components.Target(),
Components.Model({
model = character,
})
)
end
end
-- players can die
for id in world:query(Components.Target):without(Components.Model) do
world:despawn(id)
end
end
return playersAreTargets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Closes #106 (once PR is ready for review)