First commit. Just a beating heart.

This commit is contained in:
Yves Quemener 2019-08-31 03:19:35 +09:00
commit 5ef4317e4b
3 changed files with 35 additions and 0 deletions

31
init.lua Normal file
View File

@ -0,0 +1,31 @@
socialemote = {}
function socialemote.show_heart(player)
local object = minetest.add_entity(player:get_pos(), "socialemote:heart_bubble")
object:set_attach(player, "Head", {x=-4.0, y=10.0, z=0.0}, {x=0, y=0, z=0}, {x=0.5, y=0.5, z=0.5})
object:set_sprite({x=1, y=1}, 3, 0.3, false)
minetest.after(5.0, function()
object:remove()
end)
end
minetest.register_entity("socialemote:heart_bubble", {
visual = "sprite",
textures = {"socialemote_heart_animated.png"},
spritediv = {x = 1, y = 3},
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 0.5,
},
springiness= 0,
})
minetest.register_chatcommand("love", {
description = "Shows a beating heart for 5 seconds",
params = "",
privs = {},
func = function(name, param)
socialemote.show_heart(minetest.get_player_by_name(name))
end })

4
mod.conf Normal file
View File

@ -0,0 +1,4 @@
name = socialemote
description = Social emotes that appear next to the character
title = Social Emotes
depends =

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 B