This commit is contained in:
Signal 2025-09-14 23:18:11 -04:00
parent b50caa0b53
commit 9560c68a17
3 changed files with 31 additions and 0 deletions

31
mods/rgt_player/init.lua Normal file
View file

@ -0,0 +1,31 @@
local ns = rgt
ns.players = {}
Player = {
new = function(p)
local e = setmetatable({
name = p:get_player_name(),
object = p
}, {__index = Player})
return e
end
}
setmetatable(Player, {
__call = function(_, ...) return Player.new(...) end
})
-- TODO: Replace builtin health system with custom health system
minetest.hud_replace_builtin("health", {
type = "statbar",
position = {x=0.5,y=1},
offset = {x=-27 *10 -1,y=-96},
scale = {x=4,y=4},
alignment = {x=-1, y=-1},
size = {x=27,y=27},
text = "rgt_heart.png",
text2 = "rgt_heart_empty.png"
})
minetest.register_on_joinplayer(function(p)
ns.players[p:get_player_name()] = Player(p)
end)

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B