Reduced a graphical artifact, but it's still visible

This commit is contained in:
2016-04-08 23:50:52 +10:00
parent 82d5a5c181
commit ec409c8177
22 changed files with 10 additions and 2 deletions
+10 -2
View File
@@ -57,16 +57,24 @@ local function bunnySquare(creature)
--is it time to change direction?
if os.time() - tonumber(timestamp) >= 1 then
if os.time() - tonumber(timestamp) >= 4 then
-- print("changing directions")
if string.match("south", direction) then
direction = "east"
creatureAPI.SetMotion(creature, 1, 0)
else
if string.match("east", direction) then
direction = "north"
creatureAPI.SetMotion(creature, 0, -1)
else
if string.match("north", direction) then
direction = "west"
creatureAPI.SetMotion(creature, -1, 0)
else --south is a default
direction = "south"
creatureAPI.SetMotion(creature, 0, 1)
end
end end end
timestamp = tostring(os.time())
ret = 1
end