mirror of
https://github.com/tacigar/maidroid.git
synced 2025-01-09 15:50:18 +01:00
[UPDATE] Use automatic_face_movement_dir
This commit is contained in:
parent
eb68cf21a9
commit
006ab613b5
@ -313,40 +313,41 @@ function maidroid.register_maidroid(product_name, def)
|
||||
-- register a definition of a new maidroid.
|
||||
minetest.register_entity(product_name, {
|
||||
-- basic initial properties
|
||||
hp_max = def.hp_max,
|
||||
weight = def.weight,
|
||||
mesh = def.mesh,
|
||||
textures = def.textures,
|
||||
hp_max = def.hp_max,
|
||||
weight = def.weight,
|
||||
mesh = def.mesh,
|
||||
textures = def.textures,
|
||||
|
||||
physical = true,
|
||||
visual = "mesh",
|
||||
visual_size = {x = 10, y = 10},
|
||||
collisionbox = {-0.25, -0.5, -0.25, 0.25, 1.05, 0.25},
|
||||
is_visible = true,
|
||||
makes_footstep_sound = true,
|
||||
physical = true,
|
||||
visual = "mesh",
|
||||
visual_size = {x = 10, y = 10},
|
||||
collisionbox = {-0.25, -0.5, -0.25, 0.25, 1.05, 0.25},
|
||||
is_visible = true,
|
||||
makes_footstep_sound = true,
|
||||
automatic_face_movement_dir = 90.0,
|
||||
|
||||
-- extra initial properties
|
||||
pause = false,
|
||||
product_name = "",
|
||||
manufacturing_number = -1,
|
||||
core_name = "",
|
||||
pause = false,
|
||||
product_name = "",
|
||||
manufacturing_number = -1,
|
||||
core_name = "",
|
||||
|
||||
-- callback methods.
|
||||
on_activate = on_activate,
|
||||
on_step = on_step,
|
||||
on_rightclick = on_rightclick,
|
||||
on_punch = on_punch,
|
||||
get_staticdata = get_staticdata,
|
||||
on_activate = on_activate,
|
||||
on_step = on_step,
|
||||
on_rightclick = on_rightclick,
|
||||
on_punch = on_punch,
|
||||
get_staticdata = get_staticdata,
|
||||
|
||||
-- extra methods.
|
||||
get_inventory = maidroid.maidroid.get_inventory,
|
||||
get_core = maidroid.maidroid.get_core,
|
||||
get_core_name = maidroid.maidroid.get_core_name,
|
||||
get_nearest_player = maidroid.maidroid.get_nearest_player,
|
||||
get_front_node = maidroid.maidroid.get_front_node,
|
||||
get_look_direction = maidroid.maidroid.get_look_direction,
|
||||
set_animation = maidroid.maidroid.set_animation,
|
||||
set_yaw_by_direction = maidroid.maidroid.set_yaw_by_direction,
|
||||
get_inventory = maidroid.maidroid.get_inventory,
|
||||
get_core = maidroid.maidroid.get_core,
|
||||
get_core_name = maidroid.maidroid.get_core_name,
|
||||
get_nearest_player = maidroid.maidroid.get_nearest_player,
|
||||
get_front_node = maidroid.maidroid.get_front_node,
|
||||
get_look_direction = maidroid.maidroid.get_look_direction,
|
||||
set_animation = maidroid.maidroid.set_animation,
|
||||
set_yaw_by_direction = maidroid.maidroid.set_yaw_by_direction,
|
||||
})
|
||||
|
||||
-- register a spawner for debugging maidroid mods.
|
||||
|
@ -45,7 +45,6 @@ local function on_step(self, dtime)
|
||||
end
|
||||
self.object:setvelocity{x = direction.x, y = velocity.y, z = direction.z} -- TODO
|
||||
end
|
||||
self:set_yaw_by_direction(direction)
|
||||
|
||||
-- if maidroid is stoped by obstacle, the maidroid must jump.
|
||||
if velocity.y == 0 and self.state == state.ACCOMPANY then
|
||||
|
Loading…
Reference in New Issue
Block a user