Fix
This commit is contained in:
parent
b50caa0b53
commit
9560c68a17
3 changed files with 31 additions and 0 deletions
31
mods/rgt_player/init.lua
Normal file
31
mods/rgt_player/init.lua
Normal 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)
|
||||
BIN
mods/rgt_player/textures/rgt_heart_empty.png
Normal file
BIN
mods/rgt_player/textures/rgt_heart_empty.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 178 B |
Binary file not shown.
|
Before Width: | Height: | Size: 95 B After Width: | Height: | Size: 193 B |
Loading…
Add table
Add a link
Reference in a new issue