It seems to me you come from a different language that supported references. If this is not the case, please mention it so I can redo my explanation. Variables can be global, or local to a scope (In loops, in functions, etc). Values passed to functions or defined to another variable are copied. The ...
This effect can be achieved by shearing the sprite. love.graphics.draw last 2 optional arguments are 'kx' and 'ky'. For this particular effect, only kx should be increased / decreased. To see it in action you can try map it to a sine function. Do note that for it to look good you will have to put th...
I made a few mistakes in my code. For clarity I have made a .love demonstrating how it works.
You can also do the transformations with the functions Zorg provided.
Lick overwrites love.run with a variant that seems to is pre - 0.10. In this case, it calls love.graphics.clear without passing the background colors as arguments. Simply go to line 125 and change it to: love.graphics.clear(love.graphics.getBackgroundColor()) If any more weird problems I'd suggest d...
The reason that your object is flying to the left is because you're setting the position directly, instead of cancelling the offset. I explained this in my post. Either way, here's a full snippet that should fully work: world = bump.newWorld(32) local item = { x = 0, y = 0, w = 100, h = 100, } funct...
That makes sense but for some reason doesn't work that well. function love.load() world:add(player, player.x - player.w/2, player.y, player.w/2, player.h) function love.update(dt) world:move(player, player.x + player.dx, player.y + player.dy) Is this what you mean? How would I alter the move functi...
When you register the body, offset it by half the length and width. world:add(item, item.x - item.w/2, item.y - item.h/2, item.w, item.h Also do this for :update and similair functions. When you try to :move a body, do it as follows: local newX, newY, cols, len = world:move(item, item.x - item.w/2, ...