summaryrefslogtreecommitdiff
path: root/client/game.lua
diff options
context:
space:
mode:
Diffstat (limited to 'client/game.lua')
-rw-r--r--client/game.lua22
1 files changed, 14 insertions, 8 deletions
diff --git a/client/game.lua b/client/game.lua
index fd4ade9..aa2e94c 100644
--- a/client/game.lua
+++ b/client/game.lua
@@ -122,12 +122,17 @@ local remote_players = {}
local function update_local_player(pl,dt)
local SPEED = 8*math.sqrt(3) -- 8 hexagonheights per second
- if love.keyboard.isDown("lshift") then SPEED = SPEED*2 end
- local function kd(code)
- if love.keyboard.isScancodeDown(code) then return 1 else return 0 end
+ if love.keyboard.isDown("lshift") or love.keyboard.isScancodeDown'kpenter' then
+ SPEED = SPEED*2
end
- local dx = kd"d"-kd"a"
- local dy = kd"s"-kd"w"
+ local function kd(codes)
+ for _,code in ipairs(codes) do
+ if love.keyboard.isScancodeDown(code) then return 1 end
+ end
+ return 0
+ end
+ local dx = kd{"d","kp6"}-kd{"a","kp4"}
+ local dy = kd{"s","kp5"}-kd{"w","kp8"}
if dx == 0 and dy == 0 then
return
@@ -262,9 +267,7 @@ local function draw()
draw_player(pl)
end
- love.graphics.setColor(1,0,0)
- love.graphics.rectangle("fill",0,0,1,1)
-
+ -- mouse position (resp. screen, world, hex)
local sm = Pos:make(love.mouse.getPosition())
local wm = camera:screen_to_world(sm)
local hm = wm:to_hex()
@@ -290,7 +293,9 @@ local function draw()
love.graphics.origin()
+ -- selected tile (temp)
util.print_good(tostring(selected_tile), "center",10)
+
if _G.debugmode and local_player then
util.print_good(table.concat({
"ms "..tostring(sm),
@@ -307,6 +312,7 @@ local function draw()
},"\n"),10,10)
end
+
if show_controls then
util.print_good(help_text,"center","center")
end