summaryrefslogtreecommitdiff
path: root/main.lua
diff options
context:
space:
mode:
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua13
1 files changed, 10 insertions, 3 deletions
diff --git a/main.lua b/main.lua
index 16e27e6..30581fc 100644
--- a/main.lua
+++ b/main.lua
@@ -43,7 +43,7 @@ entities:addComponents(camera, {
transform={
matrix=Mat4():identity():translate(Vec3{0, 0, -6}),
},
- z = {value=-6},
+ z = {value=-60},
script={
script="cameraRotationScript",
},
@@ -93,8 +93,8 @@ entities:addComponents(id, {
density = 1,
radius = 1,
},
- velocity = Vec3{ 0, 0, 0 },
- angularVelocity = Vec3{ 0, 0, 0 },
+ velocity = Vec3{ 0, 10, 0 },
+ angularVelocity = Vec3{ 0, 1, 0 },
},
})
@@ -118,6 +118,9 @@ window:setKeyCallback(function(_, key, scancode, action)
if action == glfw.PRESS then
if key == glfw.KEY_ESCAPE then
window:setShouldClose(true)
+ elseif key == glfw.KEY_SPACE then
+ entities:save("save")
+ elseif key == glfw.KEY_L then
end
end
end)
@@ -150,6 +153,10 @@ end
local fpsAverage = averager(200)
+
+entities:load("save")
+
+
-- main loop
honey.loop(window, function(dt)
gl.ClearColor(0.2, 0.4, 1.0, 1.0)