diff options
author | Aki <nthirtyone@gmail.com> | 2016-05-13 21:39:50 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2016-05-13 21:39:50 +0200 |
commit | 8d51222d41a348867706ceaec80d36e017a8d7ab (patch) | |
tree | 60a17c31c7f08505def499c2aaa57ce3c241b213 /main.lua | |
parent | 6c1b6bdb22449c15450bd61cb1bf75a323cb40b9 (diff) | |
download | roflnauts-8d51222d41a348867706ceaec80d36e017a8d7ab.zip roflnauts-8d51222d41a348867706ceaec80d36e017a8d7ab.tar.gz roflnauts-8d51222d41a348867706ceaec80d36e017a8d7ab.tar.bz2 |
Scaling
Diffstat (limited to 'main.lua')
-rw-r--r-- | main.lua | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -57,6 +57,10 @@ function love.keypressed (key) if key == "x" then debug = not debug end + -- + if key == "z" then + camera.scale = (camera.scale % 2) + 1 + end -- Players for k,naut in pairs(Nauts) do naut:keypressed(key) @@ -74,19 +78,20 @@ function love.draw () -- Draw SOME background -- I'm already bored with solid color! love.graphics.setColor(193, 100, 99, 255) - love.graphics.rectangle("fill", 0, 0, love.graphics.getWidth(), 60) + love.graphics.rectangle("fill", 0, 0, love.graphics.getWidth(), love.graphics.getHeight()*0.25) love.graphics.setColor(179, 82, 80, 255) - love.graphics.rectangle("fill", 0, 160, love.graphics.getWidth(), 40) + love.graphics.rectangle("fill", 0, love.graphics.getHeight()*0.8, love.graphics.getWidth(), love.graphics.getHeight()*0.2) local offset_x, offset_y = camera:getOffsets() + local scale = camera.scale -- Draw ground for k,platform in pairs(Platforms) do - platform:draw(offset_x, offset_y, debug) + platform:draw(offset_x, offset_y, scale, debug) end -- Draw player for k,naut in pairs(Nauts) do - naut:draw(offset_x, offset_y, debug) + naut:draw(offset_x, offset_y, scale, debug) end end |