The Collision
Camera
Movement
Sti...
But when I try using 0.7 or any 0.x value as sxx for my scale, the sti canvas gets cut of from the right and bottom, what other way do I fix the zooming out according to my code method, any help will be much appreciated thx.
Code: Select all
local gamera=require "gamera.gamera"
local bump = require 'bump.bump'
local sti = require "sti.sti"
function love.load()
blob={
x = 430 ,
y =250 ,
w =30,
h = 60,
speed=200
}
cam = gamera.new(-1900 ,-1600,7130,7460)
sxx = 0.7
cam:setScale(sxx)
-- Load map file
map = sti("Map01.lua",{"bump"})
map:resize(love.graphics.getWidth(),love.graphics.getHeight())
world = bump. newWorld(40)
map:bump_init(world)
end
function love.update(dt)
map:update(dt)
end
function love . draw()
local screeen_width =love.graphics.getWidth()/ sxx
local screeen_height =love.graphics.getHeight()/ sxx
tx = math .floor(blob.x - screeen_width /2 )
ty = math .floor(blob.y -screeen_height /2 )
love .graphics .setColor (1 , 1, 1)
map:draw(-tx,-ty,sxx,sxx)
love .graphics .setColor (0 , 0, 0)
map:bump_draw(world,-tx,-ty,sxx,sxx)
cam:draw(function()
drawBlob()
end
end)