Browse Source

First commit. Just a beating heart.

master
Yves Quemener 2 weeks ago
commit
5ef4317e4b
3 changed files with 35 additions and 0 deletions
  1. 31
    0
      init.lua
  2. 4
    0
      mod.conf
  3. BIN
      textures/socialemote_heart_animated.png

+ 31
- 0
init.lua 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
- 0
mod.conf View File

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

BIN
textures/socialemote_heart_animated.png View File


Loading…
Cancel
Save