Search found 240 matches

by Tjakka5
Fri Feb 02, 2018 12:30 pm
Forum: Support and Development
Topic: Bump.lua - how to change or display collision box?
Replies: 21
Views: 3689

Re: Bump.lua - how to change or display collision box?

world:update is needed for when you want to change the dimensions (Or move somewhere without collision).

What you were missing what cancelling the offset after calling world:move.
In your examples, you were setting the player position directly.
by Tjakka5
Fri Feb 02, 2018 12:07 pm
Forum: Support and Development
Topic: Bump.lua - how to change or display collision box?
Replies: 21
Views: 3689

Re: Bump.lua - how to change or display collision box?

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.
by Tjakka5
Fri Feb 02, 2018 11:54 am
Forum: Support and Development
Topic: Background colour won't change
Replies: 10
Views: 1934

Re: Background colour won't change

If you're looking for alternatives, Lurker has always worked well for me.
https://github.com/rxi/lurker
by Tjakka5
Fri Feb 02, 2018 11:10 am
Forum: Support and Development
Topic: Background colour won't change
Replies: 10
Views: 1934

Re: Background colour won't change

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...
by Tjakka5
Fri Feb 02, 2018 11:05 am
Forum: Support and Development
Topic: Bump.lua - how to change or display collision box?
Replies: 21
Views: 3689

Re: Bump.lua - how to change or display collision box?

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...
by Tjakka5
Fri Feb 02, 2018 8:40 am
Forum: Support and Development
Topic: Bump.lua - how to change or display collision box?
Replies: 21
Views: 3689

Re: Bump.lua - how to change or display collision box?

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...
by Tjakka5
Thu Feb 01, 2018 1:20 pm
Forum: Support and Development
Topic: Bump.lua - how to change or display collision box?
Replies: 21
Views: 3689

Re: Bump.lua - how to change or display collision box?

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, ...
by Tjakka5
Thu Feb 01, 2018 12:03 pm
Forum: Support and Development
Topic: Bump.lua - how to change or display collision box?
Replies: 21
Views: 3689

Re: Bump.lua - how to change or display collision box?

You can use 'world:update(item, x,y,<w>,<h>)' to set position and dimensions without collision detection. For displaying the bounding boxes you can use 'world:getItems()' and 'world:getRect(item)': local items, len = world:getItems() for i = 1, len do local x, y, w, h = world:getRect(items[i]) love....
by Tjakka5
Sun Jan 28, 2018 10:07 am
Forum: General
Topic: Hot reload plugin that actually works?
Replies: 49
Views: 8233

Re: Hot reload plugin that actually works?

Corona doesn't do real "hot-reload". When you save a file, it just re-builds automatically the project from scratch. Hot-reload of assets and code while the game is playing is much more difficult to handle. A good working example is Defold (which also has a lua debugger in its editor). www.defold.c...
by Tjakka5
Sat Jan 20, 2018 9:00 pm
Forum: General
Topic: Movement - move the player AND the world?
Replies: 10
Views: 1711

Re: Movement - move the player AND the world?

Are you following the player with the camera?

Code: Select all

function love.update(dt)
    camera:update(dt)
    camera:follow(player.x, player.y)
end