a
This commit is contained in:
parent
12ffbdc45d
commit
13ddce15ae
15 changed files with 8967 additions and 61 deletions
|
@ -1,15 +1,15 @@
|
|||
pp = require("cc.pretty")
|
||||
|
||||
if _G.pos == nil then
|
||||
_G.facing = "south"
|
||||
_G.pos = vector.new(0,0,0)
|
||||
file = fs.open("pos.txt", "r")
|
||||
data = splitString(file.readAll())
|
||||
_G.pos.x = tonumber(data[1])
|
||||
_G.pos.y = tonumber(data[2])
|
||||
_G.pos.z = tonumber(data[3])
|
||||
_G.facing = data[4]
|
||||
end
|
||||
-- if _G.pos == nil then
|
||||
_G.facing = "south"
|
||||
_G.pos = vector.new(0,0,0)
|
||||
-- file = fs.open("pos.txt", "r")
|
||||
-- data = splitString(file.readAll())
|
||||
-- _G.pos.x = tonumber(data[1])
|
||||
-- _G.pos.y = tonumber(data[2])
|
||||
-- _G.pos.z = tonumber(data[3])
|
||||
-- _G.facing = data[4]
|
||||
-- end
|
||||
|
||||
local up = vector.new(0,1,0)
|
||||
|
||||
|
@ -35,9 +35,9 @@ local vecOf = {
|
|||
}
|
||||
|
||||
function savePos()
|
||||
fs.delete("pos.txt")
|
||||
file = fs.open("pos.txt", "w")
|
||||
file.write(_G.pos.x .. " " .. _G.pos.y .. " " .. _G.pos.z .. " " .. _G.facing)
|
||||
-- fs.delete("pos.txt")
|
||||
-- file = fs.open("pos.txt", "w")
|
||||
-- file.write(_G.pos.x .. " " .. _G.pos.y .. " " .. _G.pos.z .. " " .. _G.facing)
|
||||
end
|
||||
|
||||
|
||||
|
@ -112,8 +112,7 @@ end
|
|||
function go_to(target, face)
|
||||
while target ~= _G.pos do
|
||||
stepTo(target)
|
||||
-- print(_G.pos, _G.facing, target, face)
|
||||
print(_G.pos, _G.facing)
|
||||
-- print(_G.pos, _G.facing)
|
||||
end
|
||||
if face and face ~= _G.facing then
|
||||
if rightOf[_G.facing] == face then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue