summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2023-06-18 03:34:03 +0100
committerubq323 <ubq323@ubq323.website>2023-06-18 03:36:08 +0100
commit598bd4332deddd5f4c506689cbd136f495835ea7 (patch)
treeff9dbbb23d584ed2ef7c29492c89e2e7fe04e9da
parent6ca2cc22977f729fb6e40bdd0f00da4edf3cb777 (diff)
actually send the username
-rw-r--r--client/game.lua6
-rw-r--r--client/main.lua2
2 files changed, 6 insertions, 2 deletions
diff --git a/client/game.lua b/client/game.lua
index 31e02b8..c5cdffb 100644
--- a/client/game.lua
+++ b/client/game.lua
@@ -343,6 +343,7 @@ end
local connected = false
local sent_hshake = false
+local username = nil
function SCENE.update(dt)
if connected then
return update(dt)
@@ -367,11 +368,14 @@ function SCENE.draw()
end
end
-function SCENE.load(username)
+function SCENE.load(_username)
love.keyboard.setKeyRepeat(true)
-- require"profile".start(10,io.open("./trace","w"))
host = enet.host_create()
peer = host:connect(SERVER_HOSTNAME..":8473",2)
+ username = _username
+ print("got username",_username)
+
end
function SCENE.quit()
diff --git a/client/main.lua b/client/main.lua
index 1d9409f..7388c67 100644
--- a/client/main.lua
+++ b/client/main.lua
@@ -42,7 +42,7 @@ function titlescene.keypressed(k,s,r)
username = username:sub(1,b-1)
end
elseif k=="return" then
- switch_scene(gamescene)
+ switch_scene(gamescene, username)
end
end