commit 5ef4317e4b03f71667a57f31f52948aa17b93ab6 Author: Yves Quemener Date: Sat Aug 31 03:19:35 2019 +0900 First commit. Just a beating heart. diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..238355c --- /dev/null +++ b/init.lua @@ -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 }) \ No newline at end of file diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..bbd80f4 --- /dev/null +++ b/mod.conf @@ -0,0 +1,4 @@ +name = socialemote +description = Social emotes that appear next to the character +title = Social Emotes +depends = diff --git a/textures/socialemote_heart_animated.png b/textures/socialemote_heart_animated.png new file mode 100644 index 0000000..64f2a92 Binary files /dev/null and b/textures/socialemote_heart_animated.png differ