diff --git a/LICENSE.txt b/LICENSE.txt index d4562b8..bc1b07a 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,5 +1,6 @@ License of textures and models Textures and nodebox of screen are by kaeza, modified by Nore, under the WTFPL license +Texture and model of turtle by kilbith, modified by Nore, under the CC0 license All other textures are by kaeza, licensed under the CC-BY-SA license ------------------------------ diff --git a/models/turtle.obj b/models/turtle.obj new file mode 100644 index 0000000..bf68a3f --- /dev/null +++ b/models/turtle.obj @@ -0,0 +1,34 @@ +# Blender v2.69 (sub 0) OBJ File: '' +# www.blender.org +mtllib turtle.mtl +o Cube +v 0.400000 -0.400000 -0.400000 +v 0.400000 -0.400000 0.400000 +v -0.400000 -0.400000 0.400000 +v -0.400000 -0.400000 -0.400000 +v 0.400000 0.400000 -0.400000 +v 0.400000 0.400000 0.400000 +v -0.400000 0.400000 0.400000 +v -0.400000 0.400000 -0.400000 +vt 0.499999 0.500000 +vt 0.499999 0.749956 +vt 0.250043 0.749957 +vt 0.250042 0.500001 +vt 0.499998 0.250043 +vt 0.250041 0.250044 +vt 0.250040 0.000088 +vt 0.499996 0.000087 +vt 0.749956 0.749956 +vt 0.749956 0.999913 +vt 0.500000 0.999913 +vt 0.250043 0.999913 +vt 0.000087 0.999913 +vt 0.000087 0.749957 +usemtl Material +s off +f 1/1 2/2 3/3 4/4 +f 5/5 8/6 7/7 6/8 +f 1/9 5/10 6/11 2/2 +f 2/2 6/11 7/12 3/3 +f 3/3 7/12 8/13 4/14 +f 5/5 1/1 4/4 8/6 diff --git a/t2.lua b/t2.lua index 0d59c1a..02e448a 100644 --- a/t2.lua +++ b/t2.lua @@ -188,16 +188,20 @@ local function done_move(pos, spos, npos) end local function done_rotation(yaw, nyaw, rotate_speed) - return (nyaw - yaw + rotate_speed - math.pi / 2) % (2 * math.pi) < math.pi + return (((nyaw - yaw + rotate_speed) % (2 * math.pi)) - math.pi) * (((nyaw - yaw) % (2 * math.pi) - math.pi)) <= 0 end minetest.register_entity("turtle:turtle", { physical = true, collisionbox = {-0.4999, -0.4999, -0.4999, 0.4999, 0.4999, 0.4999}, -- Not 0.5 to avoid the turtle being stuck due to rounding errors collides_with_objects = false, - visual = "wielditem", -- TODO: change that to a mesh, and add animations - visual_size = {x = 2/3, y = 2/3}, - textures = {"default:wood"}, + --visual = "wielditem", -- TODO: change that to a mesh, and add animations + --visual_size = {x = 2/3, y = 2/3}, + --textures = {"default:wood"}, + visual = "mesh", + mesh = "turtle.obj", + textures = {"turtle.png"}, + visual_size = {x = 10, y = 10}, on_activate = function(self, staticdata) local id = tonumber(staticdata) if id ~= nil then diff --git a/textures/turtle.png b/textures/turtle.png new file mode 100644 index 0000000..eb9728b Binary files /dev/null and b/textures/turtle.png differ