summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2023-08-26 06:23:34 +0100
committerubq323 <ubq323@ubq323.website>2023-08-26 06:23:34 +0100
commit3102095c9ff4939dfc0438339c7208ee7b2e2957 (patch)
tree36efe5d63372136fbc6af791d0dba91f05f2eb34 /client
parentabc57f1c5a4fcf90acc650989f3dbf52b7609e9a (diff)
print usernames better, and respond to remote players usernames
Diffstat (limited to 'client')
-rw-r--r--client/game.lua13
1 files changed, 10 insertions, 3 deletions
diff --git a/client/game.lua b/client/game.lua
index 1a6cd54..e219fef 100644
--- a/client/game.lua
+++ b/client/game.lua
@@ -116,7 +116,12 @@ local function draw_player(pl,islocal)
end
if pl.username then
- util.print_good(pl.username, pl.pos.x, pl.pos.y)
+ -- think of a better way to unscale but keep transformation
+ love.graphics.push()
+ love.graphics.translate(pl.pos.x, pl.pos.y)
+ love.graphics.scale(1/camera.zoom)
+ util.print_good(pl.username, 0, 0)
+ love.graphics.pop()
end
end
@@ -189,7 +194,8 @@ local function handle_net()
local pl = j.pl
remote_players[pl.id] = {
pos=coords.Pos:make(pl.x,pl.y),
- color=pl.color, id=pl.id
+ color=pl.color, id=pl.id,
+ username = pl.username,
}
msgbox.add(pl.id.." joined")
elseif op == "leave" then
@@ -205,7 +211,8 @@ local function handle_net()
local pl = j.pl
local_player = {
pos=coords.Pos:make(pl.x,pl.y),
- color=pl.color, id=pl.id, username=pl.username
+ color=pl.color, id=pl.id,
+ username=pl.username,
}
elseif op == "chunk" then
local ch = ChunkC:from_packet_data(j)