summaryrefslogtreecommitdiffhomepage
path: root/main.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-05-13 21:39:50 +0200
committerAki <nthirtyone@gmail.com>2016-05-13 21:39:50 +0200
commit8d51222d41a348867706ceaec80d36e017a8d7ab (patch)
tree60a17c31c7f08505def499c2aaa57ce3c241b213 /main.lua
parent6c1b6bdb22449c15450bd61cb1bf75a323cb40b9 (diff)
downloadroflnauts-8d51222d41a348867706ceaec80d36e017a8d7ab.zip
roflnauts-8d51222d41a348867706ceaec80d36e017a8d7ab.tar.gz
roflnauts-8d51222d41a348867706ceaec80d36e017a8d7ab.tar.bz2
Scaling
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua13
1 files changed, 9 insertions, 4 deletions
diff --git a/main.lua b/main.lua
index 3a895bf..71eba7c 100644
--- a/main.lua
+++ b/main.lua
@@ -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