-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
36 lines (26 loc) · 896 Bytes
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--This script will run on all levels when mod is active.
--Modding documentation: http://teardowngame.com/modding
--API reference: http://teardowngame.com/modding/api.html
local startTime = 0
function init()
distance = 0
startTime = GetTime()
lastPos = GetPlayerTransform().pos
end
function tick(dt)
distance = distance + VecLength(VecSub(GetPlayerTransform().pos,lastPos))
lastPos = GetPlayerTransform().pos
DebugWatch("Distance Travelled Since Level Load", math.floor(distance*10)/10 .. " Voxels")
ticktwo(dt)
tickthree(dt)
end
function ticktwo(dt)
local elapsedTime = GetTime() - startTime
DebugWatch("Time Since Loaded", math.floor(elapsedTime*10)/10 .. " Seconds")
end
function tickthree(dt)
DebugWatch("Voxels Destroyed Since Level Load", math.floor (destroyed*10)/10 .. " Voxels")
function update(dt)
end
function draw(dt)
end