mirror of
https://github.com/teverse/teverse
synced 2025-08-26 08:04:46 +02:00
Compare commits
2 Commits
52ee931492
...
c49e97ab71
Author | SHA1 | Date | |
---|---|---|---|
c49e97ab71 | |||
![]() |
1189ae6191 |
@ -30,7 +30,7 @@ local function runCourse(courseName, targetObjective)
|
|||||||
-- ...
|
-- ...
|
||||||
```
|
```
|
||||||
## Documentation
|
## Documentation
|
||||||
To promote readability, understanding and maintainability of shared code, documentation is necessary for for all methods.
|
To promote readability, understanding and maintainability of shared code, documentation is necessary for all methods.
|
||||||
|
|
||||||
#### Good
|
#### Good
|
||||||
``` lua
|
``` lua
|
||||||
|
@ -33,7 +33,7 @@ return {
|
|||||||
size = vector3(1, 1, 1),
|
size = vector3(1, 1, 1),
|
||||||
position = vector3(1, 0, 0),
|
position = vector3(1, 0, 0),
|
||||||
mesh = "primitive:wedge",
|
mesh = "primitive:wedge",
|
||||||
rotation = quaternion:setEuler(0, math.rad(-90), 0)
|
rotation = quaternion:setEuler(0, math.rad(90), 0)
|
||||||
})
|
})
|
||||||
|
|
||||||
local block = engine.construct("block", workspace, {
|
local block = engine.construct("block", workspace, {
|
||||||
@ -43,55 +43,6 @@ return {
|
|||||||
position = vector3(0.5, 1, 0),
|
position = vector3(0.5, 1, 0),
|
||||||
mesh = "primitive:sphere"
|
mesh = "primitive:sphere"
|
||||||
})
|
})
|
||||||
|
|
||||||
-- this debug code needs to be moved elsewhere
|
|
||||||
--[[
|
|
||||||
local compoundGroup = engine.construct("compoundGroup", workspace, {
|
|
||||||
name = "testCompoundGroup"
|
|
||||||
})
|
|
||||||
|
|
||||||
local testA = engine.construct("block", compoundGroup, {
|
|
||||||
colour = colour(1, 0, 0),
|
|
||||||
size = vector3(1, 1, 1),
|
|
||||||
position = vector3(0, 10, 1)
|
|
||||||
})
|
|
||||||
|
|
||||||
local testB = engine.construct("block", compoundGroup, {
|
|
||||||
colour = colour(0, 1, 0),
|
|
||||||
size = vector3(1, 1, 1),
|
|
||||||
position = vector3(0, 11, 0)
|
|
||||||
})
|
|
||||||
|
|
||||||
local testC = engine.construct("block", compoundGroup, {
|
|
||||||
colour = colour(0, 0, 1),
|
|
||||||
size = vector3(1, 1, 1),
|
|
||||||
position = vector3(1, 12, 0)
|
|
||||||
})
|
|
||||||
--]]
|
|
||||||
-- block:on("collisionStarted", function (collidingWith, hit, normal)
|
|
||||||
-- local b = engine.construct("block", workspace, {
|
|
||||||
-- position = hit,
|
|
||||||
-- physics = false,
|
|
||||||
-- size = vector3(0.1, 0.1, 0.1),
|
|
||||||
-- mesh = "primitive:sphere"
|
|
||||||
-- })
|
|
||||||
-- wait(1)
|
|
||||||
-- b:destroy()
|
|
||||||
-- end)
|
|
||||||
|
|
||||||
-- spawnThread(function ( ... )
|
|
||||||
-- while wait() do
|
|
||||||
-- local mouseHit = engine.physics:rayTestScreen( engine.input.mousePosition )
|
|
||||||
-- if mouseHit then
|
|
||||||
-- local b = engine.construct("block", workspace, {
|
|
||||||
-- position = mouseHit.hitPosition,
|
|
||||||
-- physics = false,
|
|
||||||
-- size = vector3(0.1, 0.1, 0.1),
|
|
||||||
-- mesh = "primitive:sphere"
|
|
||||||
-- })
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- end)
|
|
||||||
end,
|
end,
|
||||||
|
|
||||||
setupEnvironment = function ()
|
setupEnvironment = function ()
|
||||||
|
@ -647,18 +647,18 @@ createInputs = {
|
|||||||
borderRadius = 2,
|
borderRadius = 2,
|
||||||
})
|
})
|
||||||
|
|
||||||
col:mouseLeftReleased(function ()
|
-- col:mouseLeftReleased(function ()
|
||||||
controller.colourPicker.window.visible = not controller.colourPicker.window.visible
|
-- controller.colourPicker.window.visible = not controller.colourPicker.window.visible
|
||||||
if controller.colourPicker.window.visible and instanceEditing and instanceEditing[property] then
|
-- if controller.colourPicker.window.visible and instanceEditing and instanceEditing[property] then
|
||||||
controller.colourPicker.setColour(instanceEditing[property])
|
-- controller.colourPicker.setColour(instanceEditing[property])
|
||||||
controller.colourPicker.setCallback(function (c)
|
-- controller.colourPicker.setCallback(function (c)
|
||||||
x.text = tostring(c.r)
|
-- x.text = tostring(c.r)
|
||||||
g.text = tostring(c.g)
|
-- g.text = tostring(c.g)
|
||||||
b.text = tostring(c.b)
|
-- b.text = tostring(c.b)
|
||||||
parseInputs[type(value)](property, container)
|
-- parseInputs[type(value)](property, container)
|
||||||
end)
|
-- end)
|
||||||
end
|
-- end
|
||||||
end)
|
-- end)
|
||||||
|
|
||||||
return container
|
return container
|
||||||
end,
|
end,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user