35 lines
700 B
Lua
35 lines
700 B
Lua
--[[ function on_init()
|
|
print("Lua script was initialized!")
|
|
end
|
|
|
|
function on_first()
|
|
print("Lua's first function was called")
|
|
end
|
|
|
|
function on_pre_update()
|
|
print("Lua's pre-update function was called")
|
|
end ]]
|
|
|
|
function on_update()
|
|
---@type number
|
|
local dt = world:resource(DeltaTime)
|
|
|
|
local v = Vec3.new(10, 10, 10)
|
|
v:move_by(50, 50, 50)
|
|
v:move_by(Vec3.new(50, 50, 50))
|
|
print("v = " .. tostring(v))
|
|
|
|
world:view(function (t)
|
|
t:translate(0, 0.5 * dt, 0)
|
|
|
|
return t
|
|
end, Transform)
|
|
end
|
|
|
|
--[[ function on_post_update()
|
|
print("Lua's post-update function was called")
|
|
end
|
|
|
|
function on_last()
|
|
print("Lua's last function was called")
|
|
end ]] |